Here's a little snippet that'll entertain the vast throngs of people who are interested in both Rock Paper Scissors strategy and Django unit testing.
def test_desperate_futility_of_avalanche(self):
for futile_attempt in range(100):
Round.objects.create(game=self.normal_game,
initiator_choice=self.rock,
opponent_choice=self.rock)
self.failUnlessEqual(self.normal_game.result(), UNRESOLVED)
for futile_attempt in range(100):
Round.objects.create(game=self.normal_game,
initiator_choice=self.rock,
opponent_choice=self.rock)
self.failUnlessEqual(self.normal_game.result(), UNRESOLVED)
1 thought on “Django TestCase Comedy”