mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-28 00:49:49 +03:00
add format for decimal
This commit is contained in:
parent
cfd876ad1b
commit
40de7e2fa4
|
@ -94,10 +94,10 @@ class TestFieldMapping(TestCase):
|
|||
inspector = AutoSchema()
|
||||
field = serializers.ListField(
|
||||
child=serializers.ChoiceField(choices=[(Decimal('1.111'), 'one'), (Decimal('2.222'), 'two')]))
|
||||
mapping = {'items': {'enum': [Decimal('1.111'), Decimal('2.222')], 'type': 'number'}, 'type': 'array'}
|
||||
mapping = {'type': 'array', 'items': {
|
||||
'enum': [Decimal('1.111'), Decimal('2.222')], 'type': 'number', 'format': 'decimal'}}
|
||||
assert inspector._map_field(field) == mapping
|
||||
|
||||
|
||||
def test_lazy_string_field(self):
|
||||
class ItemSerializer(serializers.Serializer):
|
||||
text = serializers.CharField(help_text=_('lazy string'))
|
||||
|
|
Loading…
Reference in New Issue
Block a user