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

Deprecated csrf_response_exempt and csrf_view_exempt decorators

With the removal of CsrfResponseMiddleware, csrf_response_exempt serves no
purposes, and csrf_exempt and csrf_view_exempt perform the same function.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15956 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Luke Plant
2011-03-30 17:35:41 +00:00
parent 1f5d684f14
commit 16f6acdb89
3 changed files with 24 additions and 18 deletions

View File

@@ -4,7 +4,7 @@ import warnings
from django.test import TestCase
from django.http import HttpRequest, HttpResponse
from django.middleware.csrf import CsrfViewMiddleware
from django.views.decorators.csrf import csrf_exempt, csrf_view_exempt, requires_csrf_token
from django.views.decorators.csrf import csrf_exempt, requires_csrf_token
from django.core.context_processors import csrf
from django.conf import settings
from django.template import RequestContext, Template
@@ -200,10 +200,10 @@ class CsrfViewMiddlewareTest(TestCase):
def test_get_token_for_exempt_view(self):
"""
Check that get_token still works for a view decorated with 'csrf_view_exempt'.
Check that get_token still works for a view decorated with 'csrf_exempt'.
"""
req = self._get_GET_csrf_cookie_request()
CsrfViewMiddleware().process_view(req, csrf_view_exempt(token_view), (), {})
CsrfViewMiddleware().process_view(req, csrf_exempt(token_view), (), {})
resp = token_view(req)
self._check_token_present(resp)