mirror of
https://github.com/SectorLabs/django-localized-fields.git
synced 2025-04-25 11:42:54 +03:00
Format with black
This commit is contained in:
parent
a9a5add303
commit
905bfd4353
@ -105,7 +105,7 @@ class LocalizedIntegerField(LocalizedField):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _convert_localized_value(
|
def _convert_localized_value(
|
||||||
value: LocalizedValue
|
value: LocalizedValue,
|
||||||
) -> LocalizedIntegerValue:
|
) -> LocalizedIntegerValue:
|
||||||
"""Converts from :see:LocalizedValue to :see:LocalizedIntegerValue."""
|
"""Converts from :see:LocalizedValue to :see:LocalizedIntegerValue."""
|
||||||
|
|
||||||
|
@ -198,15 +198,15 @@ class LocalizedIntegerFieldTestCase(TestCase):
|
|||||||
assert obj.score.get(settings.LANGUAGE_CODE) == 75
|
assert obj.score.get(settings.LANGUAGE_CODE) == 75
|
||||||
|
|
||||||
def test_callable_default_value(self):
|
def test_callable_default_value(self):
|
||||||
output = {'en': 5}
|
output = {"en": 5}
|
||||||
|
|
||||||
def func():
|
def func():
|
||||||
return output
|
return output
|
||||||
|
|
||||||
model = get_fake_model({"test": LocalizedIntegerValue(default=func)})
|
model = get_fake_model({"test": LocalizedIntegerValue(default=func)})
|
||||||
obj = model()
|
obj = model.objects.create()
|
||||||
|
|
||||||
assert obj.test['en'] == output['en']
|
assert obj.test["en"] == output["en"]
|
||||||
|
|
||||||
def test_order_by(self):
|
def test_order_by(self):
|
||||||
"""Tests whether ordering by a :see:LocalizedIntegerField key works
|
"""Tests whether ordering by a :see:LocalizedIntegerField key works
|
||||||
@ -237,4 +237,3 @@ class LocalizedIntegerFieldTestCase(TestCase):
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
assert res == [1331, 982, 382]
|
assert res == [1331, 982, 382]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user