mirror of
https://github.com/SectorLabs/django-localized-fields.git
synced 2025-12-14 15:52:25 +03:00
Started work on LocalizedMagicSlugField
This will be a superior version of LocalizedAutoSlugField, but one that doesn't have concurrency issues and takes advantage of the new UNIQUE CONSTRAINTs.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from django.test import TestCase
|
||||
|
||||
from localized_fields import LocalizedValue
|
||||
from localized_fields import LocalizedField, LocalizedValue
|
||||
|
||||
from .fake_model import get_fake_model
|
||||
|
||||
@@ -16,7 +16,12 @@ class LocalizedModelTestCase(TestCase):
|
||||
|
||||
super(LocalizedModelTestCase, cls).setUpClass()
|
||||
|
||||
cls.TestModel = get_fake_model()
|
||||
cls.TestModel = get_fake_model(
|
||||
'LocalizedModelTestCase',
|
||||
{
|
||||
'title': LocalizedField()
|
||||
}
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def test_defaults(cls):
|
||||
@@ -46,4 +51,4 @@ class LocalizedModelTestCase(TestCase):
|
||||
assert isinstance(obj.title, LocalizedValue)
|
||||
assert obj.title.en == 'english_title'
|
||||
assert obj.title.ro == 'romanian_title'
|
||||
assert obj.title.nl == 'dutch_title'
|
||||
assert obj.title.nl == 'dutch_title'
|
||||
|
||||
Reference in New Issue
Block a user