diff options
| author | Val Neekman <un33kvu@gmail.com> | 2015-07-03 10:41:40 -0400 |
|---|---|---|
| committer | Val Neekman <un33kvu@gmail.com> | 2015-07-03 10:41:40 -0400 |
| commit | ccf60e24a1da424c29edb2fa4f163c5650a85d4d (patch) | |
| tree | dc183044894104876335dfa5d615170841ee70a3 | |
| parent | 741cff34a2600e94b214279479c138dc38fdf6a9 (diff) | |
| parent | 706ecc0d30217c2dd125def1cc5cb5445b010dfa (diff) | |
| download | python-slugify-ccf60e24a1da424c29edb2fa4f163c5650a85d4d.tar.gz | |
Merge pull request #16 from arthurdarcet/patch-1
unichr is not defined in python 3
| -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() |
