mirror of
https://github.com/django/django.git
synced 2025-07-04 17:59:13 +00:00
[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.contrib.auth.urls import urlpatterns
|
||||||
from django.http import HttpResponse
|
from django.http import HttpResponse
|
||||||
from django.template import Template, RequestContext
|
from django.template import Template, RequestContext
|
||||||
|
from django.views.decorators.cache import never_cache
|
||||||
|
|
||||||
|
@never_cache
|
||||||
def remote_user_auth_view(request):
|
def remote_user_auth_view(request):
|
||||||
"Dummy view for remote user tests"
|
"Dummy view for remote user tests"
|
||||||
t = Template("Username is {{ user }}.")
|
t = Template("Username is {{ user }}.")
|
||||||
|
@ -4,8 +4,10 @@ from django.core.urlresolvers import reverse
|
|||||||
from django.http import HttpResponseRedirect, HttpResponse
|
from django.http import HttpResponseRedirect, HttpResponse
|
||||||
from django.shortcuts import render_to_response
|
from django.shortcuts import render_to_response
|
||||||
from django.template import RequestContext, Template
|
from django.template import RequestContext, Template
|
||||||
|
from django.views.decorators.cache import never_cache
|
||||||
|
|
||||||
|
|
||||||
|
@never_cache
|
||||||
def add(request, message_type):
|
def add(request, message_type):
|
||||||
# don't default to False here, because we want to test that it defaults
|
# don't default to False here, because we want to test that it defaults
|
||||||
# to False if unspecified
|
# to False if unspecified
|
||||||
@ -20,6 +22,7 @@ def add(request, message_type):
|
|||||||
return HttpResponseRedirect(show_url)
|
return HttpResponseRedirect(show_url)
|
||||||
|
|
||||||
|
|
||||||
|
@never_cache
|
||||||
def show(request):
|
def show(request):
|
||||||
t = Template("""{% if messages %}
|
t = Template("""{% if messages %}
|
||||||
<ul class="messages">
|
<ul class="messages">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user