Responses with 'Cache-Control: private/no-cache/no-store' are not cached.
(self)
| 2847 | cache.clear() |
| 2848 | |
| 2849 | def test_cache_control_not_cached(self): |
| 2850 | """ |
| 2851 | Responses with 'Cache-Control: private/no-cache/no-store' are |
| 2852 | not cached. |
| 2853 | """ |
| 2854 | for cc in ("private", "no-cache", "no-store"): |
| 2855 | with self.subTest(cache_control=cc): |
| 2856 | view_with_cache = cache_page(3)( |
| 2857 | cache_control(**{cc: True})(hello_world_view) |
| 2858 | ) |
| 2859 | request = self.factory.get("/view/") |
| 2860 | response = view_with_cache(request, "1") |
| 2861 | self.assertEqual(response.content, b"Hello World 1") |
| 2862 | response = view_with_cache(request, "2") |
| 2863 | self.assertEqual(response.content, b"Hello World 2") |
| 2864 | |
| 2865 | def test_vary_asterisk_not_cached(self): |
| 2866 | views_with_cache = ( |
nothing calls this directly
no test coverage detected