diff --git a/django/views/csrf.py b/django/views/csrf.py index e282ebb2b6..3c572a621a 100644 --- a/django/views/csrf.py +++ b/django/views/csrf.py @@ -64,7 +64,6 @@ def csrf_failure(request, reason="", template_name=CSRF_FAILURE_TEMPLATE_NAME): "DEBUG": settings.DEBUG, "docs_version": get_docs_version(), "more": _("More information is available with DEBUG=True."), - "request": request, } try: t = loader.get_template(template_name) diff --git a/tests/view_tests/tests/test_csrf.py b/tests/view_tests/tests/test_csrf.py index d85c1b69dd..ef4a50dd45 100644 --- a/tests/view_tests/tests/test_csrf.py +++ b/tests/view_tests/tests/test_csrf.py @@ -131,7 +131,3 @@ class CsrfViewTests(SimpleTestCase): with mock.patch.object(Path, "open") as m: csrf_failure(mock.MagicMock(), mock.Mock()) 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"))