Changed %r to %s in get_language_info error message.

This commit is contained in:
Konrad Hałas 2013-02-23 18:54:54 +01:00
parent cc53d9b30b
commit 48dc0cbf2a
2 changed files with 4 additions and 4 deletions

View File

@ -192,5 +192,5 @@ def get_language_info(lang_code):
try: try:
return LANG_INFO[splited_lang_code] return LANG_INFO[splited_lang_code]
except KeyError: except KeyError:
raise KeyError("Unknown language code %r and %r." % (lang_code, splited_lang_code)) raise KeyError("Unknown language code %s and %s." % (lang_code, splited_lang_code))
raise KeyError("Unknown language code %r." % lang_code) raise KeyError("Unknown language code %s." % lang_code)

View File

@ -957,7 +957,7 @@ class TestLanguageInfo(TestCase):
self.assertEqual(li['bidi'], False) self.assertEqual(li['bidi'], False)
def test_unknown_language_code(self): def test_unknown_language_code(self):
with self.assertRaisesRegexp(KeyError, "Unknown language code u\'xx\'."): with self.assertRaisesRegexp(KeyError, "Unknown language code xx."):
get_language_info('xx') get_language_info('xx')
def test_unknown_only_country_code(self): def test_unknown_only_country_code(self):
@ -968,7 +968,7 @@ class TestLanguageInfo(TestCase):
self.assertEqual(li['bidi'], False) self.assertEqual(li['bidi'], False)
def test_unknown_language_code_and_country_code(self): def test_unknown_language_code_and_country_code(self):
with self.assertRaisesRegexp(KeyError, "Unknown language code u\'xx-xx\' and u\'xx\'."): with self.assertRaisesRegexp(KeyError, "Unknown language code xx-xx and xx."):
get_language_info('xx-xx') get_language_info('xx-xx')