Exemplo n.º 1
0
 def test_ffill_weeks(self):
     today = reduce_by_week(timezone.now())
     another_week = today + timedelta(days=14)
     groups = {reduce_by_week(another_week): 5, today: 10}
     filled = ffill(groups, by="W")
     eq_(len(filled), 3)
Exemplo n.º 2
0
 def test_ffill_days(self):
     today = timezone.now().date()
     last_week = today - timedelta(days=6)
     groups = {last_week: 5, today: 10}
     filled = ffill(groups, by="d")
     eq_(len(filled), 7)
Exemplo n.º 3
0
 def test_ffill_months(self):
     today = reduce_by_month(timezone.now())
     last_year = today.replace(year=today.year - 1)
     groups = {last_year: 5, today: 10}
     filled = ffill(groups, by="M")
     eq_(len(filled), 13)
Exemplo n.º 4
0
 def test_ffill_notimplemented(self):
     today = reduce_by_week(timezone.now())
     another_week = today + timedelta(days=14)
     groups = {reduce_by_week(another_week): 5, today: 10}
     ffill(groups, by="XYZ")