diff --git a/tests/test_value.py b/tests/test_value.py index aaffd99..4d0fe61 100644 --- a/tests/test_value.py +++ b/tests/test_value.py @@ -143,6 +143,26 @@ class LocalizedValueTestCase(TestCase): # there's no actual value assert localized_value.get(other_language) != test_value + @staticmethod + def test_str_fallback_custom_fallback(): + """Tests whether the :see:LocalizedValue class's + __str__'s fallback functionality properly respects + the LOCALIZED_FIELDS_FALLBACKS setting.""" + + test_value = 'myvalue' + + settings.LOCALIZED_FIELDS_FALLBACKS = { + 'nl': ['ro'] + } + + localized_value = LocalizedValue({ + settings.LANGUAGE_CODE: settings.LANGUAGE_CODE, + 'ro': 'ro' + }) + + with translation.override('nl'): + assert str(localized_value) == 'ro' + @staticmethod def test_deconstruct(): """Tests whether the :see:LocalizedValue