[devtools] CWTC.request is gone, don't attempt to use it in CWTC.view
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 29 Aug 2016 12:05:11 +0200
changeset 11462 2046b3a4da5d
parent 11460 5be729810695
child 11463 31e2de4d23a6
[devtools] CWTC.request is gone, don't attempt to use it in CWTC.view So one will have to provide at least one of `rset` or `req` argument of the `view` method.
cubicweb/devtools/testlib.py
--- a/cubicweb/devtools/testlib.py	Wed Jun 08 21:59:34 2016 +0200
+++ b/cubicweb/devtools/testlib.py	Mon Aug 29 12:05:11 2016 +0200
@@ -942,10 +942,8 @@
                   encapsulation the generated HTML
         """
         if req is None:
-            if rset is None:
-                req = self.request()
-            else:
-                req = rset.req
+            assert rset is not None, 'you must supply at least one of rset or req'
+            req = rset.req
         req.form['vid'] = vid
         viewsreg = self.vreg['views']
         view = viewsreg.select(vid, req, rset=rset, **kwargs)