Beispiel #1
0
 def testAbortCallsAbort(self):
     target = Target()
     registry.register(target)
     transaction.abort()
     self.failUnless(target.abort_called)
     # _abort removes the TM from the registry
     self.failIf(registry.contains(target))
Beispiel #2
0
 def testAddImageAbort(self):
     # Aborting the transaction leaves the repository empty
     self.addExtImage(id='image', file=gifImage)
     transaction.savepoint(1)   # Wuhuu, force object rollback
     transaction.abort()
     self.failIf(hasattr(aq_base(self.folder), 'image'))
     self.failIf(self._exists('image.gif'))
     self.failIf(self._exists('image.gif.tmp'))
Beispiel #3
0
 def testAddImageAbortWithPreview(self):
     # Aborting the transaction leaves the repository empty
     self.addExtImage(id='image', file=gifImage)
     self.image.manage_create_prev(maxx=10, maxy=10)
     transaction.savepoint(1)   # Wuhuu, force object rollback
     transaction.abort()
     self.failIf(hasattr(aq_base(self.folder), 'image'))
     self.failIf(self._exists('image.gif'))
     self.failIf(self._exists('image.gif.tmp'))
     self.failIf(self._exists('image.jpg'))
     self.failIf(self._exists('image.jpg.tmp'))
Beispiel #4
0
 def testAbort(self):
     transaction.abort()
     self.assertEqual(self.file._v_abort_called, 1)