summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2021-01-05 12:27:52 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-01-14 17:50:04 +0100
commit810f037b29402f848a766f6900b4ebfbaf64cc88 (patch)
tree1f033a88ecd8286530a27dbb83b7150382d00ca7 /tests
parent88ed1c8d08c70fd3e7943fc8383459545f726dcd (diff)
Refs #27753 -- Removed django.utils.encoding.force_text() and smart_text() per deprecation timeline.
Diffstat (limited to 'tests')
-rw-r--r--tests/utils_tests/test_encoding_deprecations.py24
1 files changed, 0 insertions, 24 deletions
diff --git a/tests/utils_tests/test_encoding_deprecations.py b/tests/utils_tests/test_encoding_deprecations.py
deleted file mode 100644
index c775ce5f66..0000000000
--- a/tests/utils_tests/test_encoding_deprecations.py
+++ /dev/null
@@ -1,24 +0,0 @@
-from django.test import SimpleTestCase, ignore_warnings
-from django.utils.deprecation import RemovedInDjango40Warning
-from django.utils.encoding import force_text, smart_text
-from django.utils.functional import SimpleLazyObject
-from django.utils.translation import gettext_lazy
-
-
-@ignore_warnings(category=RemovedInDjango40Warning)
-class TestDeprecatedEncodingUtils(SimpleTestCase):
-
- def test_force_text(self):
- s = SimpleLazyObject(lambda: 'x')
- self.assertIs(type(force_text(s)), str)
-
- def test_smart_text(self):
- class Test:
- def __str__(self):
- return 'ŠĐĆŽćžšđ'
-
- lazy_func = gettext_lazy('x')
- self.assertIs(smart_text(lazy_func), lazy_func)
- self.assertEqual(smart_text(Test()), '\u0160\u0110\u0106\u017d\u0107\u017e\u0161\u0111')
- self.assertEqual(smart_text(1), '1')
- self.assertEqual(smart_text('foo'), 'foo')