예제 #1
0
 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
예제 #2
0
 def test_not_active(self):
     self.make_game(start=self.tomorrow, end=self.late)
     active = Game.active()
     self.assertEqual(active, None)
예제 #3
0
 def test_active(self):
     game = self.make_game()
     active = Game.active()
     self.assertEqual(active, game)
예제 #4
0
 def test_not_active(self):
     self.make_game(start=self.tomorrow, end=self.late)
     active = Game.active()
     self.assertEqual(active, None)
예제 #5
0
 def test_active(self):
     game = self.make_game()
     active = Game.active()
     self.assertEqual(active, game)