[Zope3-checkins] CVS: Zope3/src/zodb/tests - test_connection.py:1.5

Jeremy Hylton jeremy@zope.com
Thu, 20 Mar 2003 19:34:09 -0500


Update of /cvs-repository/Zope3/src/zodb/tests
In directory cvs.zope.org:/tmp/cvs-serv7654/src/zodb/tests

Modified Files:
	test_connection.py 
Log Message:
Add test that abort() can be called before prepare().


=== Zope3/src/zodb/tests/test_connection.py 1.4 => 1.5 ===
--- Zope3/src/zodb/tests/test_connection.py:1.4	Wed Mar  5 17:14:25 2003
+++ Zope3/src/zodb/tests/test_connection.py	Thu Mar 20 19:34:08 2003
@@ -152,6 +152,15 @@
         self.obj = DecoyIndependent()
         self.testReadConflict()
 
+    def testAbortBeforeVote(self):
+        self.datamgr.root()["obj"] = self.obj
+        get_transaction().commit()
+        x = self.obj.child = P()
+        self.assert_(self.obj._p_changed)
+        get_transaction().abort()
+        self.assertEqual(getattr(self.obj, "child", None), None)
+        self.assertEqual(x._p_oid, None)
+
     def tearDown(self):
         self.datamgr.close()
         self.db.close()