From 727a154094a2d565e3d4e9e11cd80dda46cc227d Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Tue, 27 Apr 2021 08:40:52 +0200 Subject: [3.2.x] Refs 32637 -- Made technical 404 debug page display exception message when URL is resolved. Follow up to 3b8527e32b665df91622649550813bb1ec9a9251. Backport of d68be0494be8b82365f2a5410c9335e539d8efd6 from main --- tests/view_tests/tests/test_debug.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests') diff --git a/tests/view_tests/tests/test_debug.py b/tests/view_tests/tests/test_debug.py index 28734434f3..9c85ed20fc 100644 --- a/tests/view_tests/tests/test_debug.py +++ b/tests/view_tests/tests/test_debug.py @@ -122,6 +122,11 @@ class DebugViewTests(SimpleTestCase): def test_404(self): response = self.client.get('/raises404/') + self.assertNotContains( + response, + '
',
+            status_code=404,
+        )
         self.assertContains(
             response,
             '

The current path, not-in-urls, didn’t match any ' @@ -133,6 +138,11 @@ class DebugViewTests(SimpleTestCase): def test_404_not_in_urls(self): response = self.client.get('/not-in-urls') self.assertNotContains(response, "Raised by:", status_code=404) + self.assertNotContains( + response, + '

',
+            status_code=404,
+        )
         self.assertContains(response, "Django tried these URL patterns", status_code=404)
         self.assertContains(
             response,
-- 
cgit v1.3