diff options
author | Jessica Tallon <tsyesika@tsyesika.se> | 2015-07-17 17:51:51 +0200 |
---|---|---|
committer | Jessica Tallon <tsyesika@tsyesika.se> | 2015-07-31 15:15:24 +0200 |
commit | d88fcb03e2e520da6a7d0203d660e4536108f56b (patch) | |
tree | 75b751fae15a037301bb384e64eba13746cb57a6 /mediagoblin/tests/test_ldap.py | |
parent | 283e6d8b9f09341e3b97418b79f389bfdfee6498 (diff) | |
download | mediagoblin-d88fcb03e2e520da6a7d0203d660e4536108f56b.tar.lz mediagoblin-d88fcb03e2e520da6a7d0203d660e4536108f56b.tar.xz mediagoblin-d88fcb03e2e520da6a7d0203d660e4536108f56b.zip |
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.
Diffstat (limited to 'mediagoblin/tests/test_ldap.py')
-rw-r--r-- | mediagoblin/tests/test_ldap.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mediagoblin/tests/test_ldap.py b/mediagoblin/tests/test_ldap.py index f251d150..827864fa 100644 --- a/mediagoblin/tests/test_ldap.py +++ b/mediagoblin/tests/test_ldap.py @@ -26,6 +26,7 @@ import six.moves.urllib.parse as urlparse from mediagoblin import mg_globals from mediagoblin.db.base import Session +from mediagoblin.db.models import LocalUser from mediagoblin.tests.tools import get_app from mediagoblin.tools import template @@ -114,8 +115,9 @@ def test_ldap_plugin(ldap_plugin_app): ldap_plugin_app.get('/auth/logout/') # Get user and detach from session - test_user = mg_globals.database.User.query.filter_by( - username=u'chris').first() + test_user = mg_globals.database.User.query.filter( + LocalUser.username==u'chris' + ).first() Session.expunge(test_user) # Log back in |