def test_last_school_day_for_no_days(self): school_year = SchoolYearFactory(days_of_week=SchoolYear.NO_DAYS) sunday = datetime.date.today() + relativedelta(weekday=SU(-1)) week = Week(sunday) last_school_day = school_year.last_school_day_for(week) assert last_school_day == sunday
def test_last_school_day_for_week(self): school_year = SchoolYearFactory() monday = datetime.date.today() + relativedelta(weekday=MO(-1)) friday = monday + datetime.timedelta(days=4) week = Week(monday) last_school_day = school_year.last_school_day_for(week) assert last_school_day == friday