From 3754f4ad410640382f9fe25073da03009cdc2ea3 Mon Sep 17 00:00:00 2001 From: Baptiste Mispelon Date: Fri, 27 Sep 2013 17:00:42 +0200 Subject: Fix #21185: Added tests for unescape_entities. Also fixed a py3 incompatibility. Thanks to brutasse for the report. --- tests/utils_tests/test_text.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests/utils_tests') diff --git a/tests/utils_tests/test_text.py b/tests/utils_tests/test_text.py index c9dde6b1b3..dd72d26e06 100644 --- a/tests/utils_tests/test_text.py +++ b/tests/utils_tests/test_text.py @@ -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) -- cgit v1.3