aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/tests/test_auth.py
diff options
context:
space:
mode:
Diffstat (limited to 'mediagoblin/tests/test_auth.py')
-rw-r--r--mediagoblin/tests/test_auth.py16
1 files changed, 6 insertions, 10 deletions
diff --git a/mediagoblin/tests/test_auth.py b/mediagoblin/tests/test_auth.py
index 153c6e53..2faf0f25 100644
--- a/mediagoblin/tests/test_auth.py
+++ b/mediagoblin/tests/test_auth.py
@@ -20,7 +20,7 @@ import datetime
from nose.tools import assert_equal
from mediagoblin.auth import lib as auth_lib
-from mediagoblin.tests.tools import setup_fresh_app
+from mediagoblin.tests.tools import setup_fresh_app, fixture_add_user
from mediagoblin import mg_globals
from mediagoblin.tools import template, mail
@@ -280,16 +280,16 @@ def test_register_views(test_app):
template.clear_test_template_context()
response = test_app.get(
"/auth/forgot_password/verify/?userid=%s&token=total_bs" % unicode(
- new_user._id), status=400)
- assert response.status == '400 Bad Request'
+ new_user._id), status=404)
+ assert_equal(response.status, '404 Not Found')
## Try using an expired token to change password, shouldn't work
template.clear_test_template_context()
real_token_expiration = new_user['fp_token_expire']
new_user['fp_token_expire'] = datetime.datetime.now()
new_user.save()
- response = test_app.get("%s?%s" % (path, get_params), status=400)
- assert response.status == '400 Bad Request'
+ response = test_app.get("%s?%s" % (path, get_params), status=404)
+ assert_equal(response.status, '404 Not Found')
new_user['fp_token_expire'] = real_token_expiration
new_user.save()
@@ -332,11 +332,7 @@ def test_authentication_views(test_app):
Test logging in and logging out
"""
# Make a new user
- test_user = mg_globals.database.User()
- test_user['username'] = u'chris'
- test_user['email'] = u'chris@example.com'
- test_user['pw_hash'] = auth_lib.bcrypt_gen_password_hash('toast')
- test_user.save()
+ test_user = fixture_add_user(active_user=False)
# Get login
# ---------