[Zodb-checkins] CVS: Zope3/src/persistence/tests - test_persistence.py:1.12.2.1

Jim Fulton jim at zope.com
Mon Sep 29 11:14:08 EDT 2003


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

Modified Files:
      Tag: schema_utility_persistence
	test_persistence.py 
Log Message:
Made an invalid test pass my making it valid, although I'm not
entirely sure what it was actually trying to test.


=== Zope3/src/persistence/tests/test_persistence.py 1.12 => 1.12.2.1 ===
--- Zope3/src/persistence/tests/test_persistence.py:1.12	Wed Sep 24 17:00:38 2003
+++ Zope3/src/persistence/tests/test_persistence.py	Mon Sep 29 11:14:07 2003
@@ -334,8 +334,17 @@
         p = self.klass()
         p.inc()
         p2 = pickle.loads(pickle.dumps(p))
-        self.assertEqual(p2.__class__, self.klass);
-        self.assertEqual(p2.__dict__, p.__dict__)
+        self.assertEqual(p2.__class__, self.klass)
+
+        # verify that the inc is reflected:
+        self.assertEqual(p2.x, p.x)
+        
+        # This assertion would be invalid.  Interfaces
+        # are compared by identity and copying doesn't
+        # preserve identity. We would get false negatives due
+        # to the differing identities of the original and copied
+        # PersistentInterface:
+        # self.assertEqual(p2.__dict__, p.__dict__)
 
     def testPicklableWCustomState(self):
         import pickle




More information about the Zodb-checkins mailing list