Esempio n. 1
0
 def test_get_languages_defined_site(self):
     result = i18n.get_languages(1)
     self.assertEqual(2, len(result))
     lang = result[0]
     self.assertEqual(lang['code'], 'en')
     self.assertEqual(lang['public'], True)
     lang = result[1]
     self.assertEqual(lang['code'], 'fr')
     self.assertEqual(lang['public'], False)
Esempio n. 2
0
 def test_get_languages_undefined_site(self):
     result = i18n.get_languages(66)
     self.assertEqual(4, len(result))
     self.assertEqual(result[0]['code'], 'fr')
     self.assertEqual(result[1]['code'], 'en')
     self.assertEqual(result[2]['code'], 'de')
     self.assertEqual(result[3]['code'], 'es')
     for lang in result:
         self.assertEqual(lang['public'], True)
         self.assertEqual(lang['hide_untranslated'], True)
Esempio n. 3
0
 def test_get_languages_default_site(self):
     result = i18n.get_languages()
     self.assertEqual(2, len(result))
     lang = result[0]
     self.assertEqual(lang['code'], 'en-gb')
     self.assertEqual(i18n.get_language_code(lang['code']), 'en-gb')
     self.assertEqual(lang['public'], True)
     lang = result[1]
     self.assertEqual(lang['code'], 'fr-ca')
     self.assertEqual(i18n.get_language_code(lang['code']), 'fr-ca')
     self.assertEqual(lang['public'], False)
Esempio n. 4
0
 def test_get_languages_default_site(self):
     result = i18n.get_languages()
     self.assertEqual(2, len(result))
     lang = result[0]
     self.assertEqual(lang['code'], 'en-gb')
     self.assertEqual(i18n.get_language_code(lang['code']), 'en-gb')
     self.assertEqual(lang['public'], True)
     lang = result[1]
     self.assertEqual(lang['code'], 'fr-ca')
     self.assertEqual(i18n.get_language_code(lang['code']), 'fr-ca')
     self.assertEqual(lang['public'], False)
Esempio n. 5
0
 def test_get_languages_defined_site(self):
     result = i18n.get_languages(1)
     self.assertEqual(2, len(result))
     lang = result[0]
     self.assertEqual(lang["code"], "en")
     self.assertEqual(i18n.get_language_code(lang["code"]), "en")
     self.assertEqual(lang["public"], True)
     lang = result[1]
     self.assertEqual(lang["code"], "fr")
     self.assertEqual(i18n.get_language_code(lang["code"]), "fr")
     self.assertEqual(lang["public"], False)
Esempio n. 6
0
 def test_get_languages_undefined_site(self):
     result = i18n.get_languages(66)
     self.assertEqual(4, len(result))
     self.assertEqual(result[0]["code"], "fr")
     self.assertEqual(i18n.get_language_code(result[0]["code"]), "fr")
     self.assertEqual(result[1]["code"], "en")
     self.assertEqual(i18n.get_language_code(result[1]["code"]), "en")
     self.assertEqual(result[2]["code"], "de")
     self.assertEqual(i18n.get_language_code(result[2]["code"]), "de")
     self.assertEqual(result[3]["code"], "es")
     self.assertEqual(i18n.get_language_code(result[3]["code"]), "es")
     for lang in result:
         self.assertEqual(lang["public"], True)
         self.assertEqual(lang["hide_untranslated"], True)
Esempio n. 7
0
 def test_get_languages_undefined_site(self):
     result = i18n.get_languages(66)
     self.assertEqual(5, len(result))
     self.assertEqual(result[0]['code'], 'fr-ca')
     self.assertEqual(i18n.get_language_code(result[0]['code']), 'fr-ca')
     self.assertEqual(result[1]['code'], 'en-us')
     self.assertEqual(i18n.get_language_code(result[1]['code']), 'en-us')
     self.assertEqual(result[2]['code'], 'en-gb')
     self.assertEqual(i18n.get_language_code(result[2]['code']), 'en-gb')
     self.assertEqual(result[3]['code'], 'de')
     self.assertEqual(i18n.get_language_code(result[3]['code']), 'de')
     self.assertEqual(result[4]['code'], 'es')
     self.assertEqual(i18n.get_language_code(result[4]['code']), 'es')
     for lang in result:
         self.assertEqual(lang['public'], True)
         self.assertEqual(lang['hide_untranslated'], False)
Esempio n. 8
0
 def test_get_languages_undefined_site(self):
     result = i18n.get_languages(66)
     self.assertEqual(5, len(result))
     self.assertEqual(result[0]['code'], 'fr-ca')
     self.assertEqual(i18n.get_language_code(result[0]['code']), 'fr-ca')
     self.assertEqual(result[1]['code'], 'en-us')
     self.assertEqual(i18n.get_language_code(result[1]['code']), 'en-us')
     self.assertEqual(result[2]['code'], 'en-gb')
     self.assertEqual(i18n.get_language_code(result[2]['code']), 'en-gb')
     self.assertEqual(result[3]['code'], 'de')
     self.assertEqual(i18n.get_language_code(result[3]['code']), 'de')
     self.assertEqual(result[4]['code'], 'es')
     self.assertEqual(i18n.get_language_code(result[4]['code']), 'es')
     for lang in result:
         self.assertEqual(lang['public'], True)
         self.assertEqual(lang['hide_untranslated'], False)