def get_user(username): """ Get the information of a user from our userdatamodel database Returns a json object """ return jsonify(admin.get_user_info(current_session, username))
def test_get_user(db_session, awg_users): info = adm.get_user_info(db_session, "awg_user") assert info["name"] == "awg_user" assert info["role"] == "user" assert "test_group_1" in info["groups"] assert "test_group_2" in info["groups"] assert info["message"] == "" assert info["email"] == None assert info["certificates_uploaded"] == [] assert info["resources_granted"] == [] assert info["project_access"]["phs_project_1"] == ["read"] assert info["project_access"]["phs_project_2"] == ["read"]
def test_get_inexistent_user(db_session): with pytest.raises(NotFound): adm.get_user_info(db_session, "nonenone")