def setUpTestData(cls): cls.root = TrainingFactory( academic_year__current=True, education_group_type=EducationGroupTypeFactory( name=education_group_types.TrainingType.MASTER_MA_120.name)) cls.children_level_0 = GroupElementYearFactory.create_batch( 1, parent=cls.root, child_branch__education_group_type__group=True, child_branch__academic_year=cls.root.academic_year) cls.children_level_1 = GroupElementYearFactory.create_batch( 3, parent=cls.children_level_0[0].child_branch, child_branch__education_group_type__group=True, child_branch__academic_year=cls.root.academic_year) cls.children_level_2 = GroupElementYearFactory.create_batch( 1, parent=cls.children_level_1[0].child_branch, child_branch__education_group_type__group=True, child_branch__academic_year=cls.root.academic_year) cls.lu_children_level_2 = GroupElementYearChildLeafFactory.create_batch( 2, parent=cls.children_level_1[1].child_branch, child_leaf__academic_year=cls.root.academic_year) cls.lu_children_level_3 = GroupElementYearChildLeafFactory.create_batch( 2, parent=cls.children_level_2[0].child_branch, child_leaf__academic_year=cls.root.academic_year)
def setUpTestData(cls): cls.parent_egy = EducationGroupYearFactory() cls.education_group_types = EducationGroupTypeFactory.create_batch(3) GroupElementYearFactory.create_batch( 3, parent=cls.parent_egy, child_branch__education_group_type=cls.education_group_types[0]) GroupElementYearFactory.create_batch( 2, parent=cls.parent_egy, child_branch__education_group_type=cls.education_group_types[1]) GroupElementYearChildLeafFactory.create_batch(2, parent=cls.parent_egy) cls.reference_group_element_year_children = GroupElementYearFactory( parent=cls.parent_egy, child_branch__education_group_type=cls.education_group_types[0], link_type=LinkTypes.REFERENCE.name) GroupElementYearFactory.create_batch( 2, parent=cls.reference_group_element_year_children.child_branch, child_branch__education_group_type=cls.education_group_types[1]) GroupElementYearFactory( parent=cls.reference_group_element_year_children.child_branch, child_branch__education_group_type=cls.education_group_types[2]) cls.child = EducationGroupYearFactory( education_group_type=cls.education_group_types[0]) GroupElementYearFactory.create_batch( 2, parent=cls.child, child_branch__education_group_type=cls.education_group_types[2])
def setUpTestData(cls): cls.education_group_year = EducationGroupYearFactory() cls.child_leaves = GroupElementYearChildLeafFactory.create_batch( 2, parent=cls.education_group_year, is_mandatory=True) for node, acronym in zip( cls.child_leaves, ["LCORS124" + str(i) for i in range(0, len(cls.child_leaves))]): node.child_leaf.acronym = acronym node.child_leaf.save() cls.luy_children = [child.child_leaf for child in cls.child_leaves] cls.workbook_contains = \ EducationGroupYearLearningUnitsContainedToExcel(cls.education_group_year, CustomXlsForm({}))._to_workbook() cls.sheet_contains = cls.workbook_contains.worksheets[0] generator_container = GenerateContainer( cls.education_group_year.academic_year, cls.education_group_year.academic_year) cls.luy = generator_container.generated_container_years[ 0].learning_unit_year_full cls.lecturing_component = LecturingLearningComponentYearFactory( learning_unit_year=cls.luy) cls.practical_component = PracticalLearningComponentYearFactory( learning_unit_year=cls.luy) cls.person_1 = PersonFactory(last_name='Dupont', first_name="Marcel", email="*****@*****.**") cls.person_2 = PersonFactory(last_name='Marseillais', first_name="Pol", email="*****@*****.**") cls.tutor_1 = TutorFactory(person=cls.person_1) cls.tutor_2 = TutorFactory(person=cls.person_2) cls.attribution_1 = AttributionNewFactory( tutor=cls.tutor_1, learning_container_year=cls.luy.learning_container_year) cls.charge_lecturing = AttributionChargeNewFactory( attribution=cls.attribution_1, learning_component_year=cls.lecturing_component) cls.charge_practical = AttributionChargeNewFactory( attribution=cls.attribution_1, learning_component_year=cls.practical_component) cls.attribution_2 = AttributionNewFactory( tutor=cls.tutor_2, learning_container_year=cls.luy.learning_container_year) cls.charge_lecturing = AttributionChargeNewFactory( attribution=cls.attribution_2, learning_component_year=cls.lecturing_component) cls.charge_practical = AttributionChargeNewFactory( attribution=cls.attribution_2, learning_component_year=cls.practical_component) cls.gey = GroupElementYearChildLeafFactory(child_leaf=cls.luy)