Exemple #1
0
    def test_is_current_academic_year_in_range_of_editable_education_group_year_case_in_range(self):
        """This test ensure that we modify OF which lower than N+1"""
        training_n1 = TrainingFactory(academic_year__year=self.current_academic_year.year + 1)
        training = TrainingFactory(academic_year=self.current_academic_year)

        for education_group_year in [training_n1, training]:
            perm = CommonEducationGroupStrategyPerms(self.person.user, education_group_year)
            self.assertTrue(perm._is_current_academic_year_in_range_of_editable_education_group_year())
Exemple #2
0
    def test_is_current_academic_year_in_range_of_editable_education_group_year_case_not_in_range(self):
        """This test ensure that we cannot modify OF which greater than N+1"""
        training_in_future = TrainingFactory(academic_year__year=self.current_academic_year.year + 2)

        perm = CommonEducationGroupStrategyPerms(self.person.user, training_in_future)
        self.assertFalse(perm._is_current_academic_year_in_range_of_editable_education_group_year())