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

Fixed #33567 -- Avoided setting default text/html content type on responses.

This commit is contained in:
Claude Paroz
2022-03-08 17:03:04 +01:00
committed by Carlton Gibson
parent 3dbf46654c
commit 93803a1b5f
6 changed files with 11 additions and 14 deletions

View File

@@ -375,6 +375,7 @@ class CsrfViewMiddlewareTestMixin(CsrfFunctionTestMixin):
with self.assertLogs("django.security.csrf", "WARNING") as cm:
resp = mw.process_view(req, post_form_view, (), {})
self.assertEqual(403, resp.status_code)
self.assertEqual(resp["Content-Type"], "text/html; charset=utf-8")
self.assertEqual(cm.records[0].getMessage(), "Forbidden (%s): " % expected)
def test_csrf_cookie_bad_or_missing_token(self):