From ea1150b421596f62d63c47b98052f78258388c84 Mon Sep 17 00:00:00 2001 From: Bruno Freitas Date: Wed, 22 May 2019 11:15:01 -0300 Subject: [PATCH] Flake8 issues solved --- rest_auth/registration/serializers.py | 3 ++- rest_auth/registration/views.py | 3 ++- rest_auth/tests/test_api.py | 8 ++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/rest_auth/registration/serializers.py b/rest_auth/registration/serializers.py index 5033177..9513a1d 100644 --- a/rest_auth/registration/serializers.py +++ b/rest_auth/registration/serializers.py @@ -216,5 +216,6 @@ class RegisterSerializer(serializers.Serializer): class VerifyEmailSerializer(serializers.Serializer): key = serializers.CharField() + class ResendVerificationEmailSerializer(serializers.Serializer): - email = serializers.EmailField() \ No newline at end of file + email = serializers.EmailField() diff --git a/rest_auth/registration/views.py b/rest_auth/registration/views.py index 3bcd64b..c30afb2 100644 --- a/rest_auth/registration/views.py +++ b/rest_auth/registration/views.py @@ -104,7 +104,7 @@ class ResendVerificationEmailView(GenericAPIView): serializer_class = ResendVerificationEmailSerializer permission_classes = (AllowAny,) allowed_methods = ('POST', 'OPTIONS', 'HEAD') - + def post(self, request, *args, **kwargs): serializer = self.get_serializer(data=request.data) serializer.is_valid(raise_exception=True) @@ -118,6 +118,7 @@ class ResendVerificationEmailView(GenericAPIView): return Response({'detail': _('Verification e-mail sent.')}) + class SocialLoginView(LoginView): """ class used for social authentications diff --git a/rest_auth/tests/test_api.py b/rest_auth/tests/test_api.py index 590b8b1..235fe0f 100644 --- a/rest_auth/tests/test_api.py +++ b/rest_auth/tests/test_api.py @@ -520,8 +520,8 @@ class APIBasicTests(TestsMixin, TestCase): self.get(self.logout_url, status_code=status.HTTP_405_METHOD_NOT_ALLOWED) @override_settings(ACCOUNT_EMAIL_VERIFICATION='mandatory') - def test_resend_account_verification_email(self): - result = self.post( + def test_resend_account_verification_email(self): + self.post( self.register_url, data=self.REGISTRATION_DATA_WITH_EMAIL, status_code=status.HTTP_201_CREATED @@ -544,7 +544,7 @@ class APIBasicTests(TestsMixin, TestCase): @override_settings(ACCOUNT_EMAIL_VERIFICATION='mandatory') def test_resend_not_registered_account_verification_email(self): self.assertEqual(EmailAddress.objects.count(), 0) - + self.post( reverse('rest_resend_verification_email'), data={ @@ -557,7 +557,7 @@ class APIBasicTests(TestsMixin, TestCase): @override_settings(ACCOUNT_EMAIL_VERIFICATION='mandatory') def test_resend_already_verified_account_verification_email(self): - result = self.post( + self.post( self.register_url, data=self.REGISTRATION_DATA_WITH_EMAIL, status_code=status.HTTP_201_CREATED