[Zope3-checkins] CVS: Zope3/src/persistence/tests - test_persistence.py:1.9
Jeremy Hylton
jeremy@zope.com
Wed, 7 May 2003 09:10:55 -0400
Update of /cvs-repository/Zope3/src/persistence/tests
In directory cvs.zope.org:/tmp/cvs-serv14897/tests
Modified Files:
test_persistence.py
Log Message:
Preserve _p_serial across __setstate__().
Fix test of class with __slots__ to include _p_serial in __slots__.
=== Zope3/src/persistence/tests/test_persistence.py 1.8 => 1.9 ===
--- Zope3/src/persistence/tests/test_persistence.py:1.8 Fri Apr 25 15:02:35 2003
+++ Zope3/src/persistence/tests/test_persistence.py Wed May 7 09:10:55 2003
@@ -91,6 +91,12 @@
self.assertEqual(p.__getstate__(), {'x': 5})
self.assertEqual(p._p_changed, 0)
+ def testSetStateSerial(self):
+ p = self.klass()
+ p._p_serial = 12
+ p.__setstate__(p.__getstate__())
+ self.assertEqual(p._p_serial, 12)
+
def testDirectChanged(self):
p = self.klass()
p._p_oid = 1
@@ -254,7 +260,7 @@
class B(Persistent):
- __slots__ = ["x"]
+ __slots__ = ["x", "_p_serial"]
def __init__(self):
self.x = 0