Commit ed1b380a authored by Stefan H. Holek's avatar Stefan H. Holek

Use transaction.savepoint(optimistic=True) as advised by Florent, Tres, and Tim.

(Sheesh, can't a guy make a little checkin in private? ;-)
parent 9b42bfaf
......@@ -42,7 +42,7 @@ class TestCopyPaste(ZopeTestCase.ZopeTestCase):
self.folder.addDTMLMethod('doc', file='foo')
# _p_oids are None until we commit a subtransaction
self.assertEqual(self.folder._p_oid, None)
transaction.savepoint()
transaction.savepoint(optimistic=True)
self.failIfEqual(self.folder._p_oid, None)
def testCutPaste(self):
......@@ -93,7 +93,7 @@ class TestImportExport(ZopeTestCase.ZopeTestCase):
self.folder.addDTMLMethod('doc', file='foo')
# _p_oids are None until we commit a subtransaction
self.assertEqual(self.folder._p_oid, None)
transaction.savepoint()
transaction.savepoint(optimistic=True)
self.failIfEqual(self.folder._p_oid, None)
def testExport(self):
......@@ -315,7 +315,7 @@ class TestTransactionAbort(ZopeTestCase.ZopeTestCase):
def testSubTransactionAbort(self):
self.folder.foo = 1
self.failUnless(hasattr(self.folder, 'foo'))
transaction.savepoint()
transaction.savepoint(optimistic=True)
transaction.abort()
# This time the abort nukes the foo attribute...
self.failIf(hasattr(self.folder, 'foo'))
......@@ -330,7 +330,7 @@ class TestTransactionAbort(ZopeTestCase.ZopeTestCase):
def testSubTransactionAbortPersistent(self):
self.folder._p_foo = 1
self.failUnless(hasattr(self.folder, '_p_foo'))
transaction.savepoint()
transaction.savepoint(optimistic=True)
transaction.abort()
# This time the abort nukes the _p_foo attribute...
self.failIf(hasattr(self.folder, '_p_foo'))
......@@ -345,7 +345,7 @@ class TestTransactionAbort(ZopeTestCase.ZopeTestCase):
def testSubTransactionAbortVolatile(self):
self.folder._v_foo = 1
self.failUnless(hasattr(self.folder, '_v_foo'))
transaction.savepoint()
transaction.savepoint(optimistic=True)
transaction.abort()
# This time the abort nukes the _v_foo attribute...
self.failIf(hasattr(self.folder, '_v_foo'))
......
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