[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/schema/tests/test_wrapper.py testGhostChanged(): setting obj._p_changed to a true value

Tim Peters tim.one at comcast.net
Fri Oct 7 13:06:29 EDT 2005


Log message for revision 38899:
  testGhostChanged():  setting obj._p_changed to a true value
  now (ZODB 3.6) activates the object.
  
  I'm still trying to figure out why this test passed earlier
  today!
  

Changed:
  U   Zope3/trunk/src/zope/app/schema/tests/test_wrapper.py

-=-
Modified: Zope3/trunk/src/zope/app/schema/tests/test_wrapper.py
===================================================================
--- Zope3/trunk/src/zope/app/schema/tests/test_wrapper.py	2005-10-07 16:22:06 UTC (rev 38898)
+++ Zope3/trunk/src/zope/app/schema/tests/test_wrapper.py	2005-10-07 17:06:28 UTC (rev 38899)
@@ -17,7 +17,7 @@
 """
 import unittest
 
-from persistent import Persistent, GHOST, UPTODATE
+from persistent import Persistent, GHOST, UPTODATE, CHANGED
 from persistent.tests.persistenttestbase import DM as BaseDM, BrokenDM
 
 from zope.interface import Interface, directlyProvides, directlyProvidedBy
@@ -140,8 +140,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()
@@ -149,7 +151,7 @@
         p._p_deactivate()
         self.assertEqual(p._p_state, GHOST)
         p._p_changed = True
-        self.assertEqual(p._p_state, GHOST)
+        self.assertEqual(p._p_state, CHANGED)
 
     def testRegistrationFailure(self):
         p = self.klass()



More information about the Zope3-Checkins mailing list