def test_creation_learning_unit_component_class_with_different_year(self): learning_container = LearningContainer() learning_container_year = LearningContainerYear( title="Biology", acronym="LBIO1212", academic_year=self.current_academic_year, learning_container=learning_container) #Composant annualisé est associé à son composant et à son conteneur annualisé learning_component_year = LearningComponentYear( learning_container_year=learning_container_year, title="Cours magistral", acronym="/C", comment="TEST") #UE associée à un conteneur d'une année différente du composant learning_unit_year = LearningUnitYear( title="Biology", acronym="LBIO1212", academic_year=self.current_academic_year_different, learning_container_year=learning_container_year) #Association du conteneur et de son composant dont les années académiques diffèrent l'une de l'autre LearningUnitComponent(learning_component_year=learning_component_year, learning_unit_year=learning_unit_year) self.assertEqual(learning_component_year.learning_container_year, learning_unit_year.learning_container_year)
def test_get_entity_by_type(self): learning_cont_yr = LearningContainerYearFactory( academic_year=self.academic_year) entity_container_yr = EntityContainerYearFactory( learning_container_year=learning_cont_yr, type=entity_container_year_link_type. ADDITIONAL_REQUIREMENT_ENTITY_1) luy = LearningUnitYear(academic_year=self.academic_year, learning_container_year=learning_cont_yr) self.assertEqual( get_entity_by_type( luy, entity_container_year_link_type. ADDITIONAL_REQUIREMENT_ENTITY_1), entity_container_yr.entity) self.assertIsNone( get_entity_by_type( luy, entity_container_year_link_type. ADDITIONAL_REQUIREMENT_ENTITY_2))
def _create_learning_unit_year_partim(self, common_title, speicific_title): return LearningUnitYear( subtype=learning_unit_year_subtypes.PARTIM, specific_title=speicific_title, learning_container_year=LearningContainerYear(common_title=common_title) )