Commit 8788cb71 authored by Marius Gedminas's avatar Marius Gedminas

Fix doctest_readCurrent

It seems that OIDs are assigned in random order (dictionary iteration
order perhaps), and the test made assumptions.  Add an extra
transaction.commit() between object addition to fix OID assignment
order.
parent b41613fe
......@@ -689,9 +689,15 @@ def doctest_readCurrent():
>>> db = ZODB.DB(store)
>>> conn = db.open()
>>> conn.root.a = ZODB.tests.util.P('a')
>>> transaction.commit()
>>> conn.root.b = ZODB.tests.util.P('b')
>>> transaction.commit()
>>> conn.root.a._p_oid
b'\x00\x00\x00\x00\x00\x00\x00\x01'
>>> conn.root.b._p_oid
b'\x00\x00\x00\x00\x00\x00\x00\x02'
If we call readCurrent for an object and we modify another object,
then checkCurrentSerialInTransaction will be called for the object
readCurrent was called on.
......
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