From 3cfcb8cbc83cfe58307b87435d55c27180cb4f94 Mon Sep 17 00:00:00 2001 From: Chris Jerdonek Date: Tue, 6 Jul 2021 00:03:32 -0400 Subject: [PATCH] Refs #32902 -- Moved ensure_csrf_cookie_view after protected_view. --- tests/csrf_tests/views.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/csrf_tests/views.py b/tests/csrf_tests/views.py index 2dafbf28e2..774d72650d 100644 --- a/tests/csrf_tests/views.py +++ b/tests/csrf_tests/views.py @@ -38,6 +38,11 @@ def protected_view(request): return HttpResponse('OK') +@ensure_csrf_cookie +def ensure_csrf_cookie_view(request): + return HttpResponse('OK') + + @csrf_protect @ensure_csrf_cookie def ensured_and_protected_view(request): @@ -62,12 +67,6 @@ def post_form_view(request): """) -@ensure_csrf_cookie -def ensure_csrf_cookie_view(request): - # Doesn't insert a token or anything. - return HttpResponse() - - def token_view(request): context = RequestContext(request, processors=[csrf]) template = Template('{% csrf_token %}')