[Zope-CVS] CVS: Products/Ape/lib/apelib/tests - zope2testbase.py:1.16

Shane Hathaway shane at zope.com
Fri Jul 23 22:36:46 EDT 2004


Update of /cvs-repository/Products/Ape/lib/apelib/tests
In directory cvs.zope.org:/tmp/cvs-serv30523/lib/apelib/tests

Modified Files:
	zope2testbase.py 
Log Message:
Fixed an issue with serializing DCWorkflow.ContainerTab instances.

ContainerTab needs the _mapping attribute initialized before 
deserialization.

Also moved BTreeFolder2 serialization out of the main folder serializer 
and created a "products" module for serializing products that 
are very common yet not part of "core" Zope.


=== Products/Ape/lib/apelib/tests/zope2testbase.py 1.15 => 1.16 ===
--- Products/Ape/lib/apelib/tests/zope2testbase.py:1.15	Thu Jul 22 01:52:14 2004
+++ Products/Ape/lib/apelib/tests/zope2testbase.py	Fri Jul 23 22:36:16 2004
@@ -785,3 +785,28 @@
             self.assertEqual(f._p_changed, 0)
         finally:
             conn.close()
+
+
+    def test_dcworkflow(self):
+        # Verifies storing a DCWorkflow instance doesn't blow up
+        try:
+            from Products.DCWorkflow.Default import createDefaultWorkflowRev2
+        except ImportError:
+            print
+            print 'Warning: Not running the DCWorkflow test'
+            return
+        conn = self.db.open()
+        try:
+            app = conn.root()['Application']
+            f = createDefaultWorkflowRev2('flow')
+            app._setObject(f.id, f)
+            get_transaction().commit()
+        
+            conn2 = self.db.open()
+            try:
+                app2 = conn2.root()['Application']
+                self.assertEqual(app2.flow.states.private.getId(), 'private')
+            finally:
+                conn2.close()
+        finally:
+            conn.close()



More information about the Zope-CVS mailing list