index 5dbfab1..823e1e4 100644
|
|
class BackendTest(TestCase):
|
14 | 14 | self.curr_auth = settings.AUTHENTICATION_BACKENDS |
15 | 15 | settings.AUTHENTICATION_BACKENDS = (self.backend,) |
16 | 16 | User.objects.create_user('test', 'test@example.com', 'test') |
17 | | |
| 17 | user = User.objects.create_user('test2', 'test2@example.com', 'test') |
| 18 | user.is_superuser = True |
| 19 | user.save() |
| 20 | |
18 | 21 | def tearDown(self): |
19 | 22 | settings.AUTHENTICATION_BACKENDS = self.curr_auth |
20 | 23 | |
… |
… |
class BackendTest(TestCase):
|
88 | 91 | self.assertEqual(user.get_all_permissions('object'), set([])) |
89 | 92 | self.assertEqual(user.has_perm('auth.test'), True) |
90 | 93 | self.assertEqual(user.get_all_permissions(), set(['auth.test'])) |
91 | | |
| 94 | |
| 95 | def test_get_all_superuser_permissions(self): |
| 96 | """Test for #14795""" |
| 97 | user = User.objects.get(username='test2') |
| 98 | self.assertEqual(len(user.get_all_permissions()),len(Permission.objects.all())) |
92 | 99 | |
93 | 100 | class TestObj(object): |
94 | 101 | pass |