summaryrefslogtreecommitdiff
path: root/test.py
diff options
context:
space:
mode:
authordioexul <dioexul@gmail.com>2015-02-22 21:21:27 +0300
committerdioexul <dioexul@gmail.com>2015-02-22 21:21:27 +0300
commit8a521b0283f45b8d1bf4e991c51f49e9ff3fc82f (patch)
tree236e7edf314e6c52c13c65839b642c163b273c3a /test.py
parent07155c2001580b0ec70b40f24a475baef6238aac (diff)
downloadpython-slugify-8a521b0283f45b8d1bf4e991c51f49e9ff3fc82f.tar.gz
Add parameter 'save_order'.
Diffstat (limited to 'test.py')
-rw-r--r--test.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/test.py b/test.py
index b1d4ca9..0dc89aa 100644
--- a/test.py
+++ b/test.py
@@ -80,5 +80,22 @@ class TestSequenceFunctions(unittest.TestCase):
r = slugify(txt)
self.assertEqual(r, "this-is-a-test")
+ txt = 'Тестирование полных слов без замены'
+ r = slugify(txt, max_length=20, word_boundary=True, save_order=False)
+ self.assertEqual(r, "testirovanie-polnykh")
+
+ txt = 'Тестирование полных слов без замены'
+ r = slugify(txt, max_length=19, word_boundary=True, save_order=False)
+ self.assertEqual(r, "testirovanie-slov")
+
+ txt = 'Тестирование полных слов без замены'
+ r = slugify(txt, max_length=20, word_boundary=True, save_order=True)
+ self.assertEqual(r, "testirovanie-polnykh")
+
+ txt = 'Тестирование полных слов без замены'
+ r = slugify(txt, max_length=19, word_boundary=True, save_order=True)
+ self.assertEqual(r, "testirovanie")
+
+
if __name__ == '__main__':
unittest.main() \ No newline at end of file