summaryrefslogtreecommitdiff
path: root/test.py
diff options
context:
space:
mode:
Diffstat (limited to 'test.py')
-rw-r--r--test.py27
1 files changed, 26 insertions, 1 deletions
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)