def test_that_it_produces_a_sequence_of_weekly_time_periods(self): range = WEEK.range(d_tz(2013, 4, 1), d_tz(2013, 4, 15)) assert_that(list(range), contains( (d_tz(2013, 4, 1), d_tz(2013, 4, 8)), (d_tz(2013, 4, 8), d_tz(2013, 4, 15)) ))
def test_that_it_expands_the_limits_of_the_range_if_midweek(self): range = WEEK.range(d_tz(2013, 4, 3), d_tz(2013, 4, 19)) assert_that(list(range), contains( (d_tz(2013, 4, 1), d_tz(2013, 4, 8)), (d_tz(2013, 4, 8), d_tz(2013, 4, 15)), (d_tz(2013, 4, 15), d_tz(2013, 4, 22)) ))