Category: Comedy
Django TestCase Comedy
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)
I will thoughtfully respond to all spam comments on this post
My Incredible New Web Property
Through the magic of statistical analysis, I have created a mostly-correct am-i-jogging-in-the-near-future detector.
Behold!