コード例 #1
0
 def _check_enforcement(self, predicate, request, expected_message=None,
                        expected_denial_handler=None):
     """Make sure ``predicate`` is not met and enforced as expected."""
     try:
         enforce(predicate, request, expected_message,
                 expected_denial_handler)
     except _AuthorizationDenial, authz_denial:
         eq_(authz_denial.reason, expected_message)
         eq_(authz_denial.handler, expected_denial_handler)
コード例 #2
0
 def _check_enforcement(self,
                        predicate,
                        request,
                        expected_message=None,
                        expected_denial_handler=None):
     """Make sure ``predicate`` is not met and enforced as expected."""
     try:
         enforce(predicate, request, expected_message,
                 expected_denial_handler)
     except _AuthorizationDenial, authz_denial:
         eq_(authz_denial.reason, expected_message)
         eq_(authz_denial.handler, expected_denial_handler)
コード例 #3
0
 def test_with_predicate_met(self):
     req = Request({}, make_user(None))
     enforce(MockPredicate(), req)
コード例 #4
0
 def test_with_predicate_met(self):
     req = Request({}, make_user(None))
     enforce(MockPredicate(), req)