forked from bread-and-pepper/django-userena
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
9 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ class UtilsTests(TestCase): | |
fixtures = ['users'] | ||
|
||
def test_get_gravatar(self): | ||
template = 'http://www.gravatar.com/avatar/%(hash)s?s=%(size)s&d=%(type)s' | ||
template = '//www.gravatar.com/avatar/%(hash)s?s=%(size)s&d=%(type)s' | ||
|
||
# The hash for [email protected] | ||
hash = hashlib.md5('[email protected]').hexdigest() | ||
|
@@ -42,18 +42,6 @@ def test_get_gravatar(self): | |
response = self.client.get(http_404) | ||
self.failUnlessEqual(response.status_code, 404) | ||
|
||
# Test the switch to HTTPS | ||
userena_settings.USERENA_MUGSHOT_GRAVATAR_SECURE = True | ||
|
||
template = 'https://secure.gravatar.com/avatar/%(hash)s?s=%(size)s&d=%(type)s' | ||
self.failUnlessEqual(get_gravatar('[email protected]'), | ||
template % {'hash': hash, | ||
'size': 80, | ||
'type': 'identicon'}) | ||
|
||
# And set back to default | ||
userena_settings.USERENA_MUGSHOT_GRAVATAR_SECURE = False | ||
|
||
def test_signin_redirect(self): | ||
""" | ||
Test redirect function which should redirect the user after a | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,7 +75,7 @@ def test_retry_activation_ask(self): | |
|
||
# We must reload the object from database to get the new key | ||
user = User.objects.get(email='[email protected]') | ||
self.assertContains(response, "Account re-activation succeded") | ||
self.assertContains(response, "Account re-activation succeeded") | ||
|
||
self.failIfEqual(old_key, user.userena_signup.activation_key) | ||
user = User.objects.get(email='[email protected]') | ||
|
@@ -129,6 +129,10 @@ def test_invalid_confirmation(self): | |
|
||
def test_disabled_view(self): | ||
""" A ``GET`` to the ``disabled`` view """ | ||
response = self.client.get(reverse('userena_disabled', | ||
kwargs={'username': 'john'})) | ||
self.assertEqual(response.status_code, 404) | ||
u = User.objects.filter(username='john').update(is_active=False) | ||
response = self.client.get(reverse('userena_disabled', | ||
kwargs={'username': 'john'})) | ||
self.assertEqual(response.status_code, 200) | ||
|