def test_extra_subtags(self): self.assertEqual(list(locale_lookups("zh-Hant-CN-x-private1-private2")), ["zh-Hant-CN-x-private1-private2", "zh-Hant-CN-x-private1", "zh-Hant-CN", "zh-Hant", "zh"])
def test_eliminates_dupes(self): # This would be en-GB, en, en without dupe elimination self.assertEqual(list(locale_lookups("en-GB, en")), ["en-GB", "en"])
def test_list(self): self.assertEqual(list(locale_lookups("en-US, fr-FR")), ["en-US", "en", "fr-FR", "fr"])
def test_language_and_region(self): self.assertEqual(list(locale_lookups("en-US")), ["en-US", "en"])
def test_language(self): self.assertEqual(list(locale_lookups("en")), ["en"])