[Zope3-checkins] CVS: Zope3/lib/python/ZODB/tests - testZODB.py:1.13

Jeremy Hylton jeremy@zope.com
Wed, 4 Dec 2002 16:57:58 -0500


Update of /cvs-repository/Zope3/lib/python/ZODB/tests
In directory cvs.zope.org:/tmp/cvs-serv19590/lib/python/ZODB/tests

Modified Files:
	testZODB.py 
Log Message:
Run TransactionalUndoDB test(s).




=== Zope3/lib/python/ZODB/tests/testZODB.py 1.12 => 1.13 ===
--- Zope3/lib/python/ZODB/tests/testZODB.py:1.12	Mon Dec  2 16:21:42 2002
+++ Zope3/lib/python/ZODB/tests/testZODB.py	Wed Dec  4 16:57:58 2002
@@ -16,9 +16,10 @@
 import tempfile
 
 import ZODB.DB, ZODB.FileStorage
+from ZODB.utils import u64
+from ZODB.tests.TransactionalUndoDB import TransactionalUndoDB
 from Persistence.PersistentDict import PersistentDict
 from Transaction import get_transaction
-from ZODB.utils import u64
 
 _fsname = tempfile.mktemp() + ".fs"
 
@@ -89,8 +90,9 @@
             get_transaction().commit()
         finally:
             conn.close()
-    
+
     def checkDuplicate(self, abort_it=False, dup_name='test_duplicate'):
+        self.populate()
         get_transaction().begin()
         get_transaction().note('duplication')
         self.duplicate(abort_it, dup_name)
@@ -99,10 +101,15 @@
     def checkDuplicateAborted(self):
         self.checkDuplicate(abort_it=True, dup_name='test_duplicate_aborted')
 
-class ZODBTests(unittest.TestCase, ExportImportTests):
+class ZODBTests(unittest.TestCase, ExportImportTests,
+                TransactionalUndoDB):
 
     def setUp(self):
         self._db = ZODB.FileStorage.DB(_fsname, create=1)
+        self._conn = self._db.open()
+        self._root = self._conn.root()
+
+    def populate(self):
         get_transaction().begin()
         conn = self._db.open()
         root = conn.root()
@@ -114,6 +121,7 @@
         conn.close()
 
     def checkModifyGhost(self):
+        self.populate()
         root = self._db.open().root()
         o = root["test"][5]
         o._p_activate()