mirror of
https://github.com/SectorLabs/django-localized-fields.git
synced 2025-04-25 11:42:54 +03:00
Add test that confirms slug is re-computed when value changes
This commit is contained in:
parent
3ce57ed4cc
commit
32696f4e1e
@ -81,6 +81,14 @@ class LocalizedSlugFieldTestCase(TestCase):
|
|||||||
assert old_slug_en == obj.slug.en
|
assert old_slug_en == obj.slug.en
|
||||||
assert old_slug_nl != obj.slug.nl
|
assert old_slug_nl != obj.slug.nl
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def test_unique_slug_update(cls):
|
||||||
|
obj = cls.Model.objects.create(title={settings.LANGUAGE_CODE: 'mytitle'})
|
||||||
|
assert obj.slug.get() == 'mytitle'
|
||||||
|
obj.title.set(settings.LANGUAGE_CODE, 'othertitle')
|
||||||
|
obj.save()
|
||||||
|
assert obj.slug.get() == 'othertitle'
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def test_unique_slug_unique_max_retries(cls):
|
def test_unique_slug_unique_max_retries(cls):
|
||||||
"""Tests whether the unique slug implementation doesn't
|
"""Tests whether the unique slug implementation doesn't
|
||||||
|
Loading…
x
Reference in New Issue
Block a user