def test_parse_week(): today = date(2013, day=22, month=3) this_week = dates.lastmonday(today) data = ( ('this week', this_week), ('last week', this_week - timedelta(7)), ('next week', this_week + timedelta(7)) ) for inp, out in data: res = dates.parse_week(inp, today=today) assert res == out, '{} : {} = {}'.format(inp, res, out)
def test_lm(): '''Test the lastmonday(datetime.date) function''' for inp, out in last_monday: res = dates.lastmonday(inp) assert res == out, '{} : {} = {}'.format(inp, res, out)