コード例 #1
0
ファイル: test_models.py プロジェクト: sabrisay/homeschool
    def test_display_days(self):
        school_year = SchoolYearFactory.build()
        assert (school_year.display_days ==
                "Monday, Tuesday, Wednesday, Thursday, and Friday")

        school_year.days_of_week = SchoolYear.MONDAY + SchoolYear.TUESDAY
        assert school_year.display_days == "Monday and Tuesday"

        school_year.days_of_week = SchoolYear.MONDAY
        assert school_year.display_days == "Monday"

        school_year.days_of_week = SchoolYear.NO_DAYS
        assert school_year.display_days == ""
コード例 #2
0
ファイル: test_models.py プロジェクト: weiplanet/homeschool
    def test_display_days_abbreviated_no_days(self):
        school_year = SchoolYearFactory.build(days_of_week=SchoolYear.NO_DAYS)

        assert school_year.display_abbreviated_days == "Not Running"
コード例 #3
0
ファイル: test_models.py プロジェクト: weiplanet/homeschool
    def test_display_days_abbreviated(self):
        school_year = SchoolYearFactory.build(days_of_week=SchoolYear.ALL_DAYS)

        assert school_year.display_abbreviated_days == "SuMTWRFSa"
コード例 #4
0
ファイル: test_models.py プロジェクト: sabrisay/homeschool
    def test_display_days_abbreviated(self):
        school_year = SchoolYearFactory.build(
            days_of_week=sum(SchoolYear.WEEK))

        assert school_year.display_abbreviated_days == "MTWRFSaSu"