From b6067d10fc140d30d5d8860f28758e56faa59b4e Mon Sep 17 00:00:00 2001 From: Val Neekman Date: Sat, 27 Jul 2019 22:39:01 -0400 Subject: update readme, add pydoc --- test.py | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'test.py') diff --git a/test.py b/test.py index 78b1956..e1efe38 100644 --- a/test.py +++ b/test.py @@ -142,11 +142,36 @@ class TestSlugification(unittest.TestCase): r = slugify(txt, stopwords=['the'], separator=' ') self.assertEqual(r, 'quick brown fox jumps over lazy dog') - def test_html_entities(self): + def test_html_entities_on(self): txt = 'foo & bar' r = slugify(txt) self.assertEqual(r, 'foo-bar') + def test_html_entities_off(self): + txt = 'foo & bar' + r = slugify(txt, entities=False) + self.assertEqual(r, 'foo-amp-bar') + + def test_html_decimal_on(self): + txt = 'Ž' + r = slugify(txt, decimal=True) + self.assertEqual(r, 'z') + + def test_html_decimal_off(self): + txt = 'Ž' + r = slugify(txt, entities=False, decimal=False) + self.assertEqual(r, '381') + + def test_html_hexadecimal_on(self): + txt = 'Ž' + r = slugify(txt, hexadecimal=True) + self.assertEqual(r, 'z') + + def test_html_hexadecimal_off(self): + txt = 'Ž' + r = slugify(txt, hexadecimal=False) + self.assertEqual(r, 'x17d') + def test_starts_with_number(self): txt = '10 amazing secrets' r = slugify(txt) -- cgit v1.2.1