If `allow_blank=True` then '' is a valid input.
(self)
| 1924 | ) |
| 1925 | |
| 1926 | def test_allow_blank(self): |
| 1927 | """ |
| 1928 | If `allow_blank=True` then '' is a valid input. |
| 1929 | """ |
| 1930 | field = serializers.ChoiceField( |
| 1931 | allow_blank=True, |
| 1932 | choices=[ |
| 1933 | ('poor', 'Poor quality'), |
| 1934 | ('medium', 'Medium quality'), |
| 1935 | ('good', 'Good quality'), |
| 1936 | ] |
| 1937 | ) |
| 1938 | output = field.run_validation('') |
| 1939 | assert output == '' |
| 1940 | |
| 1941 | def test_allow_null(self): |
| 1942 | """ |
nothing calls this directly
no test coverage detected