Fix to_python not working with non-json values

This commit is contained in:
Swen Kooij
2017-05-25 18:11:58 +03:00
parent cff22855c2
commit 093a9d58f2
2 changed files with 20 additions and 4 deletions

View File

@@ -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