Example #1
0
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()))
Example #2
0
 def test_prev_year_range(self):
     d = datetime(2010, 4, 16, 23, 3)
     start, end = utils.prev_year_range(d)
     self.assertEqual(datetime(2009, 1, 1), start)
     self.assertEqual(datetime(2009, 12, 31, 23, 59, 59, 999999), end)