[tests/web] switch previous commit (136b5f995f8) to the new test api
Related to #3670209.
--- a/web/test/unittest_views_basecontrollers.py Wed Oct 22 14:16:47 2014 +0200
+++ b/web/test/unittest_views_basecontrollers.py Wed Dec 03 11:36:05 2014 +0100
@@ -812,18 +812,19 @@
def test_maydel_perms(self):
"""Check that AjaxEditRelationCtxComponent calls rdef.check with a
sufficient context"""
- self.remote_call('tag_entity', self.john.eid, ['python'])
+ with self.remote_calling('tag_entity', self.john.eid, ['python']) as (_, req):
+ req.cnx.commit()
with self.temporary_permissions(
(self.schema['tags'].rdefs['Tag', 'CWUser'],
{'delete': (RRQLExpression('S owned_by U'), )}, )):
- req = self.request(rql='CWUser P WHERE P login "John"',
- pageid='123', fname='view')
- ctrl = self.ctrl(req)
- rset = self.john.as_rset()
- rset.req = req
- source = ctrl.publish()
- # maydel jscall
- self.assertIn('ajaxBoxRemoveLinkedEntity', source)
+ with self.admin_access.web_request(rql='CWUser P WHERE P login "John"',
+ pageid='123', fname='view') as req:
+ ctrl = self.ctrl(req)
+ rset = self.john.as_rset()
+ rset.req = req
+ source = ctrl.publish()
+ # maydel jscall
+ self.assertIn('ajaxBoxRemoveLinkedEntity', source)
def test_pending_insertion(self):
with self.remote_calling('add_pending_inserts', [['12', 'tags', '13']]) as (_, req):