Commit ebdf1e36 authored by Jeremy Hylton's avatar Jeremy Hylton

Tests for transactional undo support need to be more cautious:

If a storage doesn't support T.U. and is old enough, you need to first
check if it has a supportsTransactionalUndo attribute.
parent 32425b5a
......@@ -169,7 +169,8 @@ class VersionStorage:
#JF# 'bogus', self._transaction)
# And try to abort the empty version
if self._storage.supportsTransactionalUndo():
if (hasattr(self._storage, 'supportsTransactionalUndo')
and self._storage.supportsTransactionalUndo()):
# XXX FileStorage used to be broken on this one
self.assertRaises(POSException.VersionError,
self._storage.abortVersion,
......@@ -185,7 +186,8 @@ class VersionStorage:
eq(zodb_unpickle(data), MinPO(51))
def checkCommitVersionErrors(self):
if not self._storage.supportsTransactionalUndo():
if not (hasattr(self._storage, 'supportsTransactionalUndo')
and self._storage.supportsTransactionalUndo()):
# XXX FileStorage used to be broken on this one
return
eq = self.assertEqual
......
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