Esempio n. 1
0
    def setUp(self):
        ValidationRuleFactory(field_reference="reference_country.name",
                              status_field=DISABLED,
                              initial_value="LalaLand",
                              placeholder="")

        ValidationRuleFactory(field_reference="reference_country.iso_code",
                              status_field=REQUIRED,
                              initial_value="",
                              regex_rule="^(LA|LB)$",
                              placeholder="LA")

        ValidationRuleFactory(field_reference="reference_country.cref_code",
                              status_field=ALERT,
                              initial_value="LA",
                              regex_rule="^(LA|LB)$",
                              placeholder="")
Esempio n. 2
0
    def setUpTestData(cls):
        cls.master_type = EducationGroupTypeFactory(
            category=education_group_categories.TRAINING,
            name=education_group_types.TrainingType.MASTER_MA_120.name,
        )
        cls.finality_type = EducationGroupTypeFactory(
            category=education_group_categories.GROUP,
            name=education_group_types.GroupType.FINALITY_120_LIST_CHOICE.name,
            external_id="osis.education_group_type_finality120listchoice")
        cls.major_type = EducationGroupTypeFactory(
            category=education_group_categories.GROUP,
            name=education_group_types.GroupType.MAJOR_LIST_CHOICE.name,
            external_id="osis.education_group_type_majorlistchoice")

        cls.current_academic_year = create_current_academic_year()
        cls.next_academic_year = AcademicYearFactory(
            year=cls.current_academic_year.year + 1)

        cls.auth_rel = AuthorizedRelationshipFactory(
            parent_type=cls.master_type,
            child_type=cls.finality_type,
            min_count_authorized=1,
        )
        cls.validation_rule_title = ValidationRuleFactory(
            field_reference=
            "base_educationgroupyear.title.osis.education_group_type_finality120listchoice",
            initial_value="Liste au choix de Finalités",
        )
        cls.validation_rule_partial_acronym = ValidationRuleFactory(
            field_reference=
            "base_educationgroupyear.partial_acronym.osis.education_group_type_finality120listchoice",
            initial_value="400G",
        )

        cls.validation_rule_title_major = ValidationRuleFactory(
            field_reference=
            "base_educationgroupyear.title.osis.education_group_type_majorlistchoice",
            initial_value="Majeure",
        )
        cls.validation_rule_partial_acronym_major = ValidationRuleFactory(
            field_reference=
            "base_educationgroupyear.partial_acronym.osis.education_group_type_majorlistchoice",
            initial_value="200K",
        )