russ...@bcc190cf-cafb-0310-a4f2-bffc1f526a37  committed c85f205

[1.2.X] Fixed #15142 -- Force test views to be non-cached so that projects with caching middleware enabled don't cause test failures. Thanks to jsdalton for the report and patch

Backport of r15865 from trunk.

  • Participants
  • Parent commits 92e4b39
  • Branches releases/1.2.X

Comments (0)

Files changed (2)

File django/contrib/auth/tests/

 from django.contrib.auth.urls import urlpatterns
 from django.http import HttpResponse
 from django.template import Template, RequestContext
+from django.views.decorators.cache import never_cache
 def remote_user_auth_view(request):
     "Dummy view for remote user tests"
     t = Template("Username is {{ user }}.")

File django/contrib/messages/tests/

 from django.http import HttpResponseRedirect, HttpResponse
 from django.shortcuts import render_to_response
 from django.template import RequestContext, Template
+from django.views.decorators.cache import never_cache
 def add(request, message_type):
     # don't default to False here, because we want to test that it defaults
     # to False if unspecified
     return HttpResponseRedirect(show_url)
 def show(request):
     t = Template("""{% if messages %}
 <ul class="messages">