mirror of
https://github.com/SectorLabs/django-localized-fields.git
synced 2025-10-29 18:18:57 +03:00
Fix to_python not working with non-json values
This commit is contained in:
@@ -209,6 +209,14 @@ class LocalizedFieldTestCase(TestCase):
|
||||
for language, value in input_data.items():
|
||||
assert localized_value.get(language) == value
|
||||
|
||||
@staticmethod
|
||||
def test_to_python_non_json():
|
||||
"""Tests whether the :see:to_python function
|
||||
properly handles a string that is not JSON."""
|
||||
|
||||
localized_value = LocalizedField().to_python('my value')
|
||||
assert localized_value.get() == 'my value'
|
||||
|
||||
@staticmethod
|
||||
def test_to_python_none():
|
||||
"""Tests whether the :see:to_python function
|
||||
|
||||
Reference in New Issue
Block a user