summaryrefslogtreecommitdiff
path: root/test.py
diff options
context:
space:
mode:
authorvrbaskiz <vrbaskiz@gmail.com>2017-03-31 17:47:10 +0200
committerVal Neekman <un33kvu@gmail.com>2017-03-31 11:47:10 -0400
commit750c737b37a7261ef551f9ab013dfb0b1b3eb29a (patch)
tree197bd7f50dfcf9fc0b75c6b99f56a5b24d3d26be /test.py
parent3f7ce8791dc676216c6bd9f0757262cf6bc210f1 (diff)
downloadpython-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.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/test.py b/test.py
index 768fcb9..d5c13e9 100644
--- a/test.py
+++ b/test.py
@@ -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):