def test_vote_remove_role(): vote = Voting.Vote(111, "Test Vote", 222, 333, db_manager) vote.add_role(777) vote.remove_role(777) assert 777 not in vote.target_roles in_db = db_manager.db_execute_select("SELECT * FROM VoteTargetRoles WHERE vote_id=? AND role_id=?", (111, 777)) assert not in_db
def test_vote_is_ready(): vote = Voting.Vote(111, "Test Vote", 222, 333, db_manager) vote.add_option(Voting.Option(111, "head", "body")) assert not vote.is_ready() vote.add_option(Voting.Option(122, "head", "body")) assert vote.is_ready()