fix test broken by recent rql rewrite / querier changes
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 16 Mar 2010 17:19:10 +0100
changeset 4915 d657b89df9f4
parent 4914 dcb055f32d9b
child 4917 756ded5bc9eb
fix test broken by recent rql rewrite / querier changes
server/test/unittest_msplanner.py
server/test/unittest_security.py
--- a/server/test/unittest_msplanner.py	Tue Mar 16 16:32:36 2010 +0100
+++ b/server/test/unittest_msplanner.py	Tue Mar 16 17:19:10 2010 +0100
@@ -1010,7 +1010,7 @@
         self.session = self.user_groups_session('guests')
         self._test('Any X,XT,U WHERE X is Card, X owned_by U?, X title XT, U login L',
                    [('FetchStep',
-                     [('Any U,L WHERE U identity 5, U login L, U is CWUser',
+                     [('Any U,L WHERE U login L, EXISTS(U identity 5), U is CWUser',
                        [{'L': 'String', u'U': 'CWUser'}])],
                      [self.system], {}, {'L': 'table0.C1', 'U': 'table0.C0', 'U.login': 'table0.C1'}, []),
                     ('FetchStep',
--- a/server/test/unittest_security.py	Tue Mar 16 16:32:36 2010 +0100
+++ b/server/test/unittest_security.py	Tue Mar 16 17:19:10 2010 +0100
@@ -456,8 +456,8 @@
         rset = cu.execute('CWUser X WHERE X eid %(x)s', {'x': anon.eid}, 'x')
         self.assertEquals(rset.rows, [[anon.eid]])
         # but can't modify it
-        self.assertRaises(Unauthorized,
-                          cu.execute, 'SET X login "toto" WHERE X eid %(x)s', {'x': anon.eid})
+        cu.execute('SET X login "toto" WHERE X eid %(x)s', {'x': anon.eid})
+        self.assertRaises(Unauthorized, cnx.commit)
 
     def test_in_group_relation(self):
         cnx = self.login('iaminusersgrouponly')