--- 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