diff options
| author | Tim Graham <timograham@gmail.com> | 2019-02-05 09:38:29 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2019-02-06 14:12:06 -0500 |
| commit | 77d25dbd0f20d6a907c805ffae8aaadd87edbacf (patch) | |
| tree | a082b53101084fb57bbd8d0fb69a3663e4e70057 /tests | |
| parent | d55e88292723764a16f0689c73bc7e739dfa6047 (diff) | |
Refs #27753 -- Favored SafeString over SafeText.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/i18n/tests.py | 12 | ||||
| -rw-r--r-- | tests/utils_tests/test_safestring.py | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/tests/i18n/tests.py b/tests/i18n/tests.py index 0f58789237..eadf556941 100644 --- a/tests/i18n/tests.py +++ b/tests/i18n/tests.py @@ -28,7 +28,7 @@ from django.utils.formats import ( localize_input, reset_format_cache, sanitize_separators, time_format, ) from django.utils.numberformat import format as nformat -from django.utils.safestring import SafeText, mark_safe +from django.utils.safestring import SafeString, mark_safe from django.utils.translation import ( LANGUAGE_SESSION_KEY, activate, check_for_language, deactivate, get_language, get_language_bidi, get_language_from_request, @@ -287,10 +287,10 @@ class TranslationTests(SimpleTestCase): s1 = mark_safe('Password') s2 = mark_safe('May') with translation.override('de', deactivate=True): - self.assertIs(type(gettext(s1)), SafeText) - self.assertIs(type(pgettext('month name', s2)), SafeText) - self.assertEqual('aPassword', SafeText('a') + s1) - self.assertEqual('Passworda', s1 + SafeText('a')) + self.assertIs(type(gettext(s1)), SafeString) + self.assertIs(type(pgettext('month name', s2)), SafeString) + self.assertEqual('aPassword', SafeString('a') + s1) + self.assertEqual('Passworda', s1 + SafeString('a')) self.assertEqual('Passworda', s1 + mark_safe('a')) self.assertEqual('aPassword', mark_safe('a') + s1) self.assertEqual('as', mark_safe('a') + mark_safe('s')) @@ -1532,7 +1532,7 @@ class TestModels(TestCase): def test_safestr(self): c = Company(cents_paid=12, products_delivered=1) - c.name = SafeText('Iñtërnâtiônàlizætiøn1') + c.name = SafeString('Iñtërnâtiônàlizætiøn1') c.save() diff --git a/tests/utils_tests/test_safestring.py b/tests/utils_tests/test_safestring.py index b880d19f27..4068896020 100644 --- a/tests/utils_tests/test_safestring.py +++ b/tests/utils_tests/test_safestring.py @@ -26,7 +26,7 @@ class SafeStringTest(SimpleTestCase): def test_mark_safe_str(self): """ - Calling str() on a SafeText instance doesn't lose the safe status. + Calling str() on a SafeString instance doesn't lose the safe status. """ s = mark_safe('a&b') self.assertIsInstance(str(s), type(s)) |
