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)
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)
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)
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")