From 0a01ca80d7f7f1922d0c515669d0e7afd3acff5a Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Wed, 24 Apr 2019 06:31:03 -0700 Subject: [PATCH] Refs #30241 -- Fixed BytesWarning emitted in test_translation tests. --- django/core/checks/translation.py | 6 +++--- tests/check_framework/test_translation.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/django/core/checks/translation.py b/django/core/checks/translation.py index ebbd1eabf3..138ed07ff8 100644 --- a/django/core/checks/translation.py +++ b/django/core/checks/translation.py @@ -4,17 +4,17 @@ from django.utils.translation.trans_real import language_code_re from . import Error, Tags, register E001 = Error( - 'You have provided an invalid value for the LANGUAGE_CODE setting: {}.', + 'You have provided an invalid value for the LANGUAGE_CODE setting: {!r}.', id='translation.E001', ) E002 = Error( - 'You have provided an invalid language code in the LANGUAGES setting: {}.', + 'You have provided an invalid language code in the LANGUAGES setting: {!r}.', id='translation.E002', ) E003 = Error( - 'You have provided an invalid language code in the LANGUAGES_BIDI setting: {}.', + 'You have provided an invalid language code in the LANGUAGES_BIDI setting: {!r}.', id='translation.E003', ) diff --git a/tests/check_framework/test_translation.py b/tests/check_framework/test_translation.py index cb6e053d77..4cd79d803f 100644 --- a/tests/check_framework/test_translation.py +++ b/tests/check_framework/test_translation.py @@ -42,7 +42,7 @@ class TranslationCheckTests(SimpleTestCase): self.assertEqual(check_setting_language_code(None), []) def test_invalid_language_code(self): - msg = 'You have provided an invalid value for the LANGUAGE_CODE setting: %s.' + msg = 'You have provided an invalid value for the LANGUAGE_CODE setting: %r.' for tag in self.invalid_tags: with self.subTest(tag), self.settings(LANGUAGE_CODE=tag): self.assertEqual(check_setting_language_code(None), [ @@ -55,7 +55,7 @@ class TranslationCheckTests(SimpleTestCase): self.assertEqual(check_setting_languages(None), []) def test_invalid_languages(self): - msg = 'You have provided an invalid language code in the LANGUAGES setting: %s.' + msg = 'You have provided an invalid language code in the LANGUAGES setting: %r.' for tag in self.invalid_tags: with self.subTest(tag), self.settings(LANGUAGES=[(tag, tag)]): self.assertEqual(check_setting_languages(None), [ @@ -68,7 +68,7 @@ class TranslationCheckTests(SimpleTestCase): self.assertEqual(check_setting_languages_bidi(None), []) def test_invalid_languages_bidi(self): - msg = 'You have provided an invalid language code in the LANGUAGES_BIDI setting: %s.' + msg = 'You have provided an invalid language code in the LANGUAGES_BIDI setting: %r.' for tag in self.invalid_tags: with self.subTest(tag), self.settings(LANGUAGES_BIDI=[tag]): self.assertEqual(check_setting_languages_bidi(None), [