Flake8 issues solved

This commit is contained in:
Bruno Freitas 2019-05-22 11:15:01 -03:00
parent aab8bf4740
commit ea1150b421
3 changed files with 8 additions and 6 deletions

View File

@ -216,5 +216,6 @@ class RegisterSerializer(serializers.Serializer):
class VerifyEmailSerializer(serializers.Serializer):
key = serializers.CharField()
class ResendVerificationEmailSerializer(serializers.Serializer):
email = serializers.EmailField()
email = serializers.EmailField()

View File

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

View File

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