diff --git a/tests/test_form_parameters.py b/tests/test_form_parameters.py index b4d9aef..a7414aa 100644 --- a/tests/test_form_parameters.py +++ b/tests/test_form_parameters.py @@ -10,7 +10,12 @@ from drf_yasg.generators import OpenAPISchemaGenerator from drf_yasg.utils import swagger_auto_schema -def test_choice_field(): +def test_no_form_parameters_with_non_form_parsers(): + # see https://github.com/axnsan12/drf-yasg/issues/270 + # test that manual form parameters for views that haven't set + # all their parsers classes to form parsers are not allowed + # even when the request body is empty + @method_decorator(name='post', decorator=swagger_auto_schema( operation_description="Logins a user and returns a token", manual_parameters=[ @@ -21,13 +26,6 @@ def test_choice_field(): type=openapi.TYPE_STRING, description="Valid username or email for authentication" ), - openapi.Parameter( - "password", - openapi.IN_FORM, - required=True, - type=openapi.TYPE_STRING, - description="Valid password for authentication", - ), ] )) class CustomObtainAuthToken(ObtainAuthToken):