Esempio n. 1
0
    def test_check_postponement_conflict_on_all_sections(self):
        # LEARNING CONTAINER YEAR - Title modified
        another_learning_container_year = _build_copy(
            self.learning_container_year)
        another_learning_container_year.academic_year = self.next_academic_year
        another_learning_container_year.common_title = "Title Modified"
        another_learning_container_year.save()

        # LEARNING UNIT YEAR - Modify specific title
        another_learning_unit_year = _build_copy(self.learning_unit_year)
        another_learning_unit_year.academic_year = self.next_academic_year
        another_learning_unit_year.learning_container_year = another_learning_container_year
        another_learning_unit_year.specific_title = "Specific title modified"
        another_learning_unit_year.save()

        # ENTITY - Same allocation but NOT same requirement entity
        allocation_entity = _build_copy(self.allocation_entity)
        allocation_entity.learning_container_year = another_learning_container_year
        allocation_entity.save()
        an_entity = EntityFactory()
        EntityVersionFactory(entity=an_entity,
                             parent=None,
                             end_date=None,
                             acronym="AREC")
        EntityContainerYearFactory(
            learning_container_year=another_learning_container_year,
            type=entity_container_year_link_type.REQUIREMENT_ENTITY,
            entity=an_entity)

        error_list = business_edition._check_postponement_conflict(
            self.learning_unit_year, another_learning_unit_year)
        self.assertIsInstance(error_list, list)
        self.assertEqual(len(error_list), 6)
Esempio n. 2
0
    def test_check_postponement_conflict_on_all_sections(self):
        # LEARNING CONTAINER YEAR - Title modified
        another_learning_container_year = _build_copy(
            self.learning_container_year)
        another_learning_container_year.academic_year = self.next_academic_year
        another_learning_container_year.common_title = "Title Modified"
        another_learning_container_year.save()

        # LEARNING UNIT YEAR - Modify specific title
        another_learning_unit_year = _build_copy(self.learning_unit_year)
        another_learning_unit_year.academic_year = self.next_academic_year
        another_learning_unit_year.learning_container_year = another_learning_container_year
        another_learning_unit_year.specific_title = "Specific title modified"
        another_learning_unit_year.save()

        an_entity = EntityFactory()
        EntityVersionFactory(entity=an_entity,
                             parent=None,
                             end_date=None,
                             acronym="AREC")
        another_learning_container_year.requirement_entity = an_entity
        another_learning_container_year.save()

        error_list = business_edition._check_postponement_conflict(
            self.learning_unit_year, another_learning_unit_year)
        self.assertIsInstance(error_list, list)
        self.assertEqual(len(error_list), 5)