mirror of
https://github.com/django/django.git
synced 2025-03-13 19:00:45 +00:00
Reverted "Fixed #34830 -- Added request to csrf_failure view's template context."
This reverts commit 535f7b5c6cea54a0796d85bbe213183d50002689.
This commit is contained in:
parent
535f7b5c6c
commit
5f2f12f61c
@ -64,7 +64,6 @@ def csrf_failure(request, reason="", template_name=CSRF_FAILURE_TEMPLATE_NAME):
|
|||||||
"DEBUG": settings.DEBUG,
|
"DEBUG": settings.DEBUG,
|
||||||
"docs_version": get_docs_version(),
|
"docs_version": get_docs_version(),
|
||||||
"more": _("More information is available with DEBUG=True."),
|
"more": _("More information is available with DEBUG=True."),
|
||||||
"request": request,
|
|
||||||
}
|
}
|
||||||
try:
|
try:
|
||||||
t = loader.get_template(template_name)
|
t = loader.get_template(template_name)
|
||||||
|
@ -131,7 +131,3 @@ class CsrfViewTests(SimpleTestCase):
|
|||||||
with mock.patch.object(Path, "open") as m:
|
with mock.patch.object(Path, "open") as m:
|
||||||
csrf_failure(mock.MagicMock(), mock.Mock())
|
csrf_failure(mock.MagicMock(), mock.Mock())
|
||||||
m.assert_called_once_with(encoding="utf-8")
|
m.assert_called_once_with(encoding="utf-8")
|
||||||
|
|
||||||
def test_csrf_response_has_request_context_processor(self):
|
|
||||||
response = self.client.post("/")
|
|
||||||
self.assertIs(response.wsgi_request, response.context.get("request"))
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user