summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBrian Rosner <brosner@gmail.com>2008-06-10 16:05:09 +0000
committerBrian Rosner <brosner@gmail.com>2008-06-10 16:05:09 +0000
commitbe810670ff9805d2d7f8e3260015db2123f0c5a9 (patch)
treeb7dbb4d5426011f9ea195c17cda89fc1dd7fa353 /tests
parent98d30caedb4bbc36b0ea1e3d812b4abb5732467e (diff)
newforms-admin: Fixed #5999 -- When a session expires properly route the
flow to call the correct view. Thanks favo and Michael Newman. git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@7611 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/admin_views/tests.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/regressiontests/admin_views/tests.py b/tests/regressiontests/admin_views/tests.py
index f3c2b1f2fc..cfe73f184d 100644
--- a/tests/regressiontests/admin_views/tests.py
+++ b/tests/regressiontests/admin_views/tests.py
@@ -145,6 +145,15 @@ class AdminViewPermissionsTest(TestCase):
self.failUnlessEqual(Article.objects.all().count(), 3)
self.client.get('/test_admin/admin/logout/')
+ # Check and make sure that if user expires, data still persists
+ post = self.client.post('/test_admin/admin/admin_views/article/add/', add_dict)
+ self.assertContains(post, 'Please log in again, because your session has expired.')
+ self.super_login['post_data'] = _encode_post_data(add_dict)
+ post = self.client.post('/test_admin/admin/admin_views/article/add/', self.super_login)
+ self.assertRedirects(post, '/test_admin/admin/admin_views/article/')
+ self.failUnlessEqual(Article.objects.all().count(), 4)
+ self.client.get('/test_admin/admin/logout/')
+
def testChangeView(self):
"""Change view should restrict access and allow users to edit items."""