[Zope3-checkins] CVS: Zope3/src/zope/security/tests - test_checker.py:1.5
Jim Fulton
jim@zope.com
Fri, 7 Mar 2003 16:13:07 -0500
Update of /cvs-repository/Zope3/src/zope/security/tests
In directory cvs.zope.org:/tmp/cvs-serv8124/tests
Modified Files:
test_checker.py
Log Message:
Modified CheckerPublic so that it can be pickled and unpickled without
loss of identity. This is necessary so that it can be stored and used
in persistent objects.
=== Zope3/src/zope/security/tests/test_checker.py 1.4 => 1.5 ===
--- Zope3/src/zope/security/tests/test_checker.py:1.4 Fri Mar 7 13:39:44 2003
+++ Zope3/src/zope/security/tests/test_checker.py Fri Mar 7 16:13:04 2003
@@ -24,7 +24,7 @@
from zope.exceptions import Forbidden, Unauthorized
from zope.security.management import setSecurityPolicy
from zope.security.proxy import getChecker, getObject
-from zope.security.checker import defineChecker
+from zope.security.checker import defineChecker, ProxyFactory
import types, pickle
class SecurityPolicy:
@@ -291,10 +291,13 @@
class TestCheckerPublic(TestCase):
- def test_that_pickling_retains_identity(self):
+ def test_that_pickling_CheckerPublic_retains_identity(self):
self.assert_(pickle.loads(pickle.dumps(CheckerPublic))
is
- CheckerPublic)
+ CheckerPublic)
+
+ def test_that_CheckerPublic_identity_works_even_when_proxied(self):
+ self.assert_(ProxyFactory(CheckerPublic) is CheckerPublic)
def test_suite():
return TestSuite((