mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	[5.2.x] Refs CVE-2025-48432 -- Made SuspiciousOperation logging use log_response() for consistency.
Backport of ff835f439c from main.
			
			
This commit is contained in:
		| @@ -618,6 +618,15 @@ class SecurityLoggerTest(LoggingAssertionMixin, SimpleTestCase): | ||||
|         self.assertEqual(len(mail.outbox), 1) | ||||
|         self.assertIn("SuspiciousOperation at /suspicious/", mail.outbox[0].body) | ||||
|  | ||||
|     def test_response_logged(self): | ||||
|         with self.assertLogs("django.security.SuspiciousOperation", "ERROR") as handler: | ||||
|             response = self.client.get("/suspicious/") | ||||
|  | ||||
|         self.assertLogRecord( | ||||
|             handler, "dubious", logging.ERROR, 400, request=response.wsgi_request | ||||
|         ) | ||||
|         self.assertEqual(response.status_code, 400) | ||||
|  | ||||
|  | ||||
| class SettingsCustomLoggingTest(AdminScriptTestCase): | ||||
|     """ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user