Skip to content
Browse files

Don't cache redirects

  • Loading branch information...
1 parent fca66e8 commit c4b97641095edb3d0a5615dd86018456b73ec668 @edavis edavis committed
Showing with 7 additions and 5 deletions.
  1. +7 −5 jimmypage/tests.py
View
12 jimmypage/tests.py
@@ -42,17 +42,19 @@ def test_dont_cache_responses_that_include_messages(self):
response = self.client.get("/test_messages/")
self.assertFalse(response_is_cacheable(request, response))
+ def test_dont_cache_redirects(self):
+ request = self.factory.get("/")
+ response = HttpResponseRedirect("/other/")
+ self.assertFalse(response_is_cacheable(request, response))
+
def test_cacheable(self):
req = HttpRequest()
req.path = "/some/path"
req.method = "GET"
self.assertTrue(request_is_cacheable(req))
- redirect = HttpResponseRedirect("someurl")
- self.assertFalse(response_is_cacheable(req, redirect))
-
- res['Pragma'] = "no-cache"
- self.assertFalse(response_is_cacheable(req, res))
+ # res['Pragma'] = "no-cache"
+ # self.assertFalse(response_is_cacheable(req, res))
def test_key_uniqueness(self):
req = HttpRequest()

0 comments on commit c4b9764

Please sign in to comment.
Something went wrong with that request. Please try again.