diff --git a/tests/test_localized_field.py b/tests/test_localized_field.py index 840a94b..313bca5 100644 --- a/tests/test_localized_field.py +++ b/tests/test_localized_field.py @@ -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."""