server/test/unittest_security.py
changeset 10158 efc8645ece43
parent 10156 57b68193413c
child 10161 138464fc1c33
--- a/server/test/unittest_security.py	Thu Jan 22 17:18:55 2015 +0100
+++ b/server/test/unittest_security.py	Thu Jan 22 17:22:09 2015 +0100
@@ -117,12 +117,12 @@
             self.assertEqual(cnx.execute('Personne X').rowcount, 1)
 
     def test_insert_security_2(self):
-        with self.login('anon') as cu:
-            cu.execute("INSERT Affaire X")
-            self.assertRaises(Unauthorized, self.commit)
+        with self.new_access('anon').repo_cnx() as cnx:
+            cnx.execute("INSERT Affaire X")
+            self.assertRaises(Unauthorized, cnx.commit)
             # anon has no read permission on Affaire entities, so
             # rowcount == 0
-            self.assertEqual(cu.execute('Affaire X').rowcount, 0)
+            self.assertEqual(cnx.execute('Affaire X').rowcount, 0)
 
     def test_insert_rql_permission(self):
         # test user can only add une affaire related to a societe he owns