summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLuke Plant <L.Plant.98@cantab.net>2010-09-07 20:55:53 +0000
committerLuke Plant <L.Plant.98@cantab.net>2010-09-07 20:55:53 +0000
commitef4b29a001247d7881af88c13cb827770a042e06 (patch)
tree4546d06e845bfea40a31aacf7a1458296afabae8 /tests
parente5d30c700153fdd674c8a42fb601cd1e17c91911 (diff)
Fixed #13081 - Admin actions lose get-parameters in changelist view
Thanks to joh for report and to SmileyChris for patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@13696 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/admin_views/tests.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/regressiontests/admin_views/tests.py b/tests/regressiontests/admin_views/tests.py
index f5a54f3f6c..f76765236e 100644
--- a/tests/regressiontests/admin_views/tests.py
+++ b/tests/regressiontests/admin_views/tests.py
@@ -1477,6 +1477,21 @@ class AdminActionsTest(TestCase):
response = self.client.post('/test_admin/admin/admin_views/externalsubscriber/', action_data)
self.failUnlessEqual(response.status_code, 302)
+ def test_default_redirect(self):
+ """
+ Test that actions which don't return an HttpResponse are redirected to
+ the same page, retaining the querystring (which may contain changelist
+ information).
+ """
+ action_data = {
+ ACTION_CHECKBOX_NAME: [1],
+ 'action' : 'external_mail',
+ 'index': 0,
+ }
+ url = '/test_admin/admin/admin_views/externalsubscriber/?ot=asc&o=1'
+ response = self.client.post(url, action_data)
+ self.assertRedirects(response, url)
+
def test_model_without_action(self):
"Tests a ModelAdmin without any action"
response = self.client.get('/test_admin/admin/admin_views/oldsubscriber/')