Exemplo n.º 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()))
Exemplo n.º 2
0
 def test_prev_week_range(self):
     d = datetime(2010, 4, 16, 23, 3)
     start, end = utils.prev_week_range(d)
     self.assertEqual(datetime(2010, 4, 4), start)
     self.assertEqual(datetime(2010, 4, 10, 23, 59, 59, 999999), end)