def setUpTestData(cls):
     cls.person_information = ContinuingEducationPersonFactory()
     cls.citizenship = CountryFactory()
     ed = EducationGroupFactory()
     EducationGroupYearFactory(
         education_group=ed,
         academic_year=create_current_academic_year()
     )
     cls.formation = ContinuingEducationTrainingFactory(education_group=ed)
     cls.admission = AdmissionFactory(
         citizenship=cls.citizenship,
         person_information=cls.person_information,
         formation=cls.formation
     )
     url = reverse(
         'continuing_education_api_v1:admission-detail-update',
         kwargs={'uuid': cls.admission.uuid}
     )
     cls.serializer = AdmissionPostSerializer(cls.admission, context={'request': RequestFactory().get(url)})
 def test_get_new_course_enrollment_calendar(self):
     academic_year = AcademicYearFactory(year=2017)
     education_group_yr = EducationGroupYearFactory(
         academic_year=academic_year,
         weighting=True,
         default_learning_unit_enrollment=False,
     )
     form = AdditionalInfoForm(
         {
             "weighting": False,
             "default_learning_unit_enrollment": True,
         },
         instance=education_group_yr)
     form.save()
     updated_education_group_yr = EducationGroupYear.objects.get(
         pk=education_group_yr.pk)
     self.assertFalse(updated_education_group_yr.weighting)
     self.assertTrue(
         updated_education_group_yr.default_learning_unit_enrollment)
Esempio n. 3
0
    def test_save_text_of_conditions_personalized_access(
            self, mock_set_admission):
        item = {
            'info': {
                'texts': {
                    'personalized_access': {
                        'text': 'Personalized Access'
                    }
                }
            }
        }
        education_group_year = EducationGroupYearFactory()
        admission_condition = AdmissionCondition.objects.create(
            education_group_year=education_group_year)
        self.command.save_text_of_conditions(admission_condition, item)

        mock_set_admission.assert_called_with(admission_condition,
                                              'personalized_access',
                                              'Personalized Access')
Esempio n. 4
0
    def setUpTestData(cls):
        cls.parent_education_group_year = EducationGroupYearFactory()

        cls.test_categories = [
            education_group_categories.GROUP,
            education_group_categories.TRAINING,
            education_group_categories.MINI_TRAINING,
        ]

        cls.education_group_types = [
            EducationGroupTypeFactory(category=category)
            for category in cls.test_categories
        ]

        cls.urls_without_parent_by_category = {
            education_group_type.category:
            reverse("new_education_group",
                    kwargs={
                        "category": education_group_type.category,
                        "education_group_type_pk": education_group_type.pk,
                    })
            for education_group_type in cls.education_group_types
        }
        cls.urls_with_parent_by_category = {
            education_group_type.category:
            reverse("new_education_group",
                    kwargs={
                        "category": education_group_type.category,
                        "education_group_type_pk": education_group_type.pk,
                        "parent_id": cls.parent_education_group_year.id,
                    })
            for education_group_type in cls.education_group_types
        }

        cls.expected_templates_by_category = {
            education_group_categories.GROUP:
            "education_group/create_groups.html",
            education_group_categories.TRAINING:
            "education_group/create_trainings.html",
            education_group_categories.MINI_TRAINING:
            "education_group/create_mini_trainings.html",
        }
        cls.person = PersonFactory()
Esempio n. 5
0
    def test_save_with_postponement_error(self):
        EducationGroupYearFactory(
            academic_year=self.list_acs[4],
            education_group=self.education_group_year.education_group,
            duration=100)

        form = TrainingForm(self.data,
                            instance=self.education_group_year,
                            user=self.user)
        self.assertTrue(form.is_valid(), form.errors)
        form.save()

        self.assertEqual(len(form.education_group_year_postponed), 5)

        egs = EducationGroupYear.objects.filter(
            education_group=self.education_group_year.education_group)

        self.assertEqual(egs.count(), 7)
        self.assertGreater(len(form.warnings), 0)
Esempio n. 6
0
    def setUp(self):
        self.education_group = EducationGroupFactory()
        self.education_group_year = EducationGroupYearFactory(
            education_group=self.education_group)
        self.person = PersonFactory()
        PersonEntityFactory(person=self.person,
                            entity=self.education_group_year.management_entity)
        self.url = reverse(
            'delete_education_group',
            args=[self.education_group_year.id, self.education_group_year.id])

        self.person.user.user_permissions.add(
            Permission.objects.get(codename="delete_educationgroup"))
        self.client.force_login(user=self.person.user)

        self.academic_calendar = AcademicCalendarFactory(
            reference=EDUCATION_GROUP_EDITION,
            start_date=timezone.now(),
            end_date=timezone.now())
Esempio n. 7
0
    def setUp(self):
        # Create small entities
        self.entity = EntityFactory(organization__type=organization_type.MAIN)
        self.entity_version = EntityVersionFactory(
            entity=self.entity, entity_type=entity_type.SECTOR)

        self.education_group_year = EducationGroupYearFactory(
            management_entity=self.entity,
            administration_entity=self.entity,
            academic_year=self.current_academic_year)
        # Create a group language
        EducationGroupLanguageFactory(
            education_group_year=self.education_group_year)

        # Create two secondary domains
        EducationGroupYearDomainFactory(
            education_group_year=self.education_group_year)
        EducationGroupYearDomainFactory(
            education_group_year=self.education_group_year)
Esempio n. 8
0
    def test_case_one_egy_one_parent_no_entity_on_child(self):
        education_group_year_child = EducationGroupYearFactory(
            academic_year=self.academic_year)
        education_group_year_parent = EducationGroupYearFactory(
            academic_year=self.academic_year)
        GroupElementYearFactory(parent=education_group_year_parent,
                                child_branch=education_group_year_child)
        education_group_year_child.management_entity = None
        education_group_year_child.save()

        self.assertEquals(
            get_education_group_year_eligible_management_entities(
                education_group_year_child),
            [education_group_year_parent.management_entity])
Esempio n. 9
0
    def setUpTestData(cls):
        cls.manager = ContinuingEducationManagerFactory()
        cls.training_manager = ContinuingEducationTrainingManagerFactory()
        cls.academic_year = create_current_academic_year()
        cls.education_group = EducationGroupFactory()
        EducationGroupYearFactory(education_group=cls.education_group,
                                  academic_year=cls.academic_year)
        cls.formation = ContinuingEducationTrainingFactory(
            education_group=cls.education_group)
        cls.registrations_to_validate = [
            AdmissionFactory(
                state=admission_state_choices.REGISTRATION_SUBMITTED,
                formation=cls.formation) for _ in range(2)
        ]
        cls.registration_not_to_validate = AdmissionFactory(
            state=admission_state_choices.DRAFT,
            diploma_produced=True,
            formation=cls.formation)

        cls.diplomas_to_produce = [
            AdmissionFactory(
                state=admission_state_choices.VALIDATED,
                diploma_produced=False,
                formation=cls.formation,
                ucl_registration_complete=True,
                payment_complete=True,
                assessment_succeeded=True,
            ) for _ in range(2)
        ]
        cls.no_diploma_to_produce_because_waiting = AdmissionFactory(
            state=admission_state_choices.WAITING,
            diploma_produced=True,
            formation=cls.formation)
        cls.admissions_to_accept = [
            AdmissionFactory(state=random.choice([
                admission_state_choices.SUBMITTED,
                admission_state_choices.WAITING
            ]),
                             formation=cls.formation) for _ in range(2)
        ]
        cls.admission_not_to_accept = AdmissionFactory(
            state=admission_state_choices.DRAFT, formation=cls.formation)
Esempio n. 10
0
    def setUp(self):
        today = datetime.date.today()
        # academic year 1
        self.start_date_ay_1 = today.replace(year=today.year - 3)
        self.end_date_ay_1 = today.replace(year=today.year - 2)
        academic_year_1 = AcademicYearFactory.build(
            start_date=self.start_date_ay_1,
            end_date=self.end_date_ay_1,
            year=today.year - 3)
        academic_year_1.save()
        # academic year 1
        self.start_date_ay_2 = today.replace(year=today.year - 2)
        self.end_date_ay_2 = today.replace(year=today.year - 1)
        academic_year_2 = AcademicYearFactory.build(
            start_date=self.start_date_ay_2,
            end_date=self.end_date_ay_2,
            year=today.year - 2)
        academic_year_2.save()
        self.an_education_group = EducationGroupFactory()

        # education group year for acy 1
        self.education_group_year_acy1_1 = EducationGroupYearFactory(
            education_group=self.an_education_group,
            academic_year=academic_year_1)

        # mandates
        self.mandate_secretary = MandateFactory(
            education_group=self.an_education_group,
            function=mandate_types.SECRETARY)
        self.mandate_president = MandateFactory(
            education_group=self.an_education_group,
            function=mandate_types.PRESIDENT)

        # Mandataries during academic year 1 period
        self.mandatary_secretary_egy1 = MandataryFactory(
            mandate=self.mandate_secretary,
            start_date=self.start_date_ay_1,
            end_date=self.end_date_ay_1)
        self.mandatary_president_egy1 = MandataryFactory(
            mandate=self.mandate_president,
            start_date=self.start_date_ay_1,
            end_date=self.end_date_ay_1)
    def setUpTestData(cls):
        cls.student = PersonWithPermissionsFactory('view_admission', 'change_received_file_state',
                                                   groups=[STUDENT_WORKERS_GROUP])
        cls.admission = AdmissionFactory()

        cls.academic_year = AcademicYearFactory(year=2018)
        cls.education_group = EducationGroupFactory()
        EducationGroupYearFactory(
            education_group=cls.education_group,
            academic_year=cls.academic_year,
        )
        cls.formation = ContinuingEducationTrainingFactory(
            education_group=cls.education_group,
            active=True
        )
        cls.training_manager = PersonWithPermissionsFactory(
            'view_admission',
            'change_admission',
            employee=True, groups=['continuing_education_training_managers']
        )
    def setUpTestData(cls):
        GroupFactory(name='continuing_education_managers')
        cls.academic_year = create_current_academic_year()
        cls.education_group = EducationGroupFactory()
        cls.user = UserFactory()
        EducationGroupYearFactory(education_group=cls.education_group,
                                  academic_year=cls.academic_year)
        cls.admission = AdmissionFactory(
            person_information=ContinuingEducationPersonFactory(
                person=PersonFactory(user=cls.user)),
            formation=ContinuingEducationTrainingFactory(
                education_group=cls.education_group),
            state=random.choice([ACCEPTED, REGISTRATION_SUBMITTED, VALIDATED]))

        cls.url = reverse(
            'continuing_education_api_v1:registration-detail-update',
            kwargs={'uuid': cls.admission.uuid})
        cls.invalid_url = reverse(
            'continuing_education_api_v1:registration-detail-update',
            kwargs={'uuid': uuid.uuid4()})
Esempio n. 13
0
    def setUp(self):
        self.parent_education_group_year = EducationGroupYearFactory()

        self.test_categories = [
            education_group_categories.GROUP,
            education_group_categories.TRAINING,
            education_group_categories.MINI_TRAINING,
        ]

        self.education_group_types = [
            EducationGroupTypeFactory(category=category)
            for category in self.test_categories
        ]

        self.person = PersonFactory()

        self.client.force_login(self.person.user)
        self.perm_patcher = mock.patch("base.business.education_groups.perms._is_eligible_to_add_education_group",
                                       return_value=True)
        self.mocked_perm = self.perm_patcher.start()
 def setUpTestData(cls):
     cls.academic_year = create_current_academic_year()
     cls.education_group = EducationGroupFactory()
     EducationGroupYearFactory(
         education_group=cls.education_group,
         academic_year=cls.academic_year
     )
     formation = ContinuingEducationTrainingFactory(
         education_group=cls.education_group
     )
     cls.prospect = ProspectFactory(formation=formation)
     cls.user = UserFactory()
     cls.url = reverse(
         'continuing_education_api_v1:prospect-detail-update',
         kwargs={'uuid': cls.prospect.uuid}
     )
     cls.invalid_url = reverse(
         'continuing_education_api_v1:prospect-detail-update',
         kwargs={'uuid': uuid.uuid4()}
     )
Esempio n. 15
0
    def test_clean_with_validation_error_in_date(self):
        education_group_yr = EducationGroupYearFactory(
            academic_year=self.academic_year)
        AcademicCalendarFactory(
            reference=academic_calendar_type.COURSE_ENROLLMENT,
            academic_year=self.academic_year)

        exam_enrollment_start = '20/12/{}'.format(self.academic_year.year)
        exam_enrollment_end = '15/01/{}'.format(self.academic_year.year)

        form = CourseEnrollmentForm(data={
            "range_date":
            exam_enrollment_start + ' - ' + exam_enrollment_end
        },
                                    instance=None,
                                    education_group_yr=education_group_yr)
        form.is_valid()
        self.assertEqual(
            form.errors["range_date"][0],
            _('The start date must be equals or lower than the end date'))
Esempio n. 16
0
 def setUpTestData(cls):
     cls.academic_year = create_current_academic_year()
     cls.education_group = EducationGroupFactory()
     EducationGroupYearFactory(
         education_group=cls.education_group,
         academic_year=cls.academic_year
     )
     cls.formation = ContinuingEducationTrainingFactory(
         education_group=cls.education_group
     )
     cls.rejected_admission_other = AdmissionFactory(
         state=REJECTED,
         state_reason=ANY_REASON,
         formation=cls.formation
     )
     cls.rejected_admission_not_other = AdmissionFactory(
         state=REJECTED,
         state_reason=NOT_ENOUGH_EXPERIENCE,
         formation=cls.formation
     )
Esempio n. 17
0
    def test_load_admission_conditions_common(self):
        item = {
            "year": 2018,
            "2m.alert_message": "Test",
            "2m.introduction": "IntroTest"
        }
        self.command.json_content = item
        academic_year = AcademicYearFactory(year=2018)
        education_group_year_common = EducationGroupYearFactory(
            academic_year=academic_year, acronym='common-2m')
        self.command.load_admission_conditions_common()

        common = EducationGroupYear.objects.filter(
            academic_year=education_group_year_common.academic_year,
            acronym='common-2m').first()

        admission_condition = AdmissionCondition.objects.get(
            education_group_year=common)
        self.assertEqual(admission_condition.text_alert_message,
                         item['2m.alert_message'])
 def setUpTestData(cls):
     cls.academic_year = AcademicYearFactory(year=2018)
     cls.education_group = EducationGroupFactory()
     EducationGroupYearFactory(
         education_group=cls.education_group,
         academic_year=cls.academic_year
     )
     cls.formation = ContinuingEducationTrainingFactory(
         education_group=cls.education_group
     )
     group = GroupFactory(name='continuing_education_managers')
     cls.manager = PersonWithPermissionsFactory('view_admission', 'change_admission')
     cls.manager.user.groups.add(group)
     cls.admission = AdmissionFactory(
         formation=cls.formation,
         state=SUBMITTED
     )
     cls.admission_file = AdmissionFileFactory(
         admission=cls.admission
     )
Esempio n. 19
0
 def setUpTestData(cls):
     cls.academic_year = create_current_academic_year()
     cls.education_group = EducationGroupFactory()
     EducationGroupYearFactory(education_group=cls.education_group,
                               academic_year=cls.academic_year)
     cls.formation = ContinuingEducationTrainingFactory(
         education_group=cls.education_group, registration_required=False)
     cls.manager = PersonWithPermissionsFactory('view_admission',
                                                'change_admission',
                                                groups=[MANAGERS_GROUP])
     cls.student_worker = PersonWithPermissionsFactory(
         'view_admission', groups=[STUDENT_WORKERS_GROUP])
     EntityVersionFactory(entity=cls.formation.management_entity)
     a_person_information = ContinuingEducationPersonFactory(
         person__gender='M')
     cls.admission = AdmissionFactory(
         formation=cls.formation,
         state=SUBMITTED,
         person_information=a_person_information,
     )
Esempio n. 20
0
    def setUp(self):
        academic_year = AcademicYearFactory()
        self.education_group_type_training = EducationGroupTypeFactory(
            category=education_group_categories.TRAINING)

        self.education_group_type_minitraining = EducationGroupTypeFactory(
            category=education_group_categories.MINI_TRAINING)

        self.education_group_type_group = EducationGroupTypeFactory(
            category=education_group_categories.GROUP)

        self.education_group_year_1 = EducationGroupYearFactory(
            academic_year=academic_year,
            education_group_type=self.education_group_type_training)
        self.education_group_year_2 = EducationGroupYearFactory(
            academic_year=academic_year,
            education_group_type=self.education_group_type_minitraining)

        self.education_group_year_3 = EducationGroupYearFactory(
            academic_year=academic_year,
            education_group_type=self.education_group_type_training)
        self.education_group_year_4 = EducationGroupYearFactory(
            academic_year=academic_year,
            education_group_type=self.education_group_type_group)
        self.education_group_year_5 = EducationGroupYearFactory(
            academic_year=academic_year,
            education_group_type=self.education_group_type_group)

        self.educ_group_year_domain = EducationGroupYearDomainFactory(
            education_group_year=self.education_group_year_2)

        self.entity_version_admin = EntityVersionFactory(
            entity=self.education_group_year_2.administration_entity,
            start_date=self.education_group_year_2.academic_year.start_date,
            parent=None)

        self.offer_year_3 = OfferYearFactory(academic_year=academic_year)

        self.entity_version_management = EntityVersionFactory(
            entity=self.education_group_year_3.management_entity,
            start_date=self.education_group_year_3.academic_year.start_date,
            parent=None)

        self.group_element_year_4 = GroupElementYearFactory(
            parent=self.education_group_year_3,
            child_branch=self.education_group_year_1)
        self.group_element_year_5 = GroupElementYearFactory(
            parent=self.education_group_year_3,
            child_branch=self.education_group_year_1)
Esempio n. 21
0
    def test_clean_link_type_reference_with_authorized_relationship(self):
        AuthorizedRelationshipFactory(
            parent_type=self.parent.education_group_type,
            child_type=self.child_branch.education_group_type,
        )
        ref_group = GroupElementYearFactory(
            parent=self.child_branch,
            child_branch=EducationGroupYearFactory(
                academic_year=self.academic_year))
        AuthorizedRelationshipFactory(
            parent_type=self.parent.education_group_type,
            child_type=ref_group.child_branch.education_group_type,
        )

        form = GroupElementYearForm(
            data={'link_type': LinkTypes.REFERENCE.name},
            parent=self.parent,
            child_branch=self.child_branch)

        self.assertTrue(form.is_valid())
Esempio n. 22
0
 def setUpTestData(cls):
     cls.academic_year = AcademicYearFactory()
     cls.education_group_year = EducationGroupYearFactory(academic_year=cls.academic_year)
     cls.luy = LearningUnitYearFactory()
     cls.group_element_year_root = GroupElementYearFactory(
         parent__academic_year=cls.academic_year,
         child_branch=cls.education_group_year
     )
     cls.group_element_year = GroupElementYearFactory(
         parent=cls.education_group_year,
         child_branch=None,
         child_leaf=cls.luy
     )
     cls.person = CentralManagerFactory()
     cls.person.user.user_permissions.add(Permission.objects.get(codename="can_access_education_group"))
     cls.url = reverse("group_element_year_delete", args=[
         cls.education_group_year.id,
         cls.education_group_year.id,
         cls.group_element_year.id
     ])
Esempio n. 23
0
    def setUp(self):
        self.education_group_year = EducationGroupYearFactory(acronym='ACTU2M')

        common_education_group_year = EducationGroupYearCommonFactory(
            academic_year=self.education_group_year.academic_year
        )
        self.cms_label_name = 'evaluation'

        text_label = TextLabelFactory(entity=OFFER_YEAR, label='evaluation')
        TranslatedTextLabelFactory(text_label=text_label,
                                   language='fr-be')
        self.evaluation = TranslatedTextRandomFactory(text_label=text_label,
                                                      language='fr-be',
                                                      reference=self.education_group_year.id,
                                                      entity=text_label.entity)

        self.common = TranslatedTextRandomFactory(text_label=text_label,
                                                  language='fr-be',
                                                  reference=common_education_group_year.id,
                                                  entity=text_label.entity)
Esempio n. 24
0
    def test_update_without_parent(self):
        entity_version = MainEntityVersionFactory()
        initial_educ_group_year = EducationGroupYearFactory(
            academic_year=current_academic_year(),
            management_entity=entity_version.entity)
        initial_educ_group = initial_educ_group_year.education_group

        form = self.form_class(data=self.post_data,
                               instance=initial_educ_group_year,
                               parent=None)
        self.assertTrue(form.is_valid(), form.errors)
        updated_educ_group_year = form.save()

        self.assertEqual(updated_educ_group_year.pk,
                         initial_educ_group_year.pk)
        # Assert keep the same EducationGroup when update
        self.assertEqual(updated_educ_group_year.education_group,
                         initial_educ_group)
        self._assert_all_fields_correctly_saved(updated_educ_group_year)
        self.assertTrue(form.forms[ModelForm].fields["academic_year"].disabled)
Esempio n. 25
0
    def setUp(self):
        self.education_group_year = EducationGroupYearFactory()

        self.achievement_0 = EducationGroupAchievementFactory(
            education_group_year=self.education_group_year)
        self.achievement_1 = EducationGroupAchievementFactory(
            education_group_year=self.education_group_year)
        self.achievement_2 = EducationGroupAchievementFactory(
            education_group_year=self.education_group_year)

        self.user = UserFactory()
        self.person = PersonFactory(user=self.user)
        self.user.user_permissions.add(
            Permission.objects.get(codename="can_access_education_group"))
        self.user.user_permissions.add(
            Permission.objects.get(
                codename="change_educationgroupachievement"))
        PersonEntityFactory(person=self.person,
                            entity=self.education_group_year.management_entity)
        self.client.force_login(self.user)
    def setUpTestData(cls):
        cls.nb_session = number_session.ONE
        current_year = datetime.now().year
        current_date = datetime(year=current_year, month=9, day=1, hour=12)
        cls.academic_year = AcademicYearFactory(year=current_year,
                                                start_date=current_date,
                                                end_date=current_date + timedelta(days=365))

        cls.off_year = OfferYearFactory()
        cls.education_group_year = EducationGroupYearFactory()
        cls.academic_calendar_deliberation = AcademicCalendarFactory(
            academic_year=cls.academic_year,
            reference=academic_calendar_type.DELIBERATION,
            start_date=cls.academic_year.start_date,
            end_date=cls.academic_year.end_date,
        )

        SessionExamCalendarFactory(
            academic_calendar=cls.academic_calendar_deliberation,
            number_session=cls.nb_session,
        )
Esempio n. 27
0
 def setUpTestData(cls):
     cls.academic_year = AcademicYearFactory()
     cls.education_group_year = EducationGroupYearFactory(
         academic_year=cls.academic_year)
     cls.group_element_year = GroupElementYearFactory(
         parent=cls.education_group_year,
         child_branch__academic_year=cls.academic_year)
     cls.person = CentralManagerFactory()
     cls.person.user.user_permissions.add(
         Permission.objects.get(codename="can_access_education_group"))
     cls.url = reverse("group_content",
                       kwargs={
                           "root_id":
                           cls.education_group_year.id,
                           "education_group_year_id":
                           cls.education_group_year.id
                       })
     cls.post_valid_data = {
         'action': 'Generate pdf',
         'language': LANGUAGE_CODE_EN
     }
Esempio n. 28
0
 def setUpTestData(cls):
     cls.user = UserFactory()
     current_academic_yr = create_current_academic_year()
     cls.next_academic_yr = AcademicYearFactory(
         year=current_academic_yr.year + 1)
     cls.academic_year = AcademicYearFactory(year=2018)
     cls.education_group = EducationGroupFactory()
     EducationGroupYearFactory(education_group=cls.education_group,
                               academic_year=current_academic_yr)
     cls.formation = ContinuingEducationTrainingFactory(
         education_group=cls.education_group)
     cls.entity_version = EntityVersionFactory(
         entity=cls.formation.management_entity,
         acronym=FACULTY_ACRONYM,
         entity_type=entity_type.FACULTY)
     cls.registration = AdmissionFactory(
         formation=cls.formation,
         state=ACCEPTED,
         ucl_registration_complete=True,
         payment_complete=False,
     )
Esempio n. 29
0
    def setUpTestData(cls):
        cls.academic_year = create_current_academic_year()
        AcademicYearFactory.produce(base_year=cls.academic_year.year, number_past=10, number_future=10)

        cls.education_group = EducationGroupFactory()
        EducationGroupYearFactory(
            education_group=cls.education_group,
            academic_year=cls.academic_year
        )
        cls.formation = ContinuingEducationTrainingFactory(
            education_group=cls.education_group
        )
        cls.accepted_admission_without_condition = AdmissionFactory(
            state=ACCEPTED,
            formation=cls.formation
        )
        cls.accepted_admission_with_condition = AdmissionFactory(
            state=ACCEPTED,
            condition_of_acceptance="Condition",
            formation=cls.formation
        )
Esempio n. 30
0
    def setUpTestData(cls):
        cls.url = reverse('partnerships:autocomplete:partnership_year_offers')

        academic_year = AcademicYearFactory.produce_in_future(quantity=3)[-1]
        PartnershipConfiguration.objects.create(
            partnership_creation_update_min_year=academic_year,
        )

        # university_offer
        cls.university_offer = EducationGroupYearFactory(
            joint_diploma=True,
            academic_year=academic_year
        )

        # education_level
        cls.education_level = PartnershipYearEducationLevelFactory()
        cls.education_level.education_group_types.add(
            cls.university_offer.education_group_type
        )

        cls.user = PartnershipEntityManagerFactory().person.user