[Zope-CVS] CVS: Products/Ape/lib/apelib/tests -
zope2testbase.py:1.10
Shane Hathaway
shane at zope.com
Tue Mar 16 23:03:30 EST 2004
Update of /cvs-repository/Products/Ape/lib/apelib/tests
In directory cvs.zope.org:/tmp/cvs-serv20045/tests
Modified Files:
zope2testbase.py
Log Message:
Added compatibility with BTreeFolder2.
=== Products/Ape/lib/apelib/tests/zope2testbase.py 1.9 => 1.10 ===
--- Products/Ape/lib/apelib/tests/zope2testbase.py:1.9 Mon Mar 1 09:13:54 2004
+++ Products/Ape/lib/apelib/tests/zope2testbase.py Tue Mar 16 23:02:59 2004
@@ -659,3 +659,40 @@
conn2.close()
finally:
conn.close()
+
+
+ def testBTreeFolder2(self):
+ from Products.BTreeFolder2.BTreeFolder2 import BTreeFolder2
+ conn = self.db.open()
+ try:
+ app = conn.root()['Application']
+ f = BTreeFolder2()
+ f.id = 'Holidays'
+ app._setObject(f.id, f, set_owner=0)
+ f2 = Folder()
+ f2.id = 'Easter'
+ app.Holidays._setObject(f2.id, f2)
+ get_transaction().commit()
+ # Verify serialize() found the unmanaged subobjects.
+ self.assertEqual(app.Holidays._tree._p_oid, 'unmanaged')
+ # Sanity check
+ self.assertEqual(app.Holidays.objectCount(), 1)
+
+ conn2 = self.db.open()
+ try:
+ app2 = conn2.root()['Application']
+ self.assert_(app2.Holidays._tree.has_key('Easter'))
+ self.assert_(not app2.Holidays.__dict__.has_key('Easter'))
+ # Verify deserialize() found the unmanaged subobjects.
+ self.assertEqual(app2.Holidays._tree._p_oid, 'unmanaged')
+ app2.Holidays._delObject('Easter')
+ get_transaction().commit()
+ finally:
+ conn2.close()
+
+ # The deletion should be seen by both connections.
+ conn.sync()
+ self.assertEqual(app.Holidays.objectCount(), 0)
+
+ finally:
+ conn.close()
More information about the Zope-CVS
mailing list