[test/view forms] use the official, undeprecated API
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Tue, 02 Dec 2014 11:37:01 +0100
changeset 10088 ac63f7ec5af0
parent 10087 ed0b076c119b
child 10089 6346f53c85f1
[test/view forms] use the official, undeprecated API
web/test/unittest_views_forms.py
--- a/web/test/unittest_views_forms.py	Tue May 27 18:47:24 2014 +0200
+++ b/web/test/unittest_views_forms.py	Tue Dec 02 11:37:01 2014 +0100
@@ -21,14 +21,14 @@
 class InlinedFormTC(CubicWebTC):
 
     def test_linked_to(self):
-        req = self.request()
-        formview = req.vreg['views'].select(
-            'inline-creation', req,
-            etype='File', rtype='described_by_test', role='subject',
-            peid=123,
-            petype='Salesterm')
-        self.assertEqual({('described_by_test', 'object'): [123]},
-                         formview.form.linked_to)
+        with self.admin_access.web_request() as req:
+            formview = req.vreg['views'].select(
+                'inline-creation', req,
+                etype='File', rtype='described_by_test', role='subject',
+                peid=123,
+                petype='Salesterm')
+            self.assertEqual({('described_by_test', 'object'): [123]},
+                             formview.form.linked_to)
 
 if __name__ == '__main__':
     from logilab.common.testlib import unittest_main