1
0
mirror of https://github.com/django/django.git synced 2025-09-10 11:09:12 +00:00

Refs #15727 -- Captured failed request log in CSPMiddlewareTest.

This commit is contained in:
Jacob Walls 2025-08-26 17:26:01 -04:00 committed by GitHub
parent 66082a7dac
commit d454aefbd1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -100,7 +100,8 @@ class CSPMiddlewareTest(SimpleTestCase):
"""
Test that the CSP headers are not added to the debug view.
"""
response = self.client.get("/csp-500/")
with self.assertLogs("django.request", "WARNING"):
response = self.client.get("/csp-500/")
self.assertNotIn(CSP.HEADER_ENFORCE, response)
self.assertNotIn(CSP.HEADER_REPORT_ONLY, response)