From d88fcb03e2e520da6a7d0203d660e4536108f56b Mon Sep 17 00:00:00 2001 From: Jessica Tallon Date: Fri, 17 Jul 2015 17:51:51 +0200 Subject: Change codebase to query or create correct User model The code base had many references to User.username and other specific to LocalUser attributes as that was the way it use to exist. This updates those to query on the generic User model but filtering by attributes on the LocalUser. --- mediagoblin/tests/test_basic_auth.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'mediagoblin/tests/test_basic_auth.py') diff --git a/mediagoblin/tests/test_basic_auth.py b/mediagoblin/tests/test_basic_auth.py index e7157bee..0d698a20 100644 --- a/mediagoblin/tests/test_basic_auth.py +++ b/mediagoblin/tests/test_basic_auth.py @@ -16,7 +16,7 @@ import six.moves.urllib.parse as urlparse -from mediagoblin.db.models import User +from mediagoblin.db.models import User, LocalUser from mediagoblin.plugins.basic_auth import tools as auth_tools from mediagoblin.tests.tools import fixture_add_user from mediagoblin.tools import template @@ -88,7 +88,7 @@ def test_change_password(test_app): assert urlparse.urlsplit(res.location)[2] == '/edit/account/' # test_user has to be fetched again in order to have the current values - test_user = User.query.filter_by(username=u'chris').first() + test_user = User.query.filter(LocalUser.username==u'chris').first() assert auth_tools.bcrypt_check_password('123456', test_user.pw_hash) # test that the password cannot be changed if the given @@ -100,5 +100,5 @@ def test_change_password(test_app): 'new_password': '098765', }) - test_user = User.query.filter_by(username=u'chris').first() + test_user = User.query.filter(LocalUser.username==u'chris').first() assert not auth_tools.bcrypt_check_password('098765', test_user.pw_hash) -- cgit v1.2.3