added gen_password_hash and check_password functions to auth/__init__
This commit is contained in:
@@ -21,7 +21,7 @@ from mediagoblin import mg_globals
|
||||
from mediagoblin.db.models import User
|
||||
from mediagoblin.tests.tools import fixture_add_user
|
||||
from mediagoblin.tools import template
|
||||
from mediagoblin.plugins.basic_auth.lib import bcrypt_check_password
|
||||
from mediagoblin import auth
|
||||
|
||||
|
||||
class TestUserEdit(object):
|
||||
@@ -75,7 +75,7 @@ class TestUserEdit(object):
|
||||
|
||||
# test_user has to be fetched again in order to have the current values
|
||||
test_user = User.query.filter_by(username=u'chris').first()
|
||||
assert bcrypt_check_password('123456', test_user.pw_hash)
|
||||
assert auth.check_password('123456', test_user.pw_hash)
|
||||
# Update current user passwd
|
||||
self.user_password = '123456'
|
||||
|
||||
@@ -89,7 +89,7 @@ class TestUserEdit(object):
|
||||
})
|
||||
|
||||
test_user = User.query.filter_by(username=u'chris').first()
|
||||
assert not bcrypt_check_password('098765', test_user.pw_hash)
|
||||
assert not auth.check_password('098765', test_user.pw_hash)
|
||||
|
||||
|
||||
def test_change_bio_url(self, test_app):
|
||||
|
||||
Reference in New Issue
Block a user