mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #16501 -- Added an allow_unicode parameter to SlugField.
Thanks Flavio Curella and Berker Peksag for the initial patch.
This commit is contained in:
committed by
Tim Graham
parent
adffff79a3
commit
f8cc464452
@@ -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 = [
|
||||
|
||||
Reference in New Issue
Block a user