MCPcopy
hub / github.com/django/django / test_get_cache_key_with_query

Method test_get_cache_key_with_query

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

Source from the content-addressed store, hash-verified

2229 )
2230
2231 def test_get_cache_key_with_query(self):
2232 request = self.factory.get(self.path, {"test": 1})
2233 response = HttpResponse()
2234 # Expect None if no headers have been set yet.
2235 self.assertIsNone(get_cache_key(request))
2236 # Set headers to an empty list.
2237 learn_cache_key(request, response)
2238 # The querystring is taken into account.
2239 self.assertEqual(
2240 get_cache_key(request),
2241 "views.decorators.cache.cache_page.settingsprefix.GET."
2242 "beaf87a9a99ee81c673ea2d67ccbec2a.d41d8cd98f00b204e9800998ecf8427e",
2243 )
2244
2245 def test_cache_key_varies_by_url(self):
2246 """

Callers

nothing calls this directly

Calls 4

HttpResponseClass · 0.90
get_cache_keyFunction · 0.90
learn_cache_keyFunction · 0.90
getMethod · 0.45

Tested by

no test coverage detected