diff options
| author | Markus Bertheau <mbertheau@gmail.com> | 2015-04-27 23:56:02 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-12-24 11:25:50 -0500 |
| commit | b51086d57313e7ea857f4b96b62d25e600ee0a8d (patch) | |
| tree | e23747c23aa0cf6b0db6da31f1d723e8fb3ce655 /tests | |
| parent | 91d46d2fb872a572dcd8e645b2d60be4d4c7ca24 (diff) | |
[1.8.x] Fixed #13008 -- Added more Cache-Control headers to never_cache() decorator.
Backport of 4a438e400b7ce0ab9d0b6876196cbe8d620a4171 from master
Diffstat (limited to 'tests')
| -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 a9b5e7a8ae..00d2d85985 100644 --- a/tests/decorators/tests.py +++ b/tests/decorators/tests.py @@ -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'}, + ) |
