diff options
author | Aamir Khan <syst3m.w0rm@gmail.com> | 2012-08-10 19:05:04 +0530 |
---|---|---|
committer | Aamir Khan <syst3m.w0rm@gmail.com> | 2012-08-10 19:05:04 +0530 |
commit | 48e0b96e2c64bb44ec30e8cd039bd1db2ac20d66 (patch) | |
tree | ada7683aa1aa3efd6307ee90f67989264d733468 /hyperkitty | |
parent | b6c779f1f233649f1ad68cdbc976e2740542afde (diff) | |
download | hyperkitty-48e0b96e2c64bb44ec30e8cd039bd1db2ac20d66.tar.gz hyperkitty-48e0b96e2c64bb44ec30e8cd039bd1db2ac20d66.tar.xz hyperkitty-48e0b96e2c64bb44ec30e8cd039bd1db2ac20d66.zip |
Fix : Error importing unit tests
Diffstat (limited to 'hyperkitty')
-rw-r--r-- | hyperkitty/tests/__init__.py | 6 | ||||
-rw-r--r-- | hyperkitty/tests/test_views.py | 8 | ||||
-rw-r--r-- | hyperkitty/views/accounts.py | 11 |
3 files changed, 10 insertions, 15 deletions
diff --git a/hyperkitty/tests/__init__.py b/hyperkitty/tests/__init__.py index 4cf4941..bf3e6b6 100644 --- a/hyperkitty/tests/__init__.py +++ b/hyperkitty/tests/__init__.py @@ -19,6 +19,6 @@ # Author: Aamir Khan <syst3m.w0rm@gmail.com> # -from gsoc.tests.test_views import * -from gsoc.tests.test_models import * -from gsoc.tests.test_forms import * +from hyperkitty.tests.test_views import * +from hyperkitty.tests.test_models import * +from hyperkitty.tests.test_forms import * diff --git a/hyperkitty/tests/test_views.py b/hyperkitty/tests/test_views.py index b94ef43..649edaa 100644 --- a/hyperkitty/tests/test_views.py +++ b/hyperkitty/tests/test_views.py @@ -32,7 +32,7 @@ class AccountViewsTestCase(TestCase): def test_login(self): # Try to access user profile (private data) without logging in response = self.client.get(reverse('user_profile')) - self.assertRedirects(response, "%s?next=%s" % (reverse('user_login'),reverse('user_profile'))) + self.assertRedirects(response, "%s?next=%s" % (reverse('user_login'), reverse('user_profile'))) def test_profile(self): User.objects.create_user('testuser', 'syst3m.w0rm+test@gmail.com', 'testPass') @@ -64,9 +64,3 @@ class AccountViewsTestCase(TestCase): # @TODO: Try to register a user and verify its working - - - - - -
\ No newline at end of file diff --git a/hyperkitty/views/accounts.py b/hyperkitty/views/accounts.py index ab9bf26..4f3d96b 100644 --- a/hyperkitty/views/accounts.py +++ b/hyperkitty/views/accounts.py @@ -46,7 +46,7 @@ def user_logout(request): logout(request) return redirect('user_login') -def user_login(request,template = 'login.html'): +def user_login(request, template='login.html'): parse_r = urlparse(request.META.get('HTTP_REFERER', 'index')) previous = '%s%s' % (parse_r.path, parse_r.query) @@ -61,7 +61,7 @@ def user_login(request,template = 'login.html'): if user is not None: log('debug', user) if user.is_active: - login(request,user) + login(request, user) return redirect(next_var) else: @@ -70,9 +70,10 @@ def user_login(request,template = 'login.html'): context_instance=RequestContext(request)) @login_required -def user_profile(request, user_email = None): +def user_profile(request, user_email=None): if not request.user.is_authenticated(): return redirect('user_login') + # try to render the user profile. try: user_profile = request.user.get_profile() @@ -99,13 +100,13 @@ def user_registration(request): if form.is_valid(): # Save the user data. form.save(form.cleaned_data) - user = authenticate(username=form.cleaned_data['username'], + user = authenticate(username=form.cleaned_data['username'], password=form.cleaned_data['password1']) if user is not None: log('debug', user) if user.is_active: - login(request,user) + login(request, user) return redirect('index') else: form = RegistrationForm() |