@pytest.mark.parametrize('lang', settings.AMO_LANGUAGES)
def test_get_locale_from_lang(lang):
 locale = get_locale_from_lang(lang)
 assert isinstance(locale, Locale)
 assert (locale.language == lang[:2])
 separator = filter(None, [(sep if (sep in lang) else None) for sep in ('-', '_')])
 if separator:
  territory = lang.split(separator[0])[1]
  assert (locale.territory == territory)

@ pytest . mark . parametrize ( 'lang' , settings . AMO_LANGUAGES ) def test_get_locale_from_lang ( lang ) : locale = get_locale_from_lang ( lang ) assert isinstance ( locale , Locale ) assert ( locale . language == lang [ : 2 ] ) separator = filter ( None , [ ( sep if ( sep in lang ) else None ) for sep in ( '-' , '_' ) ] ) if separator : territory = lang . split ( separator [ 0 ] ) [ 1 ] assert ( locale . territory == territory )
make sure all languages in settings .