MCPcopy Index your code
hub / github.com/encode/django-rest-framework / test_invalid_inputs

Method test_invalid_inputs

tests/test_fields.py:664–672  ·  view source on GitHub ↗

Ensure that invalid values raise the expected validation error.

(self, *args)

Source from the content-addressed store, hash-verified

662 f'input value: {repr(input_value)}'
663
664 def test_invalid_inputs(self, *args):
665 """
666 Ensure that invalid values raise the expected validation error.
667 """
668 for input_value, expected_failure in get_items(self.invalid_inputs):
669 with pytest.raises(serializers.ValidationError) as exc_info:
670 self.field.run_validation(input_value)
671 assert exc_info.value.detail == expected_failure, \
672 f'input value: {repr(input_value)}'
673
674 def test_outputs(self, *args):
675 for output_value, expected_output in get_items(self.outputs):

Callers

nothing calls this directly

Calls 2

get_itemsFunction · 0.85
run_validationMethod · 0.45

Tested by

no test coverage detected