def total_ranges(): return ( ("prev_year", utils.prev_year_range()), ("this_year", utils.year_range()), ("prev_month", utils.prev_month_range()), ("this_month", utils.month_range()), ("prev_week", utils.prev_week_range()), ("this_week", utils.week_range()), ("this_day", utils.day_range()), ("prev_day", utils.prev_day_range()))
def test_prev_day_range(self): d = datetime(2010, 4, 16, 23, 3) start, end = utils.prev_day_range(d) self.assertEqual(datetime(2010, 4, 15), start) self.assertEqual(datetime(2010, 4, 15, 23, 59, 59, 999999), end)