Beispiel #1
0
 def test_not_equivalent(self):
     l = Localization("es_ES")
     self.assertFalse(l.equivalent(language="eng"))
     self.assertFalse(l.equivalent(language="en"))
     self.assertFalse(l.equivalent(language="en", country="US"))
     self.assertFalse(l.equivalent(language="en", country="United States"))
     self.assertFalse(l.equivalent(language="en", country="ES"))
     self.assertFalse(l.equivalent(language="en", country="Spain"))
Beispiel #2
0
 def localization(self):
     return Localization(self.get_option("locale"))
Beispiel #3
0
 def test_default(self, getdefaultlocale):
     getdefaultlocale.return_value = (None, None)
     l = Localization()
     self.assertEqual("en_US", l.language_code)
     self.assertTrue(l.equivalent(language="en", country="US"))
Beispiel #4
0
 def test_equivalent_remap(self):
     l = Localization("fr_FR")
     self.assertTrue(l.equivalent(language="fra"))
     self.assertTrue(l.equivalent(language="fre"))
Beispiel #5
0
 def test_equivalent(self):
     l = Localization("en_US")
     self.assertTrue(l.equivalent(language="eng"))
     self.assertTrue(l.equivalent(language="en"))
     self.assertTrue(l.equivalent(language="en", country="US"))
     self.assertTrue(l.equivalent(language="en", country="United States"))
Beispiel #6
0
 def test_language_code(self):
     l = Localization("en_US")
     self.assertEqual("en_US", l.language_code)