diff --git a/run_tests b/run_tests index 12b1aa62..21793972 100755 --- a/run_tests +++ b/run_tests @@ -7,8 +7,8 @@ case $1 in umessages ) echo -e "\033[1mRunning tests for umessages.\033[0m" cmd="demo/manage.py test umessages" ;; - * ) echo -e "\033[1mRunning all tests.\033[0m" - cmd="demo/manage.py test userena umessages" + * ) echo -e "\033[1mRunning tests for userena.\033[0m" + cmd="demo/manage.py test userena" esac $cmd diff --git a/userena/tests/models.py b/userena/tests/models.py index 16c393fe..40e79b08 100644 --- a/userena/tests/models.py +++ b/userena/tests/models.py @@ -198,7 +198,7 @@ def test_get_mugshot_url_with_gravatar(self): Test if the correct mugshot is returned when the user makes use of gravatar. """ - template = 'http://www.gravatar.com/avatar/%(hash)s?s=%(size)s&d=%(default)s' + template = '//www.gravatar.com/avatar/%(hash)s?s=%(size)s&d=%(default)s' profile = Profile.objects.get(pk=1) gravatar_hash = hashlib.md5(profile.user.email).hexdigest() diff --git a/userena/tests/utils.py b/userena/tests/utils.py index 1d61e12b..29b0fadb 100644 --- a/userena/tests/utils.py +++ b/userena/tests/utils.py @@ -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 alice@example.com hash = hashlib.md5('alice@example.com').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('alice@example.com'), - 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 diff --git a/userena/tests/views.py b/userena/tests/views.py index 48104733..862ce43e 100644 --- a/userena/tests/views.py +++ b/userena/tests/views.py @@ -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='alice@example.com') - 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='alice@example.com') @@ -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)