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 1
1
from django .conf import settings
2
- from django .db .utils import IntegrityError
3
2
from django .test import TestCase
4
3
from django .utils import translation
4
+ from django .db .utils import IntegrityError
5
5
6
- from localized_fields import LocalizedField , LocalizedFieldForm , LocalizedValue
6
+ from localized_fields import LocalizedField , LocalizedValue , LocalizedFieldForm
7
7
8
8
9
9
def get_init_values () -> dict :
@@ -141,6 +141,14 @@ def test_deconstruct():
141
141
142
142
assert args [0 ] == keys
143
143
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
+
144
152
145
153
class LocalizedFieldTestCase (TestCase ):
146
154
"""Tests the :see:LocalizedField class."""
You can’t perform that action at this time.
0 commit comments