fix persona tests by using a correct query
authorRodney Ewing <ewing.rj@gmail.com>
Fri, 16 Aug 2013 00:36:56 +0000 (17:36 -0700)
committerRodney Ewing <ewing.rj@gmail.com>
Fri, 16 Aug 2013 00:36:56 +0000 (17:36 -0700)
mediagoblin/tests/test_persona.py

index 1d03ea7f70964cce78eaaa3116448a7f5d5aa5b6..ce795258030d772081b9be5b15b5f470a9f7a547 100644 (file)
@@ -108,13 +108,13 @@ class TestPersonaPlugin(object):
             persona_plugin_app.get('/auth/logout/')
 
             # Get user and detach from session
-            test_user = mg_globals.database.User.find_one({
-                'username': u'chris'})
+            test_user = mg_globals.database.User.query.filter_by(
+                username=u'chris').first()
             test_user.email_verified = True
             test_user.status = u'active'
             test_user.save()
-            test_user = mg_globals.database.User.find_one({
-                'username': u'chris'})
+            test_user = mg_globals.database.User.query.filter_by(
+                username=u'chris').first()
             Session.expunge(test_user)
 
             # Add another user for _test_edit_persona