Commit 4b0288e2 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 20db5926
......@@ -16,6 +16,9 @@ import unittest
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 @@ class Test(unittest.TestCase):
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 @@ class Test(unittest.TestCase):
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()
......
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