mirror of
https://github.com/SectorLabs/django-localized-fields.git
synced 2025-06-27 22:03:21 +03:00
Added missing test for LocalizedValue __init__
This commit is contained in:
parent
9a976d5ec8
commit
d740d442b2
@ -1,9 +1,9 @@
|
||||
from django.conf import settings
|
||||
from django.db.utils import IntegrityError
|
||||
from django.test import TestCase
|
||||
from django.utils import translation
|
||||
from django.db.utils import IntegrityError
|
||||
|
||||
from localized_fields import LocalizedField, LocalizedFieldForm, LocalizedValue
|
||||
from localized_fields import LocalizedField, LocalizedValue, LocalizedFieldForm
|
||||
|
||||
|
||||
def get_init_values() -> dict:
|
||||
@ -141,6 +141,14 @@ class LocalizedValueTestCase(TestCase):
|
||||
|
||||
assert args[0] == keys
|
||||
|
||||
@staticmethod
|
||||
def test_construct_string():
|
||||
"""Tests whether the :see:LocalizedValue's constructor
|
||||
assumes the primary language when passing a single string."""
|
||||
|
||||
value = LocalizedValue('beer')
|
||||
assert value.get(settings.LANGUAGE_CODE) == 'beer'
|
||||
|
||||
|
||||
class LocalizedFieldTestCase(TestCase):
|
||||
"""Tests the :see:LocalizedField class."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user