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

Refs #2856 -- Removed redundant escaping in admin's "Perhaps it was deleted?" message.

This commit is contained in:
Tim Graham
2017-01-04 10:12:06 -05:00
parent bff4abacad
commit 8ea541e6a2
2 changed files with 9 additions and 9 deletions

View File

@@ -249,11 +249,11 @@ class AdminViewBasicTest(AdminViewBasicTestCase):
model with an integer PK field) redirects to the index page with a
message saying the object doesn't exist.
"""
response = self.client.get(reverse('admin:admin_views_section_change', args=('abc',)), follow=True)
response = self.client.get(reverse('admin:admin_views_section_change', args=(quote("abc/<b>"),)), follow=True)
self.assertRedirects(response, reverse('admin:index'))
self.assertEqual(
[m.message for m in response.context['messages']],
["section with ID abc doesn't exist. Perhaps it was deleted?"]
["""section with ID "abc/<b>" doesn't exist. Perhaps it was deleted?"""]
)
def test_basic_edit_GET_old_url_redirect(self):
@@ -274,7 +274,7 @@ class AdminViewBasicTest(AdminViewBasicTestCase):
self.assertRedirects(response, reverse('admin:index'))
self.assertEqual(
[m.message for m in response.context['messages']],
["super villain with ID abc doesn't exist. Perhaps it was deleted?"]
["""super villain with ID "abc" doesn't exist. Perhaps it was deleted?"""]
)
def test_basic_add_POST(self):
@@ -1801,7 +1801,7 @@ class AdminViewPermissionsTest(TestCase):
self.assertRedirects(response, reverse('admin:index'))
self.assertEqual(
[m.message for m in response.context['messages']],
["article with ID nonexistent doesn't exist. Perhaps it was deleted?"]
["""article with ID "nonexistent" doesn't exist. Perhaps it was deleted?"""]
)
def test_history_view(self):
@@ -1849,7 +1849,7 @@ class AdminViewPermissionsTest(TestCase):
self.assertRedirects(response, reverse('admin:index'))
self.assertEqual(
[m.message for m in response.context['messages']],
["article with ID foo doesn't exist. Perhaps it was deleted?"]
["""article with ID "foo" doesn't exist. Perhaps it was deleted?"""]
)
def test_conditionally_show_add_section_link(self):
@@ -3638,7 +3638,7 @@ class AdminCustomQuerysetTest(TestCase):
self.assertRedirects(response, reverse('admin:index'))
self.assertEqual(
[m.message for m in response.context['messages']],
["empty model with ID 1 doesn't exist. Perhaps it was deleted?"]
["""empty model with ID "1" doesn't exist. Perhaps it was deleted?"""]
)
def test_add_model_modeladmin_defer_qs(self):