From ef91fcc029fb25c7abc6c4feec3285a7f7390d12 Mon Sep 17 00:00:00 2001 From: carol15022 Date: Tue, 13 Jan 2015 14:59:09 -0200 Subject: [PATCH] Applyied flake8 in test and view of signup. --- colab/accounts/tests/test_view_signup.py | 8 ++++---- colab/accounts/views.py | 14 ++++++++------ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/colab/accounts/tests/test_view_signup.py b/colab/accounts/tests/test_view_signup.py index 186ae70..f445144 100644 --- a/colab/accounts/tests/test_view_signup.py +++ b/colab/accounts/tests/test_view_signup.py @@ -4,7 +4,8 @@ This test related with accounts/views.py """ from django.test import TestCase, Client -from colab.accounts.models import User +from colab.accounts.models import User + class TestSignUpView(TestCase): @@ -17,7 +18,7 @@ class TestSignUpView(TestCase): def create_user_django(self): user = User.objects.create_user("USERtestCoLaB", - "usertest@colab.com.br", "123colab4") + "usertest@colab.com.br", "123colab4") return user def test_user_authenticated_and_unregistered(self): @@ -38,7 +39,6 @@ class TestSignUpView(TestCase): def test_user_not_authenticated(self): response = self.client.get("/account/register/") - self.assertEquals(302 , response.status_code) + self.assertEquals(302, response.status_code) url = "http://testserver/account/login" self.assertEquals(url, response.url) - diff --git a/colab/accounts/views.py b/colab/accounts/views.py index 448d576..c21bcc8 100644 --- a/colab/accounts/views.py +++ b/colab/accounts/views.py @@ -123,11 +123,11 @@ class UserProfileDetailView(UserProfileBaseMixin, DetailView): def signup(request): - # TODO: Refactor - user = request.user + # TODO: Refactor + user = request.user # If the user is not authenticated in Persona, and try to access url - # /account/register/ then he will be redirected to login page. + # /account/register/ then he will be redirected to login page. if not user.is_authenticated(): return redirect('login') @@ -137,7 +137,7 @@ def signup(request): if not user.needs_update: return redirect('user_profile', username=user.username) - # If the user is authenticated in Persona, but not in the Colab then he + # If the user is authenticated in Persona, but not in the Colab then he # will be redirected to the register form. if request.method == 'GET': user_form = UserCreationForm() @@ -159,7 +159,8 @@ def signup(request): # Check if the user's email have been used previously # in the mainling lists to link the user to old messages - email_addr, created = EmailAddress.objects.get_or_create(address=user.email) + email_addr, created = EmailAddress.objects.get_or_create( + address=user.email) if created: email_addr.real_name = user.get_full_name() @@ -219,7 +220,8 @@ class ManageUserSubscriptionsView(UserProfileBaseMixin, DetailView): context.update(kwargs) - return super(ManageUserSubscriptionsView, self).get_context_data(**context) + return super(ManageUserSubscriptionsView, + self).get_context_data(**context) class ChangeXMPPPasswordView(UpdateView): -- libgit2 0.21.2