def get_game(self):
     year = int(self.kwargs.get('year', 0))
     month = int(self.kwargs.get('month', 0))
     if not year:
         game = Game.active()           
     else:
         date = datetime.datetime(year=year, month=month, day=15)
         game = Game.active(now=date)
     if game is None:
         game = Game.objects.latest()
     return game
Exemple #2
0
 def test_not_active(self):
     self.make_game(start=self.tomorrow, end=self.late)
     active = Game.active()
     self.assertEqual(active, None)
Exemple #3
0
 def test_active(self):
     game = self.make_game()
     active = Game.active()
     self.assertEqual(active, game)
Exemple #4
0
 def test_not_active(self):
     self.make_game(start=self.tomorrow, end=self.late)
     active = Game.active()
     self.assertEqual(active, None)
Exemple #5
0
 def test_active(self):
     game = self.make_game()
     active = Game.active()
     self.assertEqual(active, game)