Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Fixed #15142 -- Force test views to be non-cached so that projects wi…

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

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit b49ee91eb39e6008fed9d77c19b84362d3dd2b16 1 parent 1af3342
@freakboy3742 freakboy3742 authored
2  django/contrib/auth/tests/
@@ -4,7 +4,9 @@
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
def remote_user_auth_view(request):
"Dummy view for remote user tests"
t = Template("Username is {{ user }}.")
5 django/contrib/messages/tests/
@@ -5,6 +5,7 @@
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 %}
<ul class="messages">
@@ -17,6 +18,7 @@
{% endif %}
def add(request, message_type):
# don't default to False here, because we want to test that it defaults
# to False if unspecified
@@ -31,6 +33,7 @@ def add(request, message_type):
show_url = reverse('')
return HttpResponseRedirect(show_url)
def add_template_response(request, message_type):
for msg in request.POST.getlist('messages'):
getattr(messages, message_type)(request, msg)
@@ -38,10 +41,12 @@ def add_template_response(request, message_type):
show_url = reverse('django.contrib.messages.tests.urls.show_template_response')
return HttpResponseRedirect(show_url)
def show(request):
t = Template(TEMPLATE)
return HttpResponse(t.render(RequestContext(request)))
def show_template_response(request):
return TemplateResponse(request, Template(TEMPLATE))

0 comments on commit b49ee91

Please sign in to comment.
Something went wrong with that request. Please try again.