def test_get_oyc_by_reference_when_education_group_year_is_null(self): ac_cal = AcademicCalendarFactory(reference=academic_calendar_type.DELIBERATION) SessionExamCalendarFactory(academic_calendar=ac_cal) OfferYearCalendarFactory(academic_calendar=ac_cal, education_group_year=None) off_year_cal_expected = OfferYearCalendarFactory(academic_calendar=ac_cal, education_group_year=None) oyc = scores_encodings_deadline._get_oyc_by_reference(off_year_cal_expected, academic_calendar_type.DELIBERATION) self.assertEqual(oyc, off_year_cal_expected)
def test_get_oyc_by_reference_when_no_matching_result(self): ac_cal = AcademicCalendarFactory( reference=academic_calendar_type.DELIBERATION) SessionExamCalendarFactory(academic_calendar=ac_cal) off_year_cal = OfferYearCalendarFactory(academic_calendar=ac_cal) oyc = scores_encodings_deadline._get_oyc_by_reference( off_year_cal, academic_calendar_type.COURSE_ENROLLMENT) self.assertIsNone(oyc)
def test_get_oyc_by_reference_when_education_group_year_is_null(self): ac_cal = AcademicCalendarFactory(reference=academic_calendar_type.DELIBERATION) SessionExamCalendarFactory(academic_calendar=ac_cal) OfferYearCalendarFactory(academic_calendar=ac_cal, education_group_year=None) off_year_cal_expected = OfferYearCalendarFactory(academic_calendar=ac_cal, education_group_year=None) oyc = scores_encodings_deadline._get_oyc_by_reference(off_year_cal_expected, academic_calendar_type.DELIBERATION) self.assertEqual(oyc, off_year_cal_expected)
def test_get_oyc_by_reference_when_no_matching_result(self): ac_cal = AcademicCalendarFactory(reference=academic_calendar_type.DELIBERATION) SessionExamCalendarFactory(academic_calendar=ac_cal) off_year_cal = OfferYearCalendarFactory(academic_calendar=ac_cal) oyc = scores_encodings_deadline._get_oyc_by_reference(off_year_cal, academic_calendar_type.COURSE_ENROLLMENT) self.assertIsNone(oyc)