diff options
| author | Val Neekman <val@neekware.com> | 2015-07-08 09:38:26 -0400 |
|---|---|---|
| committer | Val Neekman <val@neekware.com> | 2015-07-08 09:38:26 -0400 |
| commit | 2a55aed04fed93b5fc99b8a305ef713fc25faac8 (patch) | |
| tree | ed5a313e3f42397c405880adcf314cde47f56f7f | |
| parent | 2375ba11f81e1c42cb39e103e2b98479aa10401f (diff) | |
| parent | ccf60e24a1da424c29edb2fa4f163c5650a85d4d (diff) | |
| download | python-slugify-2a55aed04fed93b5fc99b8a305ef713fc25faac8.tar.gz | |
Merge branch 'master' into development
| -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() |
