mirror of
https://github.com/django/django.git
synced 2025-10-26 15:16:09 +00:00
[1.6.x] Fix #21185: Added tests for unescape_entities.
Also fixed a py3 incompatibility.
Thanks to brutasse for the report.
Backport of 3754f4ad41 from master.
This commit is contained in:
@@ -106,3 +106,16 @@ class TestUtilsText(SimpleTestCase):
|
||||
)
|
||||
for value, output in items:
|
||||
self.assertEqual(text.slugify(value), output)
|
||||
|
||||
def test_unescape_entities(self):
|
||||
items = [
|
||||
('', ''),
|
||||
('foo', 'foo'),
|
||||
('&', '&'),
|
||||
('&', '&'),
|
||||
('&', '&'),
|
||||
('foo & bar', 'foo & bar'),
|
||||
('foo & bar', 'foo & bar'),
|
||||
]
|
||||
for value, output in items:
|
||||
self.assertEqual(text.unescape_entities(value), output)
|
||||
|
||||
Reference in New Issue
Block a user