summaryrefslogtreecommitdiff
path: root/tests/utils_tests/test_text.py
diff options
context:
space:
mode:
authorEdward Henderson <kutenai@me.com>2015-04-15 16:28:49 -0600
committerTim Graham <timograham@gmail.com>2015-07-17 13:48:58 -0400
commitf8cc464452f495fce2a3d6f7494396c8f798a1e6 (patch)
tree61049a8351e327b59c98341f98dacda0e8186be2 /tests/utils_tests/test_text.py
parentadffff79a36f7de30f438915c492e475e17025f6 (diff)
Fixed #16501 -- Added an allow_unicode parameter to SlugField.
Thanks Flavio Curella and Berker Peksag for the initial patch.
Diffstat (limited to 'tests/utils_tests/test_text.py')
-rw-r--r--tests/utils_tests/test_text.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/utils_tests/test_text.py b/tests/utils_tests/test_text.py
index d8675fa8c5..e6f5c0f378 100644
--- a/tests/utils_tests/test_text.py
+++ b/tests/utils_tests/test_text.py
@@ -172,11 +172,16 @@ class TestUtilsText(SimpleTestCase):
def test_slugify(self):
items = (
- ('Hello, World!', 'hello-world'),
- ('spam & eggs', 'spam-eggs'),
+ # given - expected - unicode?
+ ('Hello, World!', 'hello-world', False),
+ ('spam & eggs', 'spam-eggs', False),
+ ('spam & ıçüş', 'spam-ıçüş', True),
+ ('foo ıç bar', 'foo-ıç-bar', True),
+ (' foo ıç bar', 'foo-ıç-bar', True),
+ ('你好', '你好', True),
)
- for value, output in items:
- self.assertEqual(text.slugify(value), output)
+ for value, output, is_unicode in items:
+ self.assertEqual(text.slugify(value, allow_unicode=is_unicode), output)
def test_unescape_entities(self):
items = [