  
  from django.test import TestCase
  from django.http import HttpRequest, HttpResponse
  from django.middleware.csrf import CsrfMiddleware, CsrfViewMiddleware
  from django.views.decorators.csrf import csrf_exempt
  from django.core.context_processors import csrf
  from django.contrib.sessions.middleware import SessionMiddleware
  from django.utils.importlib import import_module
  from django.conf import settings
  from django.template import RequestContext, Template
 
</s> remove         if getattr(callback, 'csrf_exempt', False):
            return None

 </s> add 
from django.views.decorators.csrf import csrf_exempt, csrf_view_exempt
  
  from django.test import TestCase
  from django.http import HttpRequest, HttpResponse
  from django.middleware.csrf import CsrfMiddleware, CsrfViewMiddleware
from django.views.decorators.csrf import csrf_exempt, csrf_view_exempt
  from django.core.context_processors import csrf
  from django.contrib.sessions.middleware import SessionMiddleware
  from django.utils.importlib import import_module
  from django.conf import settings
  from django.template import RequestContext, Template
keep keep keep keep replace keep keep keep keep keep
 Fixed #13716 - the CSRF get_token function stopped working for views with csrf_view_exempt

This was a regression caused by the the CSRF changes in 1.2.

Thanks to edevil for the report.



git-svn-id: http://code.djangoproject.com/svn/django/trunk@13336 bcc190cf-cafb-0310-a4f2-bffc1f526a37 
tests/regressiontests/csrf_tests/tests.py