devtools/testlib.py
branchstable
changeset 8628 b236b91836c0
parent 8497 7f71e366cb5e
child 8645 310040c668c0
child 8652 7812093e21f7
--- 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)