From 038dcbaea40ee6e4526946115cc4c8c9bfb43c2f Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Mon, 18 Mar 2013 20:53:14 -0700 Subject: add failing test for callable acl --- pyramid/tests/test_authorization.py | 9 +++++++++ 1 file changed, 9 insertions(+) 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: -- cgit v1.2.3