From a3a5d0a2912f1cdd98671c5b1cdee40b6eb6eeb2 Mon Sep 17 00:00:00 2001 From: Julien Cougnaud Date: Fri, 15 Nov 2024 13:24:03 +0100 Subject: [PATCH] [OS-1317] Doctorate > use the PHD training type instead of the FORMATION_PHD type --- api/views/autocomplete.py | 2 +- calendar/admission_calendar.py | 2 +- .../domain/service/verifier_proposition.py | 4 ++-- .../service/test_verifier_proposition.py | 8 ++++---- .../preparation/test/factory/doctorat.py | 4 ++-- .../test_soumettre_proposition_service.py | 2 +- ...erminer_annee_academique_et_pot_service.py | 4 ++-- .../domain/model/enums/condition_acces.py | 2 +- .../domain/service/i_titres_acces.py | 2 +- .../service/test_calendrier_inscription.py | 4 ++-- forms/doctorate/cdd/filter.py | 2 +- .../preparation/domain/service/doctorat.py | 8 ++++---- .../service/annee_inscription_formation.py | 2 +- .../commands/initialize_specific_questions.py | 2 +- models/base.py | 2 +- tests/api/views/autocomplete/test_training.py | 8 ++++---- tests/factories/doctorate.py | 2 +- tests/templatetags/test_admission.py | 4 ++-- .../test_initialize_specific_questions.py | 2 +- .../autocomplete/test_doctorate_trainings.py | 20 +++++++++---------- .../checklist/test_past_experiences.py | 4 ++-- .../checklist/test_past_experiences.py | 2 +- tests/views/test_excel_exports.py | 8 ++++---- utils.py | 2 +- 24 files changed, 51 insertions(+), 51 deletions(-) diff --git a/api/views/autocomplete.py b/api/views/autocomplete.py index 78232f835..eb18dd157 100644 --- a/api/views/autocomplete.py +++ b/api/views/autocomplete.py @@ -95,7 +95,7 @@ def list(self, request, **kwargs): ).filter( academic_year__year=year, education_group_type__category=Categories.TRAINING.name, - education_group_type__name=TrainingType.FORMATION_PHD.name, + education_group_type__name=TrainingType.PHD.name, ) doctorate_paths = doctorate_qs.values_list('path_as_string', flat=True) # Get all sectors diff --git a/calendar/admission_calendar.py b/calendar/admission_calendar.py index d5b3640c6..6646ffba1 100644 --- a/calendar/admission_calendar.py +++ b/calendar/admission_calendar.py @@ -175,7 +175,7 @@ def ensure_consistency_until_n_plus_6(cls): @classmethod def matches_criteria(cls, training_type: TrainingType, **kwargs) -> bool: """Candidat inscrit en doctorat""" - return training_type == TrainingType.FORMATION_PHD + return training_type == TrainingType.PHD class GeneralEducationAdmissionCalendar(AcademicEventSessionCalendarHelper): diff --git a/ddd/admission/doctorat/preparation/domain/service/verifier_proposition.py b/ddd/admission/doctorat/preparation/domain/service/verifier_proposition.py index 0515f292e..165579450 100644 --- a/ddd/admission/doctorat/preparation/domain/service/verifier_proposition.py +++ b/ddd/admission/doctorat/preparation/domain/service/verifier_proposition.py @@ -64,7 +64,7 @@ def verifier( doctorat_id = proposition_candidat.formation_id titres = titres_acces.recuperer_titres_access( proposition_candidat.matricule_candidat, - TrainingType.FORMATION_PHD, + TrainingType.PHD, ) execute_functions_and_aggregate_exceptions( partial( @@ -117,7 +117,7 @@ def verifier( proposition=None, matricule_candidat=proposition_candidat.matricule_candidat, titres_acces=titres, - type_formation=TrainingType.FORMATION_PHD, + type_formation=TrainingType.PHD, profil_candidat_translator=profil_candidat_translator, formation_translator=formation_translator, annee_soumise=annee_soumise, diff --git a/ddd/admission/doctorat/preparation/test/domain/service/test_verifier_proposition.py b/ddd/admission/doctorat/preparation/test/domain/service/test_verifier_proposition.py index 21fbf8463..d4d10dcf9 100644 --- a/ddd/admission/doctorat/preparation/test/domain/service/test_verifier_proposition.py +++ b/ddd/admission/doctorat/preparation/test/domain/service/test_verifier_proposition.py @@ -51,7 +51,7 @@ def test_type_demande_belge_diplomes_tous_belges(self): self.titres_acces_in_memory.results['0000000001'] = AdmissionConditionsDTOFactory( diplomation_potentiel_master_belge=True, ) - titres = self.titres_acces_in_memory.recuperer_titres_access('0000000001', TrainingType.FORMATION_PHD) + titres = self.titres_acces_in_memory.recuperer_titres_access('0000000001', TrainingType.PHD) type_demande = VerifierProposition.determiner_type_demande( PropositionAdmissionSC3DPMinimaleFactory(matricule_candidat='0000000001'), titres, @@ -65,7 +65,7 @@ def test_type_demande_belge_diplome_belge_et_etranger(self): diplomation_potentiel_master_belge=True, diplomation_academique_etranger=True, ) - titres = self.titres_acces_in_memory.recuperer_titres_access('0000000001', TrainingType.FORMATION_PHD) + titres = self.titres_acces_in_memory.recuperer_titres_access('0000000001', TrainingType.PHD) type_demande = VerifierProposition.determiner_type_demande( PropositionAdmissionSC3DPMinimaleFactory(matricule_candidat='0000000001'), titres, @@ -79,7 +79,7 @@ def test_type_demande_belge_diplome_belge_et_etranger_pas_condition_access(self) diplomation_secondaire_etranger=True, diplomation_potentiel_master_belge=True, ) - titres = self.titres_acces_in_memory.recuperer_titres_access('0000000001', TrainingType.FORMATION_PHD) + titres = self.titres_acces_in_memory.recuperer_titres_access('0000000001', TrainingType.PHD) type_demande = VerifierProposition.determiner_type_demande( PropositionAdmissionSC3DPMinimaleFactory(matricule_candidat='0000000001'), titres, @@ -92,7 +92,7 @@ def test_type_demande_etranger_diplome_belge(self): self.titres_acces_in_memory.results['0000000003'] = AdmissionConditionsDTOFactory( diplomation_potentiel_master_belge=True, ) - titres = self.titres_acces_in_memory.recuperer_titres_access('0000000003', TrainingType.FORMATION_PHD) + titres = self.titres_acces_in_memory.recuperer_titres_access('0000000003', TrainingType.PHD) type_demande = VerifierProposition.determiner_type_demande( PropositionAdmissionSC3DPMinimaleFactory(matricule_candidat='0000000003'), titres, diff --git a/ddd/admission/doctorat/preparation/test/factory/doctorat.py b/ddd/admission/doctorat/preparation/test/factory/doctorat.py index 9f37584b7..0a80d6a73 100644 --- a/ddd/admission/doctorat/preparation/test/factory/doctorat.py +++ b/ddd/admission/doctorat/preparation/test/factory/doctorat.py @@ -70,7 +70,7 @@ class Meta: intitule_secteur = factory.Faker('sentence') sigle = factory.Faker('word') code_secteur = factory.Faker('word') - type = TrainingType.FORMATION_PHD + type = TrainingType.PHD class _DoctoratDTOFactory(factory.Factory): @@ -85,7 +85,7 @@ class Meta: campus = CampusFactory() campus_inscription = CampusFactory() date_debut = factory.Faker('date') - type = TrainingType.FORMATION_PHD.name + type = TrainingType.PHD.name credits = 180 diff --git a/ddd/admission/doctorat/preparation/test/use_case/write/test_soumettre_proposition_service.py b/ddd/admission/doctorat/preparation/test/use_case/write/test_soumettre_proposition_service.py index bc1294ca6..f5ed5ea51 100644 --- a/ddd/admission/doctorat/preparation/test/use_case/write/test_soumettre_proposition_service.py +++ b/ddd/admission/doctorat/preparation/test/use_case/write/test_soumettre_proposition_service.py @@ -88,7 +88,7 @@ def setUpClass(cls): FormationDTO( sigle='SC3DP', annee=2020, - type=TrainingType.FORMATION_PHD.name, + type=TrainingType.PHD.name, grade_academique='', credits=0, cycle=3, diff --git a/ddd/admission/doctorat/preparation/use_case/read/determiner_annee_academique_et_pot_service.py b/ddd/admission/doctorat/preparation/use_case/read/determiner_annee_academique_et_pot_service.py index fde770f2d..bc701dfc4 100644 --- a/ddd/admission/doctorat/preparation/use_case/read/determiner_annee_academique_et_pot_service.py +++ b/ddd/admission/doctorat/preparation/use_case/read/determiner_annee_academique_et_pot_service.py @@ -46,11 +46,11 @@ def determiner_annee_academique_et_pot( proposition = proposition_repository.get(entity_id=proposition_id) # THEN - titres = titres_acces.recuperer_titres_access(proposition.matricule_candidat, TrainingType.FORMATION_PHD) + titres = titres_acces.recuperer_titres_access(proposition.matricule_candidat, TrainingType.PHD) return calendrier_inscription.determiner_annee_academique_et_pot( formation_id=proposition.formation_id, matricule_candidat=proposition.matricule_candidat, titres_acces=titres, - type_formation=TrainingType.FORMATION_PHD, + type_formation=TrainingType.PHD, profil_candidat_translator=profil_candidat_translator, ) diff --git a/ddd/admission/domain/model/enums/condition_acces.py b/ddd/admission/domain/model/enums/condition_acces.py index 13b0c106d..31f36b8bd 100644 --- a/ddd/admission/domain/model/enums/condition_acces.py +++ b/ddd/admission/domain/model/enums/condition_acces.py @@ -111,7 +111,7 @@ def recuperer_conditions_acces_par_formation(type_formation: str): TrainingType.CERTIFICATE.name: CHOIX_POUR_CERTIFICAT, TrainingType.AGGREGATION.name: CHOIX_POUR_AGGREGATION, TrainingType.CAPAES.name: CHOIX_POUR_CAPAES, - TrainingType.FORMATION_PHD.name: CHOIX_POUR_DOCTORAT, + TrainingType.PHD.name: CHOIX_POUR_DOCTORAT, } diff --git a/ddd/admission/domain/service/i_titres_acces.py b/ddd/admission/domain/service/i_titres_acces.py index b8d408b48..8af37a4de 100644 --- a/ddd/admission/domain/service/i_titres_acces.py +++ b/ddd/admission/domain/service/i_titres_acces.py @@ -99,7 +99,7 @@ class ITitresAcces(interface.DomainService): ConditionAccess.DIPLOMATION_ACADEMIQUE_ETRANGER, ConditionAccess.POTENTIEL_ACCES_VAE, ], - (TrainingType.FORMATION_PHD,): [ + (TrainingType.PHD,): [ ConditionAccess.DIPLOMATION_POTENTIEL_MASTER_BELGE, ConditionAccess.DIPLOMATION_POTENTIEL_DOCTORAT_BELGE, ConditionAccess.DIPLOMATION_ACADEMIQUE_ETRANGER, diff --git a/ddd/admission/test/domain/service/test_calendrier_inscription.py b/ddd/admission/test/domain/service/test_calendrier_inscription.py index 2e24be77c..490d392a9 100644 --- a/ddd/admission/test/domain/service/test_calendrier_inscription.py +++ b/ddd/admission/test/domain/service/test_calendrier_inscription.py @@ -84,11 +84,11 @@ def setUp(self): def test_verification_calendrier_inscription_doctorat(self): proposition = PropositionAdmissionECGE3DPMinimaleFactory() dto = CalendrierInscriptionInMemory.determiner_annee_academique_et_pot( - formation_id=FormationFactory(type=TrainingType.FORMATION_PHD).entity_id, + formation_id=FormationFactory(type=TrainingType.PHD).entity_id, proposition=proposition, matricule_candidat=proposition.matricule_candidat, titres_acces=Titres(AdmissionConditionsDTOFactory()), - type_formation=TrainingType.FORMATION_PHD, + type_formation=TrainingType.PHD, profil_candidat_translator=self.profil_candidat_translator, ) self.assertEqual(dto.pool, AcademicCalendarTypes.DOCTORATE_EDUCATION_ENROLLMENT) diff --git a/forms/doctorate/cdd/filter.py b/forms/doctorate/cdd/filter.py index 6b796ef4b..e31617fd4 100644 --- a/forms/doctorate/cdd/filter.py +++ b/forms/doctorate/cdd/filter.py @@ -196,7 +196,7 @@ class Media: def get_doctorate_queryset(self): """Used to determine which training to filter on""" - qs = EducationGroupYear.objects.filter(education_group_type__name=TrainingType.FORMATION_PHD.name) + qs = EducationGroupYear.objects.filter(education_group_type__name=TrainingType.PHD.name) conditions = Q() for entity_aware_role in [r for r in self.relevant_roles if issubclass(r, EntityRoleModel)]: conditions |= Q( diff --git a/infrastructure/admission/doctorat/preparation/domain/service/doctorat.py b/infrastructure/admission/doctorat/preparation/domain/service/doctorat.py index a3e511678..26d0ce4b9 100644 --- a/infrastructure/admission/doctorat/preparation/domain/service/doctorat.py +++ b/infrastructure/admission/doctorat/preparation/domain/service/doctorat.py @@ -132,7 +132,7 @@ def get_dto(cls, sigle: str, annee: int) -> 'DoctoratDTO': # pragma: no cover from infrastructure.messages_bus import message_bus_instance dtos = message_bus_instance.invoke( - SearchFormationsCommand(sigles_annees=[(sigle, annee)], type=TrainingType.FORMATION_PHD.name) + SearchFormationsCommand(sigles_annees=[(sigle, annee)], type=TrainingType.PHD.name) ) if dtos: return cls._build_dto(dtos[0]) @@ -143,7 +143,7 @@ def get(cls, sigle: str, annee: int) -> 'Doctorat': from infrastructure.messages_bus import message_bus_instance dtos = message_bus_instance.invoke( - SearchFormationsCommand(sigles_annees=[(sigle, annee)], type=TrainingType.FORMATION_PHD.name) + SearchFormationsCommand(sigles_annees=[(sigle, annee)], type=TrainingType.PHD.name) ) if dtos: dto: TrainingDto = dtos[0] @@ -172,7 +172,7 @@ def search( annee=annee, sigle_entite_gestion=sigle_secteur_entite_gestion, inclure_entites_gestion_subordonnees=True, - type=TrainingType.FORMATION_PHD.name, + type=TrainingType.PHD.name, campus=campus, terme_de_recherche=terme_de_recherche, est_inscriptible=True, @@ -220,7 +220,7 @@ def verifier_existence(cls, sigle: str, annee: int) -> bool: # pragma: no cover dtos = message_bus_instance.invoke( SearchFormationsCommand( sigles_annees=[(sigle, annee)], - type=TrainingType.FORMATION_PHD.name, + type=TrainingType.PHD.name, est_inscriptible=True, uclouvain_est_institution_reference=True, inscription_web=True, diff --git a/infrastructure/admission/domain/service/annee_inscription_formation.py b/infrastructure/admission/domain/service/annee_inscription_formation.py index 3a6f10641..63d42cca2 100644 --- a/infrastructure/admission/domain/service/annee_inscription_formation.py +++ b/infrastructure/admission/domain/service/annee_inscription_formation.py @@ -74,7 +74,7 @@ class AnneeInscriptionFormationTranslator(IAnneeInscriptionFormationTranslator): TrainingType.UNIVERSITY_SECOND_CYCLE_CERTIFICATE.name, ], TypeFormation.DOCTORAT.name: [ - TrainingType.FORMATION_PHD.name, + TrainingType.PHD.name, ], } diff --git a/management/commands/initialize_specific_questions.py b/management/commands/initialize_specific_questions.py index 7205b55f2..ed31f9e63 100644 --- a/management/commands/initialize_specific_questions.py +++ b/management/commands/initialize_specific_questions.py @@ -228,7 +228,7 @@ def handle(self, *args, **options): }, ) - # > All masters, specialized masters, FORMATION_PHD, CAPAES and certificates + # > All masters, specialized masters, PHD, CAPAES and certificates for education_type in ( AnneeInscriptionFormationTranslator.OSIS_ADMISSION_EDUCATION_TYPES_MAPPING[TypeFormation.MASTER.name] + AnneeInscriptionFormationTranslator.OSIS_ADMISSION_EDUCATION_TYPES_MAPPING[TypeFormation.DOCTORAT.name] diff --git a/models/base.py b/models/base.py index d3cd318af..fc967924f 100644 --- a/models/base.py +++ b/models/base.py @@ -229,7 +229,7 @@ def annotate_with_reference(self, with_management_faculty=True): # Management entity acronym Case( When( - Q(training__education_group_type__name=TrainingType.FORMATION_PHD.name), + Q(training__education_group_type__name=TrainingType.PHD.name), then=F('sigle_entite_gestion'), ), default=Coalesce( diff --git a/tests/api/views/autocomplete/test_training.py b/tests/api/views/autocomplete/test_training.py index 5a65266ce..4b250000c 100644 --- a/tests/api/views/autocomplete/test_training.py +++ b/tests/api/views/autocomplete/test_training.py @@ -119,7 +119,7 @@ def setUpTestData(cls): cls.last_year_doctorate = EducationGroupYearFactory( academic_year=cls.past_year, - education_group_type__name=TrainingType.FORMATION_PHD.name, + education_group_type__name=TrainingType.PHD.name, management_entity=cls.management_entity, ) EducationGroupVersionFactory( @@ -129,7 +129,7 @@ def setUpTestData(cls): cls.current_year_first_doctorate = EducationGroupYearFactory( academic_year=cls.current_year, - education_group_type__name=TrainingType.FORMATION_PHD.name, + education_group_type__name=TrainingType.PHD.name, management_entity=cls.management_entity, ) EducationGroupVersionFactory( @@ -139,7 +139,7 @@ def setUpTestData(cls): cls.current_year_second_doctorate = EducationGroupYearFactory( academic_year=cls.current_year, - education_group_type__name=TrainingType.FORMATION_PHD.name, + education_group_type__name=TrainingType.PHD.name, management_entity=cls.management_entity, ) EducationGroupVersionFactory( @@ -149,7 +149,7 @@ def setUpTestData(cls): cls.next_year_doctorate = EducationGroupYearFactory( academic_year=cls.next_year, - education_group_type__name=TrainingType.FORMATION_PHD.name, + education_group_type__name=TrainingType.PHD.name, management_entity=cls.management_entity, ) EducationGroupVersionFactory( diff --git a/tests/factories/doctorate.py b/tests/factories/doctorate.py index 6094fea98..67d1b4871 100644 --- a/tests/factories/doctorate.py +++ b/tests/factories/doctorate.py @@ -68,7 +68,7 @@ class Meta: academic_year = factory.SubFactory(AcademicYearFactory, current=True) management_entity = factory.SubFactory(EntityWithVersionFactory) - education_group_type = factory.SubFactory(EducationGroupTypeFactory, name=TrainingType.FORMATION_PHD.name) + education_group_type = factory.SubFactory(EducationGroupTypeFactory, name=TrainingType.PHD.name) primary_language = None @factory.post_generation diff --git a/tests/templatetags/test_admission.py b/tests/templatetags/test_admission.py index d3c6f1f77..bc49272fb 100644 --- a/tests/templatetags/test_admission.py +++ b/tests/templatetags/test_admission.py @@ -1316,7 +1316,7 @@ def test_interpolate_a_string(self): def test_admission_training_type(self): self.assertEqual( - admission_training_type(TrainingType.FORMATION_PHD.name), + admission_training_type(TrainingType.PHD.name), TypeFormation.DOCTORAT.name, ) @@ -1571,7 +1571,7 @@ def test_get_document_details_url(self): class AdmissionTagsTestCase(TestCase): @classmethod def setUpTestData(cls): - cls.doctorate_training_type = TrainingType.FORMATION_PHD.name + cls.doctorate_training_type = TrainingType.PHD.name cls.general_training_type = TrainingType.BACHELOR.name cls.continuing_training_type = TrainingType.UNIVERSITY_FIRST_CYCLE_CERTIFICATE.name cls.admission_uuid = str(uuid.uuid4()) diff --git a/tests/views/admin/test_initialize_specific_questions.py b/tests/views/admin/test_initialize_specific_questions.py index a6c304f26..e42f15ca4 100644 --- a/tests/views/admin/test_initialize_specific_questions.py +++ b/tests/views/admin/test_initialize_specific_questions.py @@ -206,7 +206,7 @@ def test_motivation_letter(self): TrainingType.MASTER_MS_120.name, TrainingType.MASTER_MS_180_240.name, TrainingType.MASTER_M1.name, - TrainingType.FORMATION_PHD.name, + TrainingType.PHD.name, TrainingType.CAPAES.name, TrainingType.CERTIFICATE.name, ] diff --git a/tests/views/autocomplete/test_doctorate_trainings.py b/tests/views/autocomplete/test_doctorate_trainings.py index fbb4e8048..e800a8305 100644 --- a/tests/views/autocomplete/test_doctorate_trainings.py +++ b/tests/views/autocomplete/test_doctorate_trainings.py @@ -48,21 +48,21 @@ def setUpTestData(cls): acronym='FOOBAR', title='wegweij wegioj egewgeg', academic_year__year=2023, - education_group_type__name=TrainingType.FORMATION_PHD.name, + education_group_type__name=TrainingType.PHD.name, ) EducationGroupYearFactory( acronym='FOOBAR', title='wegweij wegioj egewgeg', academic_year__year=2024, - education_group_type__name=TrainingType.FORMATION_PHD.name, + education_group_type__name=TrainingType.PHD.name, ) EducationGroupYearFactory( acronym='ABCD', title='Test title search', academic_year__year=2023, - education_group_type__name=TrainingType.FORMATION_PHD.name, + education_group_type__name=TrainingType.PHD.name, ) cls.user = User.objects.create_user( @@ -84,11 +84,11 @@ def test_doctorate_trainings_without_query_and_year(self): { 'pagination': {'more': False}, 'results': [ - {'id': 'ABCD', 'text': 'ABCD - Test title search', 'type': TrainingType.FORMATION_PHD.name}, + {'id': 'ABCD', 'text': 'ABCD - Test title search', 'type': TrainingType.PHD.name}, { 'id': 'FOOBAR', 'text': 'FOOBAR - wegweij wegioj egewgeg', - 'type': TrainingType.FORMATION_PHD.name, + 'type': TrainingType.PHD.name, }, ], }, @@ -114,7 +114,7 @@ def test_doctorate_trainings_with_acronym_query_but_no_year(self): { 'id': 'FOOBAR', 'text': 'FOOBAR - wegweij wegioj egewgeg', - 'type': TrainingType.FORMATION_PHD.name, + 'type': TrainingType.PHD.name, }, ], }, @@ -137,7 +137,7 @@ def test_doctorate_trainings_with_title_query_but_no_year(self): { 'pagination': {'more': False}, 'results': [ - {'id': 'ABCD', 'text': 'ABCD - Test title search', 'type': TrainingType.FORMATION_PHD.name}, + {'id': 'ABCD', 'text': 'ABCD - Test title search', 'type': TrainingType.PHD.name}, ], }, ) @@ -162,7 +162,7 @@ def test_doctorate_trainings_with_year_but_no_query(self): { 'id': 'FOOBAR', 'text': 'FOOBAR - wegweij wegioj egewgeg', - 'type': TrainingType.FORMATION_PHD.name, + 'type': TrainingType.PHD.name, }, ], }, @@ -174,7 +174,7 @@ def test_doctorate_trainings_with_year_and_query(self): response = self.client.get( self.url, { - 'forward': json.dumps({'annee_academique': '2024', 'type': TrainingType.FORMATION_PHD.name}), + 'forward': json.dumps({'annee_academique': '2024', 'type': TrainingType.PHD.name}), 'q': 'bar', }, ) @@ -189,7 +189,7 @@ def test_doctorate_trainings_with_year_and_query(self): { 'id': 'FOOBAR', 'text': 'FOOBAR - wegweij wegioj egewgeg', - 'type': TrainingType.FORMATION_PHD.name, + 'type': TrainingType.PHD.name, }, ], }, diff --git a/tests/views/doctorate/checklist/test_past_experiences.py b/tests/views/doctorate/checklist/test_past_experiences.py index 84c3f2362..65705c86d 100644 --- a/tests/views/doctorate/checklist/test_past_experiences.py +++ b/tests/views/doctorate/checklist/test_past_experiences.py @@ -240,7 +240,7 @@ def setUpTestData(cls): cls.training = DoctorateFactory( management_entity=cls.commission, academic_year=cls.academic_years[0], - education_group_type__name=TrainingType.FORMATION_PHD.name, + education_group_type__name=TrainingType.PHD.name, ) cls.candidate = CompletePersonFactory(language=settings.LANGUAGE_CODE_FR) @@ -298,7 +298,7 @@ def test_initialization_of_the_form(self): self.assertFalse(form.fields['with_prerequisite_courses'].disabled) self.assertEqual( - recuperer_conditions_acces_par_formation(TrainingType.FORMATION_PHD.name), + recuperer_conditions_acces_par_formation(TrainingType.PHD.name), doctorate_choices, ) diff --git a/tests/views/general_education/checklist/test_past_experiences.py b/tests/views/general_education/checklist/test_past_experiences.py index 4210a4449..525742cab 100644 --- a/tests/views/general_education/checklist/test_past_experiences.py +++ b/tests/views/general_education/checklist/test_past_experiences.py @@ -448,7 +448,7 @@ def test_initialization_of_the_form(self): ) self.assertEqual( - recuperer_conditions_acces_par_formation(TrainingType.FORMATION_PHD.name), + recuperer_conditions_acces_par_formation(TrainingType.PHD.name), [ (ConditionAcces.MASTER.name, ConditionAcces.MASTER.label), (ConditionAcces.UNI_SNU_AUTRE.name, ConditionAcces.UNI_SNU_AUTRE.label), diff --git a/tests/views/test_excel_exports.py b/tests/views/test_excel_exports.py index ca34e30c4..2a542b743 100644 --- a/tests/views/test_excel_exports.py +++ b/tests/views/test_excel_exports.py @@ -510,7 +510,7 @@ def test_export_configuration(self): 'type': TypeDemande.ADMISSION.name, 'site_inscription': str(campus.uuid), 'entites': 'ENT', - 'types_formation': [TrainingType.BACHELOR.name, TrainingType.FORMATION_PHD.name], + 'types_formation': [TrainingType.BACHELOR.name, TrainingType.PHD.name], 'formation': 'Informatique', 'bourse_internationale': str(international_scholarship.uuid), 'bourse_erasmus_mundus': str(erasmus_mundus_scholarship.uuid), @@ -573,7 +573,7 @@ def test_export_configuration(self): self.assertEqual(values[8], TypeDemande.ADMISSION.value) self.assertEqual(values[9], campus.name) self.assertEqual(values[10], 'ENT') - self.assertEqual(values[11], f"['{TrainingType.BACHELOR.value}', '{TrainingType.FORMATION_PHD.value}']") + self.assertEqual(values[11], f"['{TrainingType.BACHELOR.value}', '{TrainingType.PHD.value}']") self.assertEqual(values[12], 'Informatique') self.assertEqual(values[13], international_scholarship.short_name) self.assertEqual(values[14], erasmus_mundus_scholarship.short_name) @@ -1138,7 +1138,7 @@ def test_export_content(self): status=ChoixStatutPropositionDoctorale.CONFIRMEE.name, training__management_entity=self.first_entity, training__acronym="ZEBU0", - training__education_group_type__name=TrainingType.FORMATION_PHD.name, + training__education_group_type__name=TrainingType.PHD.name, submitted_at=datetime.datetime(2023, 1, 1), training__academic_year=self.academic_years[1], determined_academic_year=self.academic_years[2], @@ -1232,7 +1232,7 @@ def test_export_configuration(self): status=ChoixStatutPropositionDoctorale.CONFIRMEE.name, training__management_entity=self.first_entity, training__acronym="ZEBU0", - training__education_group_type__name=TrainingType.FORMATION_PHD.name, + training__education_group_type__name=TrainingType.PHD.name, submitted_at=datetime.datetime(2023, 1, 1), training__academic_year=self.academic_years[1], determined_academic_year=self.academic_years[2], diff --git a/utils.py b/utils.py index 2e0d09789..49f14ca29 100644 --- a/utils.py +++ b/utils.py @@ -322,7 +322,7 @@ def get_training_url(training_type, training_acronym, partial_training_acronym, from admission.constants import CONTEXT_GENERAL from admission.constants import CONTEXT_DOCTORATE - if training_type == TrainingType.FORMATION_PHD.name: + if training_type == TrainingType.PHD.name: return ( "https://uclouvain.be/en/study/inscriptions/doctorate-and-doctoral-training.html" if get_language() == settings.LANGUAGE_CODE_EN