diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2010-01-10 16:51:13 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2010-01-10 16:51:13 +0000 |
| commit | 19b72077f7519236db0f5975dad01fe4466e06b8 (patch) | |
| tree | 7eee46d14b98b44116e9d8388734d9912a09d800 /tests/regressiontests | |
| parent | b651bcb80b2046f17d8ce42fd20a1276938b52af (diff) | |
Fixed #8049 -- Fixed inconsistency in admin site is_active checks. Thanks for patch and tests, isagalaev
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12159 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests')
| -rw-r--r-- | tests/regressiontests/admin_views/tests.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/regressiontests/admin_views/tests.py b/tests/regressiontests/admin_views/tests.py index 899fff80bc..06cb3deef8 100644 --- a/tests/regressiontests/admin_views/tests.py +++ b/tests/regressiontests/admin_views/tests.py @@ -602,6 +602,20 @@ class AdminViewPermissionsTest(TestCase): self.failUnlessEqual(logged.object_id, u'1') self.client.get('/test_admin/admin/logout/') + def testDisabledPermissionsWhenLoggedIn(self): + self.client.login(username='super', password='secret') + superuser = User.objects.get(username='super') + superuser.is_active = False + superuser.save() + + response = self.client.get('/test_admin/admin/') + self.assertContains(response, 'id="login-form"') + self.assertNotContains(response, 'Log out') + + response = self.client.get('/test_admin/admin/secure-view/') + open('/home/maniac/Desktop/response.html', 'w').write(response.content) + self.assertContains(response, 'id="login-form"') + class AdminViewStringPrimaryKeyTest(TestCase): fixtures = ['admin-views-users.xml', 'string-primary-key.xml'] @@ -622,7 +636,7 @@ class AdminViewStringPrimaryKeyTest(TestCase): response = self.client.get('/test_admin/admin/admin_views/modelwithstringprimarykey/%s/history/' % quote(self.pk)) self.assertContains(response, escape(self.pk)) self.failUnlessEqual(response.status_code, 200) - + def test_get_change_view(self): "Retrieving the object using urlencoded form of primary key should work" response = self.client.get('/test_admin/admin/admin_views/modelwithstringprimarykey/%s/' % quote(self.pk)) |
