MCPcopy
hub / github.com/django/django / test_learn_cache_key

Method test_learn_cache_key

tests/cache/tests.py:2255–2266  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2253 self.assertNotEqual(get_cache_key(request1), get_cache_key(request2))
2254
2255 def test_learn_cache_key(self):
2256 request = self.factory.head(self.path)
2257 response = HttpResponse()
2258 response.headers["Vary"] = "Pony"
2259 # Make sure that the Vary header is added to the key hash
2260 learn_cache_key(request, response)
2261
2262 self.assertEqual(
2263 get_cache_key(request),
2264 "views.decorators.cache.cache_page.settingsprefix.GET."
2265 "18a03f9c9649f7d684af5db3524f5c99.d41d8cd98f00b204e9800998ecf8427e",
2266 )
2267
2268 def test_patch_cache_control(self):
2269 tests = (

Callers

nothing calls this directly

Calls 4

HttpResponseClass · 0.90
learn_cache_keyFunction · 0.90
get_cache_keyFunction · 0.90
headMethod · 0.45

Tested by

no test coverage detected