[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. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@15866 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
05c929fb3b
commit
1d64c8a539
|
@ -2,7 +2,9 @@ from django.conf.urls.defaults import patterns, handler500, handler404
|
|||
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 }}.")
|
||||
|
|
|
@ -4,8 +4,10 @@ from django.core.urlresolvers import reverse
|
|||
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">
|
||||
|
|
Loading…
Reference in New Issue