mirror of
https://github.com/SectorLabs/django-localized-fields.git
synced 2025-10-29 18:18:57 +03:00
Add LocalizedValue.is_empty()
This commit is contained in:
@@ -38,6 +38,17 @@ class LocalizedValueTestCase(TestCase):
|
||||
for lang_code, _ in settings.LANGUAGES:
|
||||
assert getattr(value, lang_code) is None
|
||||
|
||||
@staticmethod
|
||||
def test_is_empty():
|
||||
"""Tests whether a newly constructed :see:LocalizedValue without any
|
||||
content is considered "empty"."""
|
||||
|
||||
value = LocalizedValue()
|
||||
assert value.is_empty()
|
||||
|
||||
value.set(settings.LANGUAGE_CODE, "my value")
|
||||
assert not value.is_empty()
|
||||
|
||||
@staticmethod
|
||||
def test_init_array():
|
||||
"""Tests whether the __init__ function of :see:LocalizedValue properly
|
||||
|
||||
Reference in New Issue
Block a user