[test] fix req default value handling in CubicWebTC.view (closes #2544376) stable
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>
Thu, 20 Dec 2012 12:14:14 +0100
branchstable
changeset 8628 b236b91836c0
parent 8619 366c8acd0cc8
child 8629 3ae893f9ec84
[test] fix req default value handling in CubicWebTC.view (closes #2544376) It's no more than the standard ``if rset`` vs. ``if rset is None`` error.
devtools/testlib.py
--- a/devtools/testlib.py	Wed Dec 12 22:13:38 2012 +0100
+++ b/devtools/testlib.py	Thu Dec 20 12:14:14 2012 +0100
@@ -815,7 +815,11 @@
         :returns: an instance of `cubicweb.devtools.htmlparser.PageInfo`
                   encapsulation the generated HTML
         """
-        req = req or rset and rset.req or self.request()
+        if req is None:
+            if rset is None:
+                req = self.request()
+            else:
+                req = rset.req
         req.form['vid'] = vid
         viewsreg = self.vreg['views']
         view = viewsreg.select(vid, req, rset=rset, **kwargs)