diff -r 73760bbb66bd -r 78438ad513ca server/test/unittest_multisources.py --- a/server/test/unittest_multisources.py Wed Apr 07 09:24:00 2010 +0200 +++ b/server/test/unittest_multisources.py Wed Apr 07 14:26:35 2010 +0200 @@ -109,7 +109,7 @@ self.assertEquals(metainf['type'], 'Card') self.assert_(metainf['extid']) etype = self.sexecute('Any ETN WHERE X is ET, ET name ETN, X eid %(x)s', - {'x': externent.eid}, 'x')[0][0] + {'x': externent.eid})[0][0] self.assertEquals(etype, 'Card') def test_order_limit_offset(self): @@ -129,7 +129,7 @@ self.sexecute('INSERT Affaire X: X ref "no readable card"')[0][0] aff1 = self.sexecute('INSERT Affaire X: X ref "card"')[0][0] # grant read access - self.sexecute('SET X owned_by U WHERE X eid %(x)s, U login "anon"', {'x': aff1}, 'x') + self.sexecute('SET X owned_by U WHERE X eid %(x)s, U login "anon"', {'x': aff1}) self.commit() cnx = self.login('anon') cu = cnx.cursor() @@ -139,8 +139,8 @@ def test_synchronization(self): cu = cnx2.cursor() - assert cu.execute('Any X WHERE X eid %(x)s', {'x': self.aff1}, 'x') - cu.execute('SET X ref "BLAH" WHERE X eid %(x)s', {'x': self.aff1}, 'x') + assert cu.execute('Any X WHERE X eid %(x)s', {'x': self.aff1}) + cu.execute('SET X ref "BLAH" WHERE X eid %(x)s', {'x': self.aff1}) aff2 = cu.execute('INSERT Affaire X: X ref "AFFREUX"')[0][0] cnx2.commit() try: @@ -155,20 +155,20 @@ self.failIf(rset) finally: # restore state - cu.execute('SET X ref "AFFREF" WHERE X eid %(x)s', {'x': self.aff1}, 'x') + cu.execute('SET X ref "AFFREF" WHERE X eid %(x)s', {'x': self.aff1}) cnx2.commit() def test_simplifiable_var(self): affeid = self.sexecute('Affaire X WHERE X ref "AFFREF"')[0][0] rset = self.sexecute('Any X,AA,AB WHERE E eid %(x)s, E in_state X, X name AA, X modification_date AB', - {'x': affeid}, 'x') + {'x': affeid}) self.assertEquals(len(rset), 1) self.assertEquals(rset[0][1], "pitetre") def test_simplifiable_var_2(self): affeid = self.sexecute('Affaire X WHERE X ref "AFFREF"')[0][0] rset = self.sexecute('Any E WHERE E eid %(x)s, E in_state S, NOT S name "moved"', - {'x': affeid, 'u': self.session.user.eid}, 'x') + {'x': affeid, 'u': self.session.user.eid}) self.assertEquals(len(rset), 1) def test_sort_func(self): @@ -216,7 +216,7 @@ rset = self.sexecute('Any X,Y WHERE X is Card, Y is Affaire, X title T, Y ref T') self.assertEquals(len(rset), 2, rset.rows) finally: - cu.execute('DELETE Card X WHERE X eid %(x)s', {'x': ec2}, 'x') + cu.execute('DELETE Card X WHERE X eid %(x)s', {'x': ec2}) cnx2.commit() def test_attr_unification_neq_1(self): @@ -258,15 +258,15 @@ userstate = self.session.user.in_state[0] states.remove((userstate.eid, userstate.name)) notstates = set(tuple(x) for x in self.sexecute('Any S,SN WHERE S is State, S name SN, NOT X in_state S, X eid %(x)s', - {'x': self.session.user.eid}, 'x')) + {'x': self.session.user.eid})) self.assertSetEquals(notstates, states) aff1 = self.sexecute('Any X WHERE X is Affaire, X ref "AFFREF"')[0][0] - aff1stateeid, aff1statename = self.sexecute('Any S,SN WHERE X eid %(x)s, X in_state S, S name SN', {'x': aff1}, 'x')[0] + aff1stateeid, aff1statename = self.sexecute('Any S,SN WHERE X eid %(x)s, X in_state S, S name SN', {'x': aff1})[0] self.assertEquals(aff1statename, 'pitetre') states.add((userstate.eid, userstate.name)) states.remove((aff1stateeid, aff1statename)) notstates = set(tuple(x) for x in self.sexecute('Any S,SN WHERE S is State, S name SN, NOT X in_state S, X eid %(x)s', - {'x': aff1}, 'x')) + {'x': aff1})) self.assertSetEquals(notstates, states) def test_absolute_url_base_url(self):