File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 11from django .conf import settings
2- from django .db .utils import IntegrityError
32from django .test import TestCase
43from django .utils import translation
4+ from django .db .utils import IntegrityError
55
6- from localized_fields import LocalizedField , LocalizedFieldForm , LocalizedValue
6+ from localized_fields import LocalizedField , LocalizedValue , LocalizedFieldForm
77
88
99def get_init_values () -> dict :
@@ -141,6 +141,14 @@ def test_deconstruct():
141141
142142 assert args [0 ] == keys
143143
144+ @staticmethod
145+ def test_construct_string ():
146+ """Tests whether the :see:LocalizedValue's constructor
147+ assumes the primary language when passing a single string."""
148+
149+ value = LocalizedValue ('beer' )
150+ assert value .get (settings .LANGUAGE_CODE ) == 'beer'
151+
144152
145153class LocalizedFieldTestCase (TestCase ):
146154 """Tests the :see:LocalizedField class."""
You can’t perform that action at this time.
0 commit comments