Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature/OS-1317 => DEV] Retour à la situation initiale choix de formation : Formation doctorale --> Doctorat #2270

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/views/autocomplete.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion calendar/admission_calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions ddd/admission/doctorat/preparation/test/factory/doctorat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
2 changes: 1 addition & 1 deletion ddd/admission/domain/model/enums/condition_acces.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}


Expand Down
2 changes: 1 addition & 1 deletion ddd/admission/domain/service/i_titres_acces.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion forms/doctorate/cdd/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand All @@ -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]
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class AnneeInscriptionFormationTranslator(IAnneeInscriptionFormationTranslator):
TrainingType.UNIVERSITY_SECOND_CYCLE_CERTIFICATE.name,
],
TypeFormation.DOCTORAT.name: [
TrainingType.FORMATION_PHD.name,
TrainingType.PHD.name,
],
}

Expand Down
2 changes: 1 addition & 1 deletion management/commands/initialize_specific_questions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
8 changes: 4 additions & 4 deletions tests/api/views/autocomplete/test_training.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(
Expand All @@ -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(
Expand All @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion tests/factories/doctorate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/templatetags/test_admission.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)

Expand Down Expand Up @@ -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())
Expand Down
2 changes: 1 addition & 1 deletion tests/views/admin/test_initialize_specific_questions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
]
Expand Down
20 changes: 10 additions & 10 deletions tests/views/autocomplete/test_doctorate_trainings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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,
},
],
},
Expand All @@ -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,
},
],
},
Expand All @@ -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},
],
},
)
Expand All @@ -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,
},
],
},
Expand All @@ -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',
},
)
Expand All @@ -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,
},
],
},
Expand Down
4 changes: 2 additions & 2 deletions tests/views/doctorate/checklist/test_past_experiences.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
Loading