diff --git a/tests/regressiontests/i18n/tests.py b/tests/regressiontests/i18n/tests.py index 5e4726b67a..ad184d8da3 100644 --- a/tests/regressiontests/i18n/tests.py +++ b/tests/regressiontests/i18n/tests.py @@ -957,8 +957,7 @@ class TestLanguageInfo(TestCase): self.assertEqual(li['bidi'], False) def test_unknown_language_code(self): - with self.assertRaisesRegexp(KeyError, "Unknown language code xx."): - get_language_info('xx') + six.assertRaisesRegex(self, KeyError, "Unknown language code '?xx'?.", get_language_info, 'xx-xx') def test_unknown_only_country_code(self): li = get_language_info('de-xx') @@ -968,8 +967,7 @@ class TestLanguageInfo(TestCase): self.assertEqual(li['bidi'], False) def test_unknown_language_code_and_country_code(self): - with self.assertRaisesRegexp(KeyError, "Unknown language code xx-xx and xx."): - get_language_info('xx-xx') + six.assertRaisesRegex(self, KeyError, "Unknown language code '?xx-xx'? and '?xx'?.", get_language_info, 'xx-xx') class MultipleLocaleActivationTests(TestCase):