def delete_group(groupname): """ Retrieve the information regarding the buckets created within a project. Returns a json object. """ response = jsonify(admin.delete_group(current_session, groupname)) return response
def test_delete_group_updates_user_projects(db_session, awg_users, awg_groups, oauth_client): user = db_session.query(User).filter_by(username="******").first() user_projects = { db_session.query(Project).filter_by(id=item.project_id).first().name for item in db_session.query(AccessPrivilege).filter_by( user_id=user.id).all() if item.project_id != None } expected_projects = {"test_project_1", "test_project_2"} assert expected_projects == user_projects adm.delete_group(db_session, "test_group_2") user_projects = { db_session.query(Project).filter_by(id=item.project_id).first().name for item in db_session.query(AccessPrivilege).filter_by( user_id=user.id).all() if item.project_id != None } expected_projects = {"test_project_1"} assert expected_projects == user_projects
def test_delete_group(db_session, awg_groups): group = db_session.query(Group).filter_by(name="test_group_4").first() assert group.name == "test_group_4" adm.delete_group(db_session, "test_group_4") group = db_session.query(Group).filter_by(name="test_group_4").first() assert group == None