summaryrefslogtreecommitdiff
path: root/test.py
diff options
context:
space:
mode:
Diffstat (limited to 'test.py')
-rw-r--r--test.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/test.py b/test.py
index 9ff9ec0..78b1956 100644
--- a/test.py
+++ b/test.py
@@ -189,6 +189,15 @@ class TestSlugification(unittest.TestCase):
r = slugify(txt, separator='_', regex_pattern=regex_pattern)
self.assertNotEqual(r, "_this_is_a_test_")
+ def test_replacements(self):
+ txt = '10 | 20 %'
+ r = slugify(txt, replacements=[['|', 'or'], ['%', 'percent']])
+ self.assertEqual(r, "10-or-20-percent")
+
+ txt = 'I ♥ 🦄'
+ r = slugify(txt, replacements=[['♥', 'amour'], ['🦄', 'licorne']])
+ self.assertEqual(r, "i-amour-licorne")
+
class TestUtils(unittest.TestCase):