Ticket #33189: patch.diff

File patch.diff, 3.0 KB (added by Ruslan, 3 years ago)

diff preview

  • django/contrib/admin/options.py

    diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py
    index 7b2b893c10..406e76a974 100644
    a b class ModelAdmin(BaseModelAdmin):  
    15361536        and return a redirect to the admin index page.
    15371537        """
    15381538        msg = _('%(name)s with ID “%(key)s” doesn’t exist. Perhaps it was deleted?') % {
    1539             'name': opts.verbose_name,
     1539            'name': capfirst(opts.verbose_name),
    15401540            'key': unquote(object_id),
    15411541        }
    15421542        self.message_user(request, msg, messages.WARNING)
  • tests/admin_views/tests.py

    diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py
    index 0ba81fde87..3b12f7a633 100644
    a b class AdminViewBasicTest(AdminViewBasicTestCase):  
    250250        self.assertRedirects(response, reverse('admin:index'))
    251251        self.assertEqual(
    252252            [m.message for m in response.context['messages']],
    253             ['section with ID “abc/<b>” doesn’t exist. Perhaps it was deleted?']
     253            ['Section with ID “abc/<b>” doesn’t exist. Perhaps it was deleted?']
    254254        )
    255255
    256256    def test_basic_edit_GET_old_url_redirect(self):
    class AdminViewBasicTest(AdminViewBasicTestCase):  
    271271        self.assertRedirects(response, reverse('admin:index'))
    272272        self.assertEqual(
    273273            [m.message for m in response.context['messages']],
    274             ['super villain with ID “abc” doesn’t exist. Perhaps it was deleted?']
     274            ['Super villain with ID “abc” doesn’t exist. Perhaps it was deleted?']
    275275        )
    276276
    277277    def test_basic_add_POST(self):
    class AdminViewPermissionsTest(TestCase):  
    22402240        self.assertRedirects(response, reverse('admin:index'))
    22412241        self.assertEqual(
    22422242            [m.message for m in response.context['messages']],
    2243             ['article with ID “nonexistent” doesn’t exist. Perhaps it was deleted?']
     2243            ['Article with ID “nonexistent” doesn’t exist. Perhaps it was deleted?']
    22442244        )
    22452245
    22462246    def test_history_view(self):
    class AdminViewPermissionsTest(TestCase):  
    22972297        self.assertRedirects(response, reverse('admin:index'))
    22982298        self.assertEqual(
    22992299            [m.message for m in response.context['messages']],
    2300             ['article with ID “foo” doesn’t exist. Perhaps it was deleted?']
     2300            ['Article with ID “foo” doesn’t exist. Perhaps it was deleted?']
    23012301        )
    23022302
    23032303    def test_conditionally_show_add_section_link(self):
    class AdminCustomQuerysetTest(TestCase):  
    38673867                self.assertRedirects(response, reverse('admin:index'))
    38683868                self.assertEqual(
    38693869                    [m.message for m in response.context['messages']],
    3870                     ['empty model with ID “1” doesn’t exist. Perhaps it was deleted?']
     3870                    ['Empty model with ID “1” doesn’t exist. Perhaps it was deleted?']
    38713871                )
    38723872
    38733873    def test_add_model_modeladmin_defer_qs(self):
Back to Top