MCPcopy
hub / github.com/encode/django-rest-framework / run_validation

Method run_validation

rest_framework/fields.py:525–540  ·  view source on GitHub ↗

Validate a simple representation and return the internal value. The provided data may be `empty` if no representation was included in the input. May raise `SkipField` if the field should not be included in the validated data.

(self, data=empty)

Source from the content-addressed store, hash-verified

523 return (False, data)
524
525 def run_validation(self, data=empty):
526 """
527 Validate a simple representation and return the internal value.
528
529 The provided data may be `empty` if no representation was included
530 in the input.
531
532 May raise `SkipField` if the field should not be included in the
533 validated data.
534 """
535 (is_empty_value, data) = self.validate_empty_values(data)
536 if is_empty_value:
537 return data
538 value = self.to_internal_value(data)
539 self.run_validators(value)
540 return value
541
542 def run_validators(self, value):
543 """

Callers 15

test_requiredMethod · 0.45
test_not_requiredMethod · 0.45
test_disallow_nullMethod · 0.45
test_allow_nullMethod · 0.45
test_defaultMethod · 0.45
test_valid_inputsMethod · 0.45
test_invalid_inputsMethod · 0.45
test_allow_blankMethod · 0.45
test_allow_nullMethod · 0.45
test_edit_choicesMethod · 0.45

Calls 3

validate_empty_valuesMethod · 0.95
to_internal_valueMethod · 0.95
run_validatorsMethod · 0.95

Tested by 15

test_requiredMethod · 0.36
test_not_requiredMethod · 0.36
test_disallow_nullMethod · 0.36
test_allow_nullMethod · 0.36
test_defaultMethod · 0.36
test_valid_inputsMethod · 0.36
test_invalid_inputsMethod · 0.36
test_allow_blankMethod · 0.36
test_allow_nullMethod · 0.36
test_edit_choicesMethod · 0.36