1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #26543 -- Prevented "confirm form submission" browser prompt when reloading after an admin actions failure.

This commit is contained in:
Adonys Alea Boffill
2016-12-22 14:22:14 -05:00
committed by Tim Graham
parent 9710677c10
commit 8ba01d1e42
2 changed files with 15 additions and 4 deletions

View File

@@ -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)