mirror of
https://github.com/django/django.git
synced 2025-10-25 22:56:12 +00:00
[1.8.x] Fixed #13008 -- Added more Cache-Control headers to never_cache() decorator.
Backport of 4a438e400b from master
This commit is contained in:
committed by
Tim Graham
parent
91d46d2fb8
commit
b51086d573
@@ -323,3 +323,15 @@ class XFrameOptionsDecoratorsTests(TestCase):
|
||||
# the middleware's functionality, let's make sure it actually works...
|
||||
r = XFrameOptionsMiddleware().process_response(req, resp)
|
||||
self.assertEqual(r.get('X-Frame-Options', None), None)
|
||||
|
||||
|
||||
class NeverCacheDecoratorTest(TestCase):
|
||||
def test_never_cache_decorator(self):
|
||||
@never_cache
|
||||
def a_view(request):
|
||||
return HttpResponse()
|
||||
r = a_view(HttpRequest())
|
||||
self.assertEqual(
|
||||
set(r['Cache-Control'].split(', ')),
|
||||
{'max-age=0', 'no-cache', 'no-store', 'must-revalidate'},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user