(self)
| 1983 | assert items[9].value == 'boolean' |
| 1984 | |
| 1985 | def test_edit_choices(self): |
| 1986 | field = serializers.ChoiceField( |
| 1987 | allow_null=True, |
| 1988 | choices=[ |
| 1989 | 1, 2, |
| 1990 | ] |
| 1991 | ) |
| 1992 | field.choices = [1] |
| 1993 | assert field.run_validation(1) == 1 |
| 1994 | with pytest.raises(serializers.ValidationError) as exc_info: |
| 1995 | field.run_validation(2) |
| 1996 | assert exc_info.value.detail == ['"2" is not a valid choice.'] |
| 1997 | |
| 1998 | def test_enum_integer_choices(self): |
| 1999 | from enum import IntEnum |
nothing calls this directly
no test coverage detected