Browse files

[1.2.X] Fixed #15142 -- Force test views to be non-cached so that pro…

…jects with caching middleware enabled don't cause test failures. Thanks to jsdalton for the report and patch

Backport of r15865 from trunk.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 05c929f commit 1d64c8a539b11998662c351d2ba847e794c2066b @freakboy3742 freakboy3742 committed Mar 17, 2011
Showing with 5 additions and 0 deletions.
  1. +2 −0 django/contrib/auth/tests/
  2. +3 −0 django/contrib/messages/tests/
@@ -2,7 +2,9 @@
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 }}.")
@@ -4,8 +4,10 @@
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
@@ -20,6 +22,7 @@ def add(request, message_type):
return HttpResponseRedirect(show_url)
def show(request):
t = Template("""{% if messages %}
<ul class="messages">

0 comments on commit 1d64c8a

Please sign in to comment.