mirror of
https://github.com/SectorLabs/django-localized-fields.git
synced 2025-10-29 18:18:57 +03:00
Merge remote-tracking branch 'beer/model_inheritance_free'
# Conflicts: # localized_fields/fields/localized_field.py # localized_fields/models.py # tests/fake_model.py
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
from django.db import connection, migrations
|
||||
from django.db import models
|
||||
from django.db.migrations.executor import MigrationExecutor
|
||||
from django.contrib.postgres.operations import HStoreExtension
|
||||
|
||||
from localized_fields.models import LocalizedModel
|
||||
from localized_fields import AtomicSlugRetryMixin
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ def define_fake_model(name='TestModel', fields=None):
|
||||
|
||||
if fields:
|
||||
attributes.update(fields)
|
||||
model = type(name, (AtomicSlugRetryMixin,LocalizedModel,), attributes)
|
||||
model = type(name, (AtomicSlugRetryMixin, models.Model), attributes)
|
||||
|
||||
return model
|
||||
|
||||
|
||||
@@ -172,7 +172,7 @@ class LocalizedFieldTestCase(TestCase):
|
||||
produces the expected :see:LocalizedValue."""
|
||||
|
||||
input_data = get_init_values()
|
||||
localized_value = LocalizedField.from_db_value(input_data)
|
||||
localized_value = LocalizedField().from_db_value(input_data)
|
||||
|
||||
for lang_code, _ in settings.LANGUAGES:
|
||||
assert getattr(localized_value, lang_code) == input_data[lang_code]
|
||||
@@ -182,7 +182,7 @@ class LocalizedFieldTestCase(TestCase):
|
||||
"""Tests whether the :see:from_db_value function
|
||||
correctly handles None values."""
|
||||
|
||||
localized_value = LocalizedField.from_db_value(None)
|
||||
localized_value = LocalizedField().from_db_value(None)
|
||||
|
||||
for lang_code, _ in settings.LANGUAGES:
|
||||
assert localized_value.get(lang_code) is None
|
||||
|
||||
Reference in New Issue
Block a user