Пример #1
0
 def _end_year_permission_assert(self, a_person, luy):
     self.assertFalse(can_modify_end_year_by_proposal(luy, a_person, False))
     with self.assertRaises(PermissionDenied) as perm_ex:
         can_modify_end_year_by_proposal(luy, a_person, True)
     self.assertEqual(
         '{}'.format(perm_ex.exception),
         MSG_NOT_ELIGIBLE_TO_MODIFY_END_YEAR_PROPOSAL_ON_THIS_YEAR)
Пример #2
0
    def test_can_modify_end_year_by_proposal_n_year_plus_one(self):
        faculty_person = FacultyManagerFactory()
        lcy = LearningContainerYearFactory(
            academic_year=self.next_academic_yr,
            container_type=learning_container_year_types.COURSE)
        learning_unit_yr = LearningUnitYearFactory(
            academic_year=self.next_academic_yr,
            subtype=learning_unit_year_subtypes.FULL,
            learning_unit=LearningUnitFactory(),
            learning_container_year=lcy)

        self.assertTrue(
            can_modify_end_year_by_proposal(learning_unit_yr, faculty_person,
                                            True))
        central_person = CentralManagerFactory()
        self.assertTrue(
            can_modify_end_year_by_proposal(learning_unit_yr, central_person,
                                            True))
Пример #3
0
    def test_can_modify_end_year_by_proposal_undefined_group(self):
        faculty_no_faculty_no_central = PersonFactory()
        lcy = LearningContainerYearFactory(
            academic_year=self.previous_academic_year,
            container_type=learning_container_year_types.COURSE)
        learning_unit_yr = LearningUnitYearFactory(
            academic_year=self.previous_academic_year,
            subtype=learning_unit_year_subtypes.FULL,
            learning_unit=LearningUnitFactory(),
            learning_container_year=lcy)

        self.assertFalse(
            can_modify_end_year_by_proposal(learning_unit_yr,
                                            faculty_no_faculty_no_central,
                                            False))
Пример #4
0
    def test_can_modify_end_year_by_proposal_previous_n_year(self):
        faculty_person = FacultyManagerFactory()
        lcy = LearningContainerYearFactory(
            academic_year=self.previous_academic_year,
            container_type=learning_container_year_types.COURSE)
        learning_unit_yr = LearningUnitYearFactory(
            academic_year=self.previous_academic_year,
            subtype=learning_unit_year_subtypes.FULL,
            learning_unit=LearningUnitFactory(),
            learning_container_year=lcy)

        self._end_year_permission_assert(faculty_person, learning_unit_yr)
        central_person = CentralManagerFactory()
        self.assertFalse(
            can_modify_end_year_by_proposal(learning_unit_yr, central_person,
                                            False))