def test_country_to_code(self): """Tests if a country name can be converted to a code.""" code = Language.to_code('United States') self.assertEqual('US', code) code = Language.to_code('United States', code_len=3) self.assertEqual('USA', code)
def test_non_existing_country_to_code(self): """Tests if a non existing country is handled correctly.""" code = Language.to_code('ABCDEFG') self.assertEqual('country not found', code)