diff options
| author | vrbaskiz <vrbaskiz@gmail.com> | 2017-03-31 17:47:10 +0200 |
|---|---|---|
| committer | Val Neekman <un33kvu@gmail.com> | 2017-03-31 11:47:10 -0400 |
| commit | 750c737b37a7261ef551f9ab013dfb0b1b3eb29a (patch) | |
| tree | 197bd7f50dfcf9fc0b75c6b99f56a5b24d3d26be /test.py | |
| parent | 3f7ce8791dc676216c6bd9f0757262cf6bc210f1 (diff) | |
| download | python-slugify-750c737b37a7261ef551f9ab013dfb0b1b3eb29a.tar.gz | |
Added possibility to include custom regex as allowed characters (#36)
Added possibility to allow custom regex as allowed characters.
Diffstat (limited to 'test.py')
| -rw-r--r-- | test.py | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -167,6 +167,11 @@ class TestSlugification(unittest.TestCase): r = slugify(txt) self.assertEqual(r, '1000-reasons-you-are-1') + def test_underscore(self): + txt = "___This is a test___" + r = slugify(txt, allowed_characters=r'[^-a-z0-9_]+') + self.assertEqual(r, "___this-is-a-test___") + class TestUtils(unittest.TestCase): |
