By default a field must be included in the input.
(self)
| 132 | Tests for `required`, `allow_null`, `allow_blank`, `default`. |
| 133 | """ |
| 134 | def test_required(self): |
| 135 | """ |
| 136 | By default a field must be included in the input. |
| 137 | """ |
| 138 | field = serializers.IntegerField() |
| 139 | with pytest.raises(serializers.ValidationError) as exc_info: |
| 140 | field.run_validation() |
| 141 | assert exc_info.value.detail == ['This field is required.'] |
| 142 | |
| 143 | def test_not_required(self): |
| 144 | """ |
nothing calls this directly
no test coverage detected