diff options
| author | Raphael Michel <mail@raphaelmichel.de> | 2015-06-05 10:08:19 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-06-08 13:44:39 -0400 |
| commit | 39937de7e60052d3ffa9f07fdbb9262aced35d61 (patch) | |
| tree | a49b4fd14a34fb0c68825f978031d56b390fe350 /tests/auth_tests | |
| parent | 8b1f39a727be91aab40bdb37235718ed63ae1d50 (diff) | |
Fixed #24929 -- Allowed permission_required decorator to take any iterable
Diffstat (limited to 'tests/auth_tests')
| -rw-r--r-- | tests/auth_tests/test_decorators.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auth_tests/test_decorators.py b/tests/auth_tests/test_decorators.py index ff1b1f52a2..61c1962a74 100644 --- a/tests/auth_tests/test_decorators.py +++ b/tests/auth_tests/test_decorators.py @@ -76,6 +76,16 @@ class PermissionsRequiredDecoratorTest(TestCase): resp = a_view(request) self.assertEqual(resp.status_code, 200) + def test_many_permissions_in_set_pass(self): + + @permission_required({'auth.add_customuser', 'auth.change_customuser'}) + def a_view(request): + return HttpResponse() + request = self.factory.get('/rand') + request.user = self.user + resp = a_view(request) + self.assertEqual(resp.status_code, 200) + def test_single_permission_pass(self): @permission_required('auth.add_customuser') |
