def test_vote_unapproved_performer_raises_exception(self): rager = Performance("Nathan Trinkl's Birthday Bash", datetime.datetime(18, 3, 16, 9, 55)) anant = Performer("Anant Sahai", 94704, "I reenact animes.") anant.apply_to(rager) with self.assertRaises(ValueError): rager.upvote(anant)
def test_num_votes(self): rager = Performance("Nathan Trinkl's Birthday Bash", datetime.datetime(18, 3, 16, 9, 55)) anant = Performer("Anant Sahai", 94704, "I reenact animes.") anant.apply_to(rager) rager.approve(anant) rager.upvote(anant) self.assertEqual(rager.num_votes(anant), 1)
def test_performer(self): rager = Performance("Nathan Trinkl's Birthday Bash", datetime.datetime(18, 3, 16, 9, 55)) performer1 = Performer("Anant Sahai", 94704, "I reenact animes.") performer2 = Performer("Anant Sabai", 94704, "I reenact fiestas.") performer3 = Performer("Anant Sagai", 94704, "I reenact movies.") for performer in [performer1, performer2, performer3]: performer.apply_to(rager) rager.approve(performer) rager.upvote(performer2) self.assertEqual(rager.performer, performer2)