mirror of
https://github.com/django/django.git
synced 2025-10-26 07:06:08 +00:00
Refs CVE-2025-48432 -- Made SuspiciousOperation logging use log_response() for consistency.
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