From b49ee91eb39e6008fed9d77c19b84362d3dd2b16 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Thu, 17 Mar 2011 08:07:40 +0000 Subject: [PATCH] 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 git-svn-id: http://code.djangoproject.com/svn/django/trunk@15865 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/auth/tests/urls.py | 2 ++ django/contrib/messages/tests/urls.py | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/django/contrib/auth/tests/urls.py b/django/contrib/auth/tests/urls.py index 51b7d92d27..3d76a4e443 100644 --- a/django/contrib/auth/tests/urls.py +++ b/django/contrib/auth/tests/urls.py @@ -4,7 +4,9 @@ from django.contrib.auth.views import password_reset from django.contrib.auth.decorators import login_required 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 }}.") diff --git a/django/contrib/messages/tests/urls.py b/django/contrib/messages/tests/urls.py index 7557f9af4c..5191f34a56 100644 --- a/django/contrib/messages/tests/urls.py +++ b/django/contrib/messages/tests/urls.py @@ -5,6 +5,7 @@ from django.http import HttpResponseRedirect, HttpResponse from django.shortcuts import render_to_response, redirect from django.template import RequestContext, Template from django.template.response import TemplateResponse +from django.views.decorators.cache import never_cache TEMPLATE = """{% if messages %}