Commit f76da738 authored by Tim Peters's avatar Tim Peters

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.
parent 263f946c
...@@ -16,6 +16,9 @@ import unittest ...@@ -16,6 +16,9 @@ import unittest
from persistent import Persistent from persistent import Persistent
from persistent.interfaces import IPersistent 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: try:
import zope.interface import zope.interface
except ImportError: except ImportError:
...@@ -115,8 +118,10 @@ class Test(unittest.TestCase): ...@@ -115,8 +118,10 @@ class Test(unittest.TestCase):
self.assertEqual(dm.called, 1) self.assertEqual(dm.called, 1)
def testGhostChanged(self): def testGhostChanged(self):
# An object is a ghost, and it's _p_changed it set to True. # If an object is a ghost and its _p_changed is set to True (any
# This assignment should have no effect. # 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 = self.klass()
p._p_oid = 1 p._p_oid = 1
dm = DM() dm = DM()
...@@ -124,7 +129,7 @@ class Test(unittest.TestCase): ...@@ -124,7 +129,7 @@ class Test(unittest.TestCase):
p._p_deactivate() p._p_deactivate()
self.assertEqual(p._p_changed, None) self.assertEqual(p._p_changed, None)
p._p_changed = True p._p_changed = True
self.assertEqual(p._p_changed, None) self.assertEqual(p._p_changed, 1)
def testRegistrationFailure(self): def testRegistrationFailure(self):
p = self.klass() p = self.klass()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment