MCPcopy
hub / github.com/django/django / test_unknown_language_code

Method test_unknown_language_code

tests/i18n/tests.py:1941–1947  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1939 self.assertIs(li["bidi"], False)
1940
1941 def test_unknown_language_code(self):
1942 with self.assertRaisesMessage(KeyError, "Unknown language code xx"):
1943 get_language_info("xx")
1944 with translation.override("xx"):
1945 # A language with no translation catalogs should fallback to the
1946 # untranslated string.
1947 self.assertEqual(gettext("Title"), "Title")
1948
1949 def test_unknown_only_country_code(self):
1950 li = get_language_info("de-xx")

Callers

nothing calls this directly

Calls 3

get_language_infoFunction · 0.90
gettextFunction · 0.90
assertRaisesMessageMethod · 0.80

Tested by

no test coverage detected