Use text/html for CSRF error page, refs #2390

This commit is contained in:
Simon Willison 2024-08-15 08:48:47 -07:00
commit 05dfd34fd0
2 changed files with 4 additions and 2 deletions

View file

@ -1171,4 +1171,5 @@ async def test_custom_csrf_error(ds_client):
cookies={"csrftoken": "x"},
)
assert response.status_code == 403
assert response.headers["content-type"] == "text/html; charset=utf-8"
assert "Error code is FORM_URLENCODED_MISMATCH." in response.text