MCPcopy
hub / github.com/django/django / test_cache_key_i18n_translation

Method test_cache_key_i18n_translation

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

Source from the content-addressed store, hash-verified

2402
2403 @override_settings(USE_I18N=True, USE_TZ=False)
2404 def test_cache_key_i18n_translation(self):
2405 request = self.factory.get(self.path)
2406 lang = translation.get_language()
2407 response = HttpResponse()
2408 key = learn_cache_key(request, response)
2409 self.assertIn(
2410 lang,
2411 key,
2412 "Cache keys should include the language name when translation is active",
2413 )
2414 key2 = get_cache_key(request)
2415 self.assertEqual(key, key2)
2416
2417 def check_accept_language_vary(self, accept_language, vary, reference_key):
2418 request = self.factory.get(self.path)

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected