def test_votes_delete(self): options = ["1", "2", "3"] poll = Poll(13, "TestTitle", options) poll.vote("Wilma", "1") poll.vote("Fred", "2") poll.delete_voted_options("Fred") self.assertEqual(poll.get_winners(), ["1"])
def test_already_voted(self): options = ["1", "2", "3"] poll = Poll(13, "TestTitle", options) poll.vote("Wilma", "1") self.assertRaises(UserAlreadyVotedException, poll.vote, "Wilma", "1")
def test_single_vote(self): options = ["1", "2", "3"] poll = Poll(13, "TestTitle", options) poll.vote("Wilma", "1") self.assertEqual(poll.get_winners(), ["1"])