From 1d9387d8e53d789ac895e9cd605c4b152d0a8caa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristi=20V=C3=AEjdea?= Date: Wed, 12 Dec 2018 12:46:04 +0200 Subject: [PATCH] Fix test name description --- tests/test_form_parameters.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) 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):