mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	[3.2.x] Refs 32637 -- Made technical 404 debug page display exception message when URL is resolved.
Follow up to3b8527e32b. Backport ofd68be0494bfrom main
This commit is contained in:
		| @@ -122,6 +122,11 @@ class DebugViewTests(SimpleTestCase): | ||||
|  | ||||
|     def test_404(self): | ||||
|         response = self.client.get('/raises404/') | ||||
|         self.assertNotContains( | ||||
|             response, | ||||
|             '<pre class="exception_value">', | ||||
|             status_code=404, | ||||
|         ) | ||||
|         self.assertContains( | ||||
|             response, | ||||
|             '<p>The current path, <code>not-in-urls</code>, 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, | ||||
|             '<pre class="exception_value">', | ||||
|             status_code=404, | ||||
|         ) | ||||
|         self.assertContains(response, "Django tried these URL patterns", status_code=404) | ||||
|         self.assertContains( | ||||
|             response, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user