diff options
author | Markus Bertheau <mbertheau@gmail.com> | 2015-04-27 23:56:02 +0200 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2015-04-28 12:07:02 -0400 |
commit | 4a438e400b7ce0ab9d0b6876196cbe8d620a4171 (patch) | |
tree | cce5d4a9271ad302eea2ff348b40b738f297dcf5 /tests/decorators | |
parent | 82162b4499fc3b83b626c24386e4e5245191d13e (diff) | |
download | django-4a438e400b7ce0ab9d0b6876196cbe8d620a4171.tar.gz |
Fixed #13008 -- Added more Cache-Control headers to never_cache() decorator.
Diffstat (limited to 'tests/decorators')
-rw-r--r-- | tests/decorators/tests.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/decorators/tests.py b/tests/decorators/tests.py index d3e2eddf8c..d6b2c78068 100644 --- a/tests/decorators/tests.py +++ b/tests/decorators/tests.py @@ -317,3 +317,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'}, + ) |