mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-08 06:14:47 +03:00
Fixed MappingField tests
This commit is contained in:
parent
34232b0199
commit
42dca62e77
|
@ -1132,21 +1132,21 @@ class TestMappingFieldWithIntKeys(FieldValues):
|
||||||
Valid and invalid values for `MappingField`.
|
Valid and invalid values for `MappingField`.
|
||||||
"""
|
"""
|
||||||
valid_inputs = {
|
valid_inputs = {
|
||||||
1: 'one',
|
|
||||||
2: 'two',
|
|
||||||
'three': 3,
|
|
||||||
'four': 4
|
|
||||||
}
|
|
||||||
invalid_inputs = {
|
|
||||||
5: ['"5" not found in "mapping" dict'],
|
|
||||||
'abc': ['"abc" not found in "mapping" dict']
|
|
||||||
}
|
|
||||||
outputs = {
|
|
||||||
'one': 1,
|
'one': 1,
|
||||||
'two': 2,
|
'two': 2,
|
||||||
3: 'three',
|
3: 'three',
|
||||||
4: 'four'
|
4: 'four'
|
||||||
}
|
}
|
||||||
|
invalid_inputs = {
|
||||||
|
5: ['"5" not found in "mapping" values'],
|
||||||
|
'abc': ['"abc" not found in "mapping" values']
|
||||||
|
}
|
||||||
|
outputs = {
|
||||||
|
1: 'one',
|
||||||
|
2: 'two',
|
||||||
|
'three': 3,
|
||||||
|
'four': 4
|
||||||
|
}
|
||||||
field = serializers.MappingField(
|
field = serializers.MappingField(
|
||||||
mapping={
|
mapping={
|
||||||
1: 'one',
|
1: 'one',
|
||||||
|
|
Loading…
Reference in New Issue
Block a user