Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@15866 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 1d64c8a539b11998662c351d2ba847e794c2066b 1 parent 05c929f
@freakboy3742 freakboy3742 authored
View
2  django/contrib/auth/tests/urls.py
@@ -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
+@never_cache
def remote_user_auth_view(request):
"Dummy view for remote user tests"
t = Template("Username is {{ user }}.")
View
3  django/contrib/messages/tests/urls.py
@@ -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
+@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)
+@never_cache
def show(request):
t = Template("""{% if messages %}
<ul class="messages">
Please sign in to comment.
Something went wrong with that request. Please try again.