By default `None` is not a valid input.
(self)
| 149 | field.run_validation() |
| 150 | |
| 151 | def test_disallow_null(self): |
| 152 | """ |
| 153 | By default `None` is not a valid input. |
| 154 | """ |
| 155 | field = serializers.IntegerField() |
| 156 | with pytest.raises(serializers.ValidationError) as exc_info: |
| 157 | field.run_validation(None) |
| 158 | assert exc_info.value.detail == ['This field may not be null.'] |
| 159 | |
| 160 | def test_allow_null(self): |
| 161 | """ |
nothing calls this directly
no test coverage detected