MCPcopy
hub / github.com/django/django / test_english_fallback

Method test_english_fallback

tests/i18n/tests.py:1547–1559  ·  view source on GitHub ↗

With a non-English LANGUAGE_CODE and if the active language is English or one of its variants, the untranslated string should be returned (instead of falling back to LANGUAGE_CODE) (See #24413).

(self)

Source from the content-addressed store, hash-verified

1545
1546 @override_settings(LANGUAGE_CODE="de")
1547 def test_english_fallback(self):
1548 """
1549 With a non-English LANGUAGE_CODE and if the active language is English
1550 or one of its variants, the untranslated string should be returned
1551 (instead of falling back to LANGUAGE_CODE) (See #24413).
1552 """
1553 self.assertEqual(gettext("Image"), "Bild")
1554 with translation.override("en"):
1555 self.assertEqual(gettext("Image"), "Image")
1556 with translation.override("en-us"):
1557 self.assertEqual(gettext("Image"), "Image")
1558 with translation.override("en-ca"):
1559 self.assertEqual(gettext("Image"), "Image")
1560
1561 def test_parse_spec_http_header(self):
1562 """

Callers

nothing calls this directly

Calls 1

gettextFunction · 0.90

Tested by

no test coverage detected