diff options
| author | Michael Merickel <michael@merickel.org> | 2013-03-18 20:53:14 -0700 |
|---|---|---|
| committer | Michael Merickel <michael@merickel.org> | 2013-03-18 21:00:25 -0700 |
| commit | 038dcbaea40ee6e4526946115cc4c8c9bfb43c2f (patch) | |
| tree | 843ce17e9eec6a7c772a901807ccc434e563da0b | |
| parent | bebe236dbaa87fb9298bcc0bb27aa7b246b12e35 (diff) | |
| download | pyramid-038dcbaea40ee6e4526946115cc4c8c9bfb43c2f.tar.gz pyramid-038dcbaea40ee6e4526946115cc4c8c9bfb43c2f.tar.bz2 pyramid-038dcbaea40ee6e4526946115cc4c8c9bfb43c2f.zip | |
add failing test for callable acl
| -rw-r--r-- | pyramid/tests/test_authorization.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/pyramid/tests/test_authorization.py b/pyramid/tests/test_authorization.py index 27f2a18b4..60b1b0c8d 100644 --- a/pyramid/tests/test_authorization.py +++ b/pyramid/tests/test_authorization.py @@ -215,6 +215,15 @@ class TestACLAuthorizationPolicy(unittest.TestCase): result = sorted( policy.principals_allowed_by_permission(context, 'read')) self.assertEqual(result, []) + + def test_callable_acl(self): + from pyramid.security import Allow + context = DummyContext() + fn = lambda self: [(Allow, 'bob', 'read')] + context.__acl__ = fn.__get__(context, context.__class__) + policy = self._makeOne() + result = policy.permits(context, ['bob'], 'read') + self.assertTrue(result) class DummyContext: |
