mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-29 13:04:03 +03:00
Merge pull request #5409 from rpkilby/fieldvalues-output
Add value repr to the assertion output in FieldValues tests
This commit is contained in:
commit
a560a49d56
|
@ -533,7 +533,8 @@ class FieldValues:
|
||||||
Ensure that valid values return the expected validated data.
|
Ensure that valid values return the expected validated data.
|
||||||
"""
|
"""
|
||||||
for input_value, expected_output in get_items(self.valid_inputs):
|
for input_value, expected_output in get_items(self.valid_inputs):
|
||||||
assert self.field.run_validation(input_value) == expected_output
|
assert self.field.run_validation(input_value) == expected_output, \
|
||||||
|
'input value: {}'.format(repr(input_value))
|
||||||
|
|
||||||
def test_invalid_inputs(self):
|
def test_invalid_inputs(self):
|
||||||
"""
|
"""
|
||||||
|
@ -542,11 +543,13 @@ class FieldValues:
|
||||||
for input_value, expected_failure in get_items(self.invalid_inputs):
|
for input_value, expected_failure in get_items(self.invalid_inputs):
|
||||||
with pytest.raises(serializers.ValidationError) as exc_info:
|
with pytest.raises(serializers.ValidationError) as exc_info:
|
||||||
self.field.run_validation(input_value)
|
self.field.run_validation(input_value)
|
||||||
assert exc_info.value.detail == expected_failure
|
assert exc_info.value.detail == expected_failure, \
|
||||||
|
'input value: {}'.format(repr(input_value))
|
||||||
|
|
||||||
def test_outputs(self):
|
def test_outputs(self):
|
||||||
for output_value, expected_output in get_items(self.outputs):
|
for output_value, expected_output in get_items(self.outputs):
|
||||||
assert self.field.to_representation(output_value) == expected_output
|
assert self.field.to_representation(output_value) == expected_output, \
|
||||||
|
'output value: {}'.format(repr(output_value))
|
||||||
|
|
||||||
|
|
||||||
# Boolean types...
|
# Boolean types...
|
||||||
|
|
Loading…
Reference in New Issue
Block a user