[Zodb-checkins] SVN: ZODB/trunk/src/persistent/tests/persistenttestbase.py Very confusing. This file appears to be unused by ZODB, but

Tim Peters tim.one at comcast.net
Fri Oct 7 13:10:44 EDT 2005


Log message for revision 38900:
  Very confusing.  This file appears to be unused by ZODB, but
  imported from the Zope3 tests.  Since ZODB doesn't use it,
  running the ZODB tests didn't reveal that its testGhostChanged()
  got broken (deliberately -- "it's a feature") in ZODB 3.6.
  

Changed:
  U   ZODB/trunk/src/persistent/tests/persistenttestbase.py

-=-
Modified: ZODB/trunk/src/persistent/tests/persistenttestbase.py
===================================================================
--- ZODB/trunk/src/persistent/tests/persistenttestbase.py	2005-10-07 17:06:28 UTC (rev 38899)
+++ ZODB/trunk/src/persistent/tests/persistenttestbase.py	2005-10-07 17:10:43 UTC (rev 38900)
@@ -16,6 +16,9 @@
 from persistent import Persistent
 from persistent.interfaces import IPersistent
 
+# Confusing:  ZODB doesn't use this file.  It appears to be used only
+# by Zope3, where it's imported by zope/app/schema/tests/test_wrapper.py.
+
 try:
     import zope.interface
 except ImportError:
@@ -115,8 +118,10 @@
         self.assertEqual(dm.called, 1)
 
     def testGhostChanged(self):
-        # An object is a ghost, and it's _p_changed it set to True.
-        # This assignment should have no effect.
+        # If an object is a ghost and its _p_changed is set to True (any
+        # true value),i t should activate (unghostify) the object.  This
+        # behavior is new in ZODB 3.6; before then, an attempt to do
+        # "ghost._p_changed = True" was ignored.
         p = self.klass()
         p._p_oid = 1
         dm = DM()
@@ -124,7 +129,7 @@
         p._p_deactivate()
         self.assertEqual(p._p_changed, None)
         p._p_changed = True
-        self.assertEqual(p._p_changed, None)
+        self.assertEqual(p._p_changed, 1)
 
     def testRegistrationFailure(self):
         p = self.klass()



More information about the Zodb-checkins mailing list