예제 #1
0
    def test_runs_on_date(self):
        school_year = SchoolYearFactory(days_of_week=SchoolYear.MONDAY)
        monday = datetime.date(2020, 1, 20)
        tuesday = datetime.date(2020, 1, 21)

        assert school_year.runs_on(monday)
        assert not school_year.runs_on(tuesday)
예제 #2
0
    def test_days_of_week_default(self):
        school_year = SchoolYearFactory()

        self.assertTrue(school_year.runs_on(SchoolYear.MONDAY))
        self.assertTrue(school_year.runs_on(SchoolYear.TUESDAY))
        self.assertTrue(school_year.runs_on(SchoolYear.WEDNESDAY))
        self.assertTrue(school_year.runs_on(SchoolYear.THURSDAY))
        self.assertTrue(school_year.runs_on(SchoolYear.FRIDAY))
        self.assertFalse(school_year.runs_on(SchoolYear.SATURDAY))
        self.assertFalse(school_year.runs_on(SchoolYear.SUNDAY))
예제 #3
0
    def test_days_of_week_default(self):
        school_year = SchoolYearFactory()

        assert school_year.runs_on(SchoolYear.MONDAY)
        assert school_year.runs_on(SchoolYear.TUESDAY)
        assert school_year.runs_on(SchoolYear.WEDNESDAY)
        assert school_year.runs_on(SchoolYear.THURSDAY)
        assert school_year.runs_on(SchoolYear.FRIDAY)
        assert not school_year.runs_on(SchoolYear.SATURDAY)
        assert not school_year.runs_on(SchoolYear.SUNDAY)
예제 #4
0
    def test_runs_on(self):
        school_year = SchoolYearFactory(days_of_week=SchoolYear.MONDAY)

        assert school_year.runs_on(SchoolYear.MONDAY)
        assert not school_year.runs_on(SchoolYear.TUESDAY)
예제 #5
0
    def test_runs_on(self):
        school_year = SchoolYearFactory(days_of_week=SchoolYear.MONDAY)

        self.assertTrue(school_year.runs_on(SchoolYear.MONDAY))
        self.assertFalse(school_year.runs_on(SchoolYear.TUESDAY))