def test_eliminate_candidate_function(self): '''Test Ballot.eliminate_candidate()''' first_candidate_ballot_1 = self.a_to_c_ballot.next_candidate() Ballot.eliminate_candidate(first_candidate_ballot_1) second_candidate_ballot_1 = self.a_to_c_ballot.next_candidate() second_candidate_ballot_2 = self.a_to_k_ballot.next_candidate self.assertTrue(first_candidate_ballot_1 != second_candidate_ballot_2) self.assertTrue(second_candidate_ballot_1, second_candidate_ballot_2)
def test_eliminate_candidates_from_ballot_box(self): '''Test that the ballot box is able to eliminate candidates properly''' Ballot.eliminate_candidate('Aditya') for ballot in self.ballot_box_1.ballots: self.assertTrue('Aditya' in ballot.eliminated_candidates)