mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Fixed #13008 -- Added more Cache-Control headers to never_cache() decorator.
This commit is contained in:
parent
82162b4499
commit
4a438e400b
7 changed files with 45 additions and 3 deletions
|
@ -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'},
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue