def test_is_faculty_manager_case_cannot_modify_data_in_past(self): previous_year = self.current_academic_year.year - 1 training_in_past = TrainingFactory(academic_year__year=previous_year) common_in_past = EducationGroupYearCommonBachelorFactory(academic_year__year=previous_year) faculty_manager = FacultyManagerFactory() for education_group_year in [training_in_past, common_in_past]: perm = GeneralInformationPerms(faculty_manager.user, education_group_year) with self.assertRaises(PermissionDenied): perm._is_faculty_manager_eligible()
def test_is_faculty_manager_eligible(self): faculty_manager = FacultyManagerFactory() for education_group_year in [self.training, self.common_bachelor]: perm = GeneralInformationPerms(faculty_manager.user, education_group_year) self.assertTrue(perm._is_faculty_manager_eligible())