# HG changeset patch # User Marcin Kuzminski # Date 2013-05-01 22:08:03 # Node ID e2ebd880835132cab3832d6eaf1bf6feb7d1ff1f # Parent 6bad83d27fc1d47b0c28d2c54d9ee59ef8e05213 fixed broken API tests after excluding default user from users listing diff --git a/rhodecode/tests/api/api_base.py b/rhodecode/tests/api/api_base.py --- a/rhodecode/tests/api/api_base.py +++ b/rhodecode/tests/api/api_base.py @@ -11,7 +11,7 @@ from rhodecode.model.users_group import from rhodecode.model.repo import RepoModel from rhodecode.model.meta import Session from rhodecode.model.scm import ScmModel -from rhodecode.model.db import Repository +from rhodecode.model.db import Repository, User API_URL = '/_admin/api' @@ -164,7 +164,9 @@ class BaseTestApi(object): id_, params = _build_data(self.apikey, 'get_users',) response = api_call(self, params) ret_all = [] - for usr in UserModel().get_all(): + _users = User.query().filter(User.username != User.DEFAULT_USER)\ + .order_by(User.username).all() + for usr in _users: ret = usr.get_api_data() ret_all.append(jsonify(ret)) expected = ret_all