MCPcopy Index your code
hub / github.com/encode/django-rest-framework / test_allow_blank

Method test_allow_blank

tests/test_fields.py:1926–1939  ·  view source on GitHub ↗

If `allow_blank=True` then '' is a valid input.

(self)

Source from the content-addressed store, hash-verified

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 """

Callers

nothing calls this directly

Calls 1

run_validationMethod · 0.45

Tested by

no test coverage detected