[Zope-Checkins] SVN: Products.Five/branches/1.0/tests/test_event.py ZODB 3.4-style savepoints

Philipp von Weitershausen philikon at philikon.de
Fri Mar 31 11:51:29 EST 2006


Log message for revision 66277:
  ZODB 3.4-style savepoints
  

Changed:
  U   Products.Five/branches/1.0/tests/test_event.py

-=-
Modified: Products.Five/branches/1.0/tests/test_event.py
===================================================================
--- Products.Five/branches/1.0/tests/test_event.py	2006-03-31 16:50:28 UTC (rev 66276)
+++ Products.Five/branches/1.0/tests/test_event.py	2006-03-31 16:51:28 UTC (rev 66277)
@@ -21,6 +21,8 @@
 
 from Products.Five.tests.fivetest import *
 
+import transaction
+
 from Products.Five.tests.products.FiveTest.subscriber import clear
 from Products.Five.tests.products.FiveTest.subscriber import objectEventCatcher, \
      objectAddedEventCatcher, objectMovedEventCatcher, \
@@ -62,7 +64,7 @@
         manage_addSimpleContent(self.folder, 'foo', 'Foo')
         # somehow we need to at least commit a subtransaction to make
         # renaming succeed
-        get_transaction().commit(1)
+        transaction.savepoint()
         self.folder.manage_renameObject('foo', 'bar')
         bar = self.folder.bar
         events = objectEventCatcher.getEvents()
@@ -96,7 +98,7 @@
         manage_addSimpleContent(folder1, 'foo', 'Foo')
         foo = folder1.foo
         # need to trigger subtransaction before copy/paste can work
-        get_transaction().commit(1)
+        transaction.savepoint()
         cb = folder1.manage_cutObjects(['foo'])
         folder2.manage_pasteObjects(cb)
         newfoo = folder2.foo
@@ -126,7 +128,7 @@
         manage_addNoVerifyPasteFolder(self.folder, 'folder1')
         folder1 = self.folder.folder1
         # need to trigger subtransaction before copy/paste can work
-        get_transaction().commit(1)
+        transaction.savepoint()
         cb = self.folder.manage_copyObjects(['foo'])
         folder1.manage_pasteObjects(cb)
         foo_copy = folder1.foo



More information about the Zope-Checkins mailing list