diff options
author | Stephan Richter <stephan.richter@gmail.com> | 2013-03-08 16:45:26 -0500 |
---|---|---|
committer | Stephan Richter <stephan.richter@gmail.com> | 2013-03-08 16:45:26 -0500 |
commit | 676ee74eb2753fe016cf4f5ece937719414ffff9 (patch) | |
tree | 3e8262ecdc9cbb320712ceb642c6d52f6bf3a759 /src | |
parent | a056283f72986c9690cb4d3f72026cf7b9bc9ed0 (diff) | |
download | zope-security-676ee74eb2753fe016cf4f5ece937719414ffff9.tar.gz |
Avoid overwriting of checked name when tests compare. Strangely, only the
Python proxy implementation is affected. I am not sure why __eq__ is not
looked up during test output comparison with C-based proxies.
Diffstat (limited to 'src')
-rw-r--r-- | src/zope/security/tests/test_proxy.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/zope/security/tests/test_proxy.py b/src/zope/security/tests/test_proxy.py index 52830be..bb598ed 100644 --- a/src/zope/security/tests/test_proxy.py +++ b/src/zope/security/tests/test_proxy.py @@ -1358,7 +1358,11 @@ class DummyChecker(object): self._raising = raising self._allowed = allowed def check(self, target, name): - self._checked = name + # We only want to assign on the first call, since further checks might + # be needed for the tests, like__eq__. For some reason the C version + # of the proxy does not do that but the Python version does. + if self._checked is None: + self._checked = name if name not in self._allowed: if self._raising is not None: raise self._raising |