Commit 8d21aaee authored by Julien Muchembled's avatar Julien Muchembled

qa: fix tests with recent ZODB/transaction

parent e2183483
......@@ -267,8 +267,8 @@ class ClientTests(NEOFunctionalTest):
db2, conn2 = self.neo.getZODBConnection()
st1, st2 = conn1._storage, conn2._storage
t1, t2 = transaction.Transaction(), transaction.Transaction()
t1.user = t2.user = 'user'
t1.description = t2.description = 'desc'
t1.user = t2.user = u'user'
t1.description = t2.description = u'desc'
oid = st1.new_oid()
rev = '\0' * 8
data = zodb_pickle(PObject())
......@@ -311,8 +311,8 @@ class ClientTests(NEOFunctionalTest):
db2, conn2 = self.neo.getZODBConnection()
st1, st2 = conn1._storage, conn2._storage
t1, t2 = transaction.Transaction(), transaction.Transaction()
t1.user = t2.user = 'user'
t1.description = t2.description = 'desc'
t1.user = t2.user = u'user'
t1.description = t2.description = u'desc'
oid = st1.new_oid()
rev = '\0' * 8
data = zodb_pickle(PObject())
......@@ -330,8 +330,8 @@ class ClientTests(NEOFunctionalTest):
db3, conn3 = self.neo.getZODBConnection()
st3 = conn3._storage
t3 = transaction.Transaction()
t3.user = 'user'
t3.description = 'desc'
t3.user = u'user'
t3.description = u'desc'
st3.tpc_begin(t3)
# retrieve the last revision
data, serial = st3.load(oid)
......
......@@ -367,7 +367,7 @@ class Test(NEOThreadedTest):
tid1 = o1._p_serial
resolved = []
last = (t2.get(), t3.get()).index
last = lambda txn: txn._extension['last'] # BBB
def _handleConflicts(orig, txn_context, *args):
resolved.append(last(txn_context['txn']))
return orig(txn_context, *args)
......@@ -378,7 +378,8 @@ class Test(NEOThreadedTest):
with LockLock() as l3, Patch(cluster.client, tpc_vote=tpc_vote):
with LockLock() as l2:
tt = []
for t, l in (t2, l2), (t3, l3):
for i, t, l in (0, t2, l2), (1, t3, l3):
t.get().setExtendedInfo('last', i)
tt.append(self.newThread(t.commit))
l()
tt.pop(0).join()
......
......@@ -556,7 +556,7 @@ class ReplicationTests(NEOThreadedTest):
# commit new data to U
txn = transaction.Transaction()
txn.note('test transaction %i' % i)
txn.note(u'test transaction %s' % i)
Z.tpc_begin(txn)
oid = Z.new_oid()
Z.store(oid, None, '%s-%i' % (oid, i), '', txn)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment