Beispiel #1
0
 def test_date_range(self):
     """Given from_date and to_date, return a list of days."""
     from_date = '2018-01-02'
     to_date = '2018-01-04'
     days = ['2018-01-02', '2018-01-03', '2018-01-04']
     self.assertCountEqual(helpers.get_days(from_date, to_date), days)
     self.assertCountEqual(helpers.get_days(to_date, from_date), days)
Beispiel #2
0
 def test_date_range_same_day(self):
     """Given a same day range, return the one day range."""
     from_date = '2018-01-02'
     to_date = '2018-01-02'
     self.assertEqual(helpers.get_days(from_date, to_date), ['2018-01-02'])
Beispiel #3
0
 def test_date_range_invalid(self):
     """Given an invalid date, return None for the range."""
     from_date = '2018-01-02T23:00'
     to_date = '2018-01-04'
     self.assertEqual(helpers.get_days(from_date, to_date), None)