summaryrefslogtreecommitdiff
path: root/tests/utils_tests
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2021-01-07 08:09:04 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-01-14 17:50:04 +0100
commit157ab32f3446da7fa1f9d716509c290069a2a156 (patch)
tree39781a5e2c3e89650ab817e850fdbde1fd4da0cc /tests/utils_tests
parent5e33ec80d153416d3693e89138ed21decf042672 (diff)
Refs #27753 -- Removed django.utils.text.unescape_entities() per deprecation timeline.
Diffstat (limited to 'tests/utils_tests')
-rw-r--r--tests/utils_tests/test_text.py29
1 files changed, 1 insertions, 28 deletions
diff --git a/tests/utils_tests/test_text.py b/tests/utils_tests/test_text.py
index 1b6bfc0b8e..c9c74521e3 100644
--- a/tests/utils_tests/test_text.py
+++ b/tests/utils_tests/test_text.py
@@ -1,9 +1,8 @@
import json
import sys
-from django.test import SimpleTestCase, ignore_warnings
+from django.test import SimpleTestCase
from django.utils import text
-from django.utils.deprecation import RemovedInDjango40Warning
from django.utils.functional import lazystr
from django.utils.text import format_lazy
from django.utils.translation import gettext_lazy, override
@@ -213,32 +212,6 @@ class TestUtilsText(SimpleTestCase):
with self.subTest('intern'):
self.assertEqual(sys.intern(text.slugify('a')), 'a')
- @ignore_warnings(category=RemovedInDjango40Warning)
- def test_unescape_entities(self):
- items = [
- ('', ''),
- ('foo', 'foo'),
- ('&amp;', '&'),
- ('&am;', '&am;'),
- ('&#x26;', '&'),
- ('&#xk;', '&#xk;'),
- ('&#38;', '&'),
- ('foo &amp; bar', 'foo & bar'),
- ('foo & bar', 'foo & bar'),
- ]
- for value, output in items:
- with self.subTest(value=value):
- self.assertEqual(text.unescape_entities(value), output)
- self.assertEqual(text.unescape_entities(lazystr(value)), output)
-
- def test_unescape_entities_deprecated(self):
- msg = (
- 'django.utils.text.unescape_entities() is deprecated in favor of '
- 'html.unescape().'
- )
- with self.assertWarnsMessage(RemovedInDjango40Warning, msg):
- text.unescape_entities('foo')
-
def test_unescape_string_literal(self):
items = [
('"abc"', 'abc'),