summaryrefslogtreecommitdiff
path: root/test.py
diff options
context:
space:
mode:
Diffstat (limited to 'test.py')
-rw-r--r--test.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/test.py b/test.py
new file mode 100644
index 0000000..d713ee3
--- /dev/null
+++ b/test.py
@@ -0,0 +1,29 @@
+# -*- coding: utf-8 -*-
+
+import unittest
+from slugify import slugify
+
+class TestSequenceFunctions(unittest.TestCase):
+
+ def test_space_dash(self):
+ txt = "This is a test ---"
+ r = slugify(txt)
+ self.assertEquals(r, "this-is-a-test")
+
+ def test_special_chars(self):
+ txt = 'C\'est déjà l\'été.'
+ r = slugify(txt)
+ self.assertEquals(r, "cest-deja-lete")
+
+ txt = 'Nín hǎo. Wǒ shì zhōng guó rén'
+ r = slugify(txt)
+ self.assertEquals(r, "nin-hao-wo-shi-zhong-guo-ren")
+
+ txt = '影師嗎'
+ r = slugify(txt)
+ self.assertEquals(r, "ying-shi-ma")
+
+if __name__ == '__main__':
+ unittest.main()
+
+