def test_non_existing_code_to_country(self): """Tests if a non existing code is handled correctly.""" country = Language.to_name('AA') self.assertEqual('country code does not match a known country', country)
def test_wrongly_formated_code_to_country(self): """Tests if a wrongly formated code is handled correctly.""" country = Language.to_name('USAB') self.assertEqual('invalid country code', country)
def test_code_to_country(self): """Tests if a code can be converted to language.""" country = Language.to_name('US') self.assertEqual('United States', country)