def testGetEventsByDate(self):
     alex_date = alex_date_from_key(2015010100)
     self.event_service.get_events_for_date(alex_date)
     self.event_dao.get_events_for_date.assert_called_with(alex_date)
 def test_get_nearest(self):
     date = alex_date_from_key(2015010100)
     self.event_service.get_nearest(date, None)
     self.event_dao.get_nearest.assert_called_once_with(date, None)
 def test_create_new(self):
     date_range = AlexDateRange(alex_date_from_key(2015010100), None)
     event = self.event_service.create_new(date_range)
     self.assertIsInstance(event, Event)
     self.assertEqual(event.daterange, date_range)
Ejemplo n.º 4
0
 def testCreateKeyComplete(self):
     input_key = 1940010507
     date = alex_date_from_key(input_key)
     output_key = date.as_key(7)
     self.assertEqual(input_key, output_key)
Ejemplo n.º 5
0
 def testCreateKeyYearAndMonth(self):
     input_key = 1940010007
     date = alex_date_from_key(input_key)
     output_key = date.as_key(7)
     self.assertEqual(input_key, output_key)
Ejemplo n.º 6
0
 def testDateComplete(self):
     date = alex_date_from_key(1940053007)
     self.assertEqual(date.year, 1940)
     self.assertEqual(date.month, 5)
     self.assertEqual(date.day, 30)
Ejemplo n.º 7
0
 def testDateYearAndMonth(self):
     date = alex_date_from_key(1940010007)
     self.assertEqual(date.year, 1940)
     self.assertEqual(date.month, 1)
     self.assertEqual(date.day, None)
Ejemplo n.º 8
0
 def testDateJustYear(self):
     date = alex_date_from_key(1940000007)
     self.assertEqual(date.year, 1940)
     self.assertEqual(date.month, None)
     self.assertEqual(date.day, None)