def test_is_service_course_pedagogical_exception(self): exception_entity = [ self._create_entity_version(entity_type=entity_type.SCHOOL, acronym=acronym) for acronym in PEDAGOGICAL_ENTITY_ADDED_EXCEPTIONS ] for entity in exception_entity: self.assertTrue( is_service_course(self.academic_yr, entity, self.list_entity_version[0]) )
def test_is_not_service_course(self): self.build_allocation_entity_in_fac_tree() form = learning_units.LearningUnitYearForm(data=self.get_valid_data()) self.assertTrue(form.is_valid()) found_learning_units = form.get_activity_learning_units() learning_unit = found_learning_units[0] requirement_entity_version = learning_unit.entities.get( entity_container_year_link_type.REQUIREMENT_ENTITY) learning_container_year = learning_unit.learning_container_year entity_parent = requirement_entity_version.find_parent_faculty_version( learning_container_year.academic_year) self.assertFalse( is_service_course(learning_unit.academic_year, requirement_entity_version, learning_container_year, entity_parent))
def test_is_not_service_course(self): self.assertFalse( is_service_course(self.academic_yr, self.list_entity_version[2], self.list_entity_version[3]) )
def test_is_service_course(self): self.assertTrue( is_service_course(self.academic_yr, self.list_entity_version[0], self.list_entity_version[1]) )