diff options
| -rw-r--r-- | slugify/slugify.py | 1 | ||||
| -rw-r--r-- | test.py | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/slugify/slugify.py b/slugify/slugify.py index 5951eb3..4c134f3 100644 --- a/slugify/slugify.py +++ b/slugify/slugify.py @@ -11,6 +11,7 @@ except ImportError: from html.entities import name2codepoint _unicode = str _unicode_type = str + unichr = chr import unidecode @@ -131,6 +131,11 @@ class TestSlugification(unittest.TestCase): r = slugify(txt, stopwords=['the', 'in', 'a', 'hurry']) self.assertEqual(r, 'quick-brown-fox-jumps-over-lazy-dog') + def test_html_entities(self): + txt = 'foo & bar' + r = slugify(txt) + self.assertEqual(r, 'foo-bar') + if __name__ == '__main__': unittest.main() |
