diff options
| author | Val Neekman <un33kvu@gmail.com> | 2019-01-03 18:03:36 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-03 18:03:36 -0500 |
| commit | 1340320455f7201117ac3970c0facf5d1e0f8767 (patch) | |
| tree | 72f41588ccc9ae7281220f12fba1f6aff2d5801f /test.py | |
| parent | 683364ea0f4637364b84486ef24124ece0e0597c (diff) | |
| download | python-slugify-2.0.1.tar.gz | |
Add replacements option (#67)2.0.1
Diffstat (limited to 'test.py')
| -rw-r--r-- | test.py | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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): |
