Fixed slugs not being generated for unicode texts

This commit is contained in:
Swen Kooij
2017-01-26 01:18:46 +02:00
parent c01edc80f0
commit fc31e1e5f1
2 changed files with 17 additions and 1 deletions

View File

@@ -59,6 +59,17 @@ class LocalizedAutoSlugFieldTestCase(TestCase):
assert another_obj.slug.en == 'title-1'
def test_unique_slug_utf(self):
"""Tests whether generating a slug works
when the value consists completely out
of non-ASCII characters."""
obj = self.TestModel()
obj.title.en = 'مكاتب للايجار بشارع بورسعيد'
obj.save()
assert obj.slug.en == 'مكاتب-للايجار-بشارع-بورسعيد'
@staticmethod
def test_deconstruct():
"""Tests whether the :see:deconstruct