diff options
| author | Val Neekman <val@neekware.com> | 2019-07-27 22:39:01 -0400 |
|---|---|---|
| committer | Val Neekman <val@neekware.com> | 2019-07-27 22:39:01 -0400 |
| commit | b6067d10fc140d30d5d8860f28758e56faa59b4e (patch) | |
| tree | 2a980cf9c460cec9844fc4e739625bb9b2d75bca /test.py | |
| parent | a0cd8fd1608ff63b150bac9c6b32786a00bffc80 (diff) | |
| download | python-slugify-b6067d10fc140d30d5d8860f28758e56faa59b4e.tar.gz | |
update readme, add pydoc
Diffstat (limited to 'test.py')
| -rw-r--r-- | test.py | 27 |
1 files changed, 26 insertions, 1 deletions
@@ -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) |
