Beispiel #1
0
 def test_downvote_below_zero_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.")
     rager.register(anant)
     with self.assertRaises(ValueError):
         rager.downvote(anant)
Beispiel #2
0
 def test_downvote_decrements_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)
     self.assertEqual(rager.num_votes(anant), 0)
     rager.upvote(anant)
     self.assertEqual(rager.num_votes(anant), 1)
     rager.downvote(anant)
     self.assertEqual(rager.num_votes(anant), 0)