示例#1
0
    def setUpTestData(cls):
        cls.parent_type = EducationGroupTypeFactory()
        cls.child_type, cls.other_child_type = EducationGroupTypeFactory.create_batch(2)

        cls.parent_egy = EducationGroupYearFactory(education_group_type=cls.parent_type)
        cls.child_egy = EducationGroupYearFactory(education_group_type=cls.child_type)
        cls.new_link = GroupElementYearFactory.build(child_branch=cls.child_egy)
示例#2
0
    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])
示例#3
0
    def setUpTestData(cls):
        cls.trainings = EducationGroupTypeFactory.create_batch(2)
        cls.minitrainings = MiniTrainingEducationGroupTypeFactory.create_batch(
            3)
        cls.groups = GroupEducationGroupTypeFactory.create_batch(1)

        cls.url = reverse("education_group_type_autocomplete")
        cls.person = PersonFactory()
示例#4
0
    def setUpTestData(cls):
        cls.education_group_types = EducationGroupTypeFactory.create_batch(3)

        cls.parent_egy = EducationGroupYearFactory()

        cls.grp_type_1 = GroupElementYearFactory(
            parent=cls.parent_egy,
            child_branch__education_group_type=cls.education_group_types[0],
            child_branch__academic_year=cls.parent_egy.academic_year)
        GroupElementYearFactory.create_batch(
            2,
            parent=cls.parent_egy,
            child_branch__education_group_type=cls.education_group_types[1],
            child_branch__academic_year=cls.parent_egy.academic_year)
        cls.reference_group_element_year_children = GroupElementYearFactory(
            parent=cls.parent_egy,
            child_branch__education_group_type=cls.education_group_types[0],
            child_branch__academic_year=cls.parent_egy.academic_year,
            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],
            child_branch__academic_year=cls.
            reference_group_element_year_children.child_branch.academic_year)
        GroupElementYearFactory(
            parent=cls.reference_group_element_year_children.child_branch,
            child_branch__education_group_type=cls.education_group_types[2],
            child_branch__academic_year=cls.
            reference_group_element_year_children.child_branch.academic_year)

        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],
            child_branch__academic_year=cls.child.academic_year,
        )

        AuthorizedRelationshipFactory(
            parent_type=cls.parent_egy.education_group_type,
            child_type=cls.education_group_types[0],
            min_count_authorized=1,
            max_count_authorized=1)
        AuthorizedRelationshipFactory(
            parent_type=cls.parent_egy.education_group_type,
            child_type=cls.education_group_types[1],
            min_count_authorized=0,
            max_count_authorized=None)