MCPcopy
hub / github.com/django/django / test_cache_key_i18n_timezone

Method test_cache_key_i18n_timezone

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

Source from the content-addressed store, hash-verified

2473
2474 @override_settings(USE_I18N=False, USE_TZ=True)
2475 def test_cache_key_i18n_timezone(self):
2476 request = self.factory.get(self.path)
2477 tz = timezone.get_current_timezone_name()
2478 response = HttpResponse()
2479 key = learn_cache_key(request, response)
2480 self.assertIn(
2481 tz,
2482 key,
2483 "Cache keys should include the time zone name when time zones are active",
2484 )
2485 key2 = get_cache_key(request)
2486 self.assertEqual(key, key2)
2487
2488 @override_settings(USE_I18N=False)
2489 def test_cache_key_no_i18n(self):

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