Browse files

Merge pull request #791 from khalas/ticket_19811

Changed %r to %s in get_language_info error message
  • Loading branch information...
2 parents f368c25 + 48dc0cb commit 0a341ab40dd35cd97127a4ebd77e0bfe3b21fafa @HonzaKral HonzaKral committed Feb 23, 2013
Showing with 4 additions and 4 deletions.
  1. +2 −2 django/utils/translation/__init__.py
  2. +2 −2 tests/regressiontests/i18n/tests.py
View
4 django/utils/translation/__init__.py
@@ -192,5 +192,5 @@ def get_language_info(lang_code):
try:
return LANG_INFO[splited_lang_code]
except KeyError:
- raise KeyError("Unknown language code %r and %r." % (lang_code, splited_lang_code))
- raise KeyError("Unknown language code %r." % lang_code)
+ raise KeyError("Unknown language code %s and %s." % (lang_code, splited_lang_code))
+ raise KeyError("Unknown language code %s." % lang_code)
View
4 tests/regressiontests/i18n/tests.py
@@ -957,7 +957,7 @@ def test_localized_language_info(self):
self.assertEqual(li['bidi'], False)
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')
def test_unknown_only_country_code(self):
@@ -968,7 +968,7 @@ def test_unknown_only_country_code(self):
self.assertEqual(li['bidi'], False)
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')

0 comments on commit 0a341ab

Please sign in to comment.