summaryrefslogtreecommitdiff
path: root/tests/admin_views
diff options
context:
space:
mode:
authorAdonys Alea Boffill <adonys.boffill@savoirfairelinux.com>2016-12-22 14:22:14 -0500
committerTim Graham <timograham@gmail.com>2016-12-23 17:29:24 -0500
commit8ba01d1e42bfb49cfea323a7f23365a819b16214 (patch)
tree6d84d8689bbaea7767a3cd5dc6efb8bbc6c287c7 /tests/admin_views
parent9710677c106948dfab96207480bee2463f067b66 (diff)
Fixed #26543 -- Prevented "confirm form submission" browser prompt when reloading after an admin actions failure.
Diffstat (limited to 'tests/admin_views')
-rw-r--r--tests/admin_views/tests.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py
index 2d86487e51..c6894dd2a2 100644
--- a/tests/admin_views/tests.py
+++ b/tests/admin_views/tests.py
@@ -3406,7 +3406,10 @@ action)</option>
'action': 'delete_selected',
'index': 0,
}
- response = self.client.post(reverse('admin:admin_views_subscriber_changelist'), action_data)
+ url = reverse('admin:admin_views_subscriber_changelist')
+ response = self.client.post(url, action_data)
+ self.assertRedirects(response, url, fetch_redirect_response=False)
+ response = self.client.get(response.url)
msg = """Items must be selected in order to perform actions on them. No items have been changed."""
self.assertContains(response, msg)
self.assertEqual(Subscriber.objects.count(), 2)
@@ -3420,7 +3423,10 @@ action)</option>
'action': '',
'index': 0,
}
- response = self.client.post(reverse('admin:admin_views_subscriber_changelist'), action_data)
+ url = reverse('admin:admin_views_subscriber_changelist')
+ response = self.client.post(url, action_data)
+ self.assertRedirects(response, url, fetch_redirect_response=False)
+ response = self.client.get(response.url)
msg = """No action selected."""
self.assertContains(response, msg)
self.assertEqual(Subscriber.objects.count(), 2)