mirror of
https://github.com/SectorLabs/django-localized-fields.git
synced 2025-10-29 18:18:57 +03:00
Added __eq__ operator to LocalizedValue
This commit is contained in:
@@ -100,6 +100,19 @@ class LocalizedValueTestCase(TestCase):
|
||||
translation.activate(language)
|
||||
assert str(localized_value) == value
|
||||
|
||||
@staticmethod
|
||||
def test_eq():
|
||||
"""Tests whether the __eq__ operator
|
||||
of :see:LocalizedValue works properly."""
|
||||
|
||||
a = LocalizedValue({'en': 'a', 'ar': 'b'})
|
||||
b = LocalizedValue({'en': 'a', 'ar': 'b'})
|
||||
|
||||
assert a == b
|
||||
|
||||
b.en = 'b'
|
||||
assert a != b
|
||||
|
||||
@staticmethod
|
||||
def test_str_fallback():
|
||||
"""Tests whether the :see:LocalizedValue
|
||||
|
||||
Reference in New Issue
Block a user