66# The core business involves the administration of students, teachers,
77# courses, programs and so on.
88#
9- # Copyright (C) 2015-2025 Université catholique de Louvain (http://www.uclouvain.be)
9+ # Copyright (C) 2015-2026 Université catholique de Louvain (http://www.uclouvain.be)
1010#
1111# This program is free software: you can redistribute it and/or modify
1212# it under the terms of the GNU General Public License as published by
@@ -411,7 +411,7 @@ def test_send_to_faculty_with_sic_user_in_valid_sic_statuses_but_with_invalid_re
411411 response = self .client .post (self .url , ** self .default_headers )
412412
413413 # Check the response
414- program_email = EmailFonctionProgrammeFactory (
414+ EmailFonctionProgrammeFactory (
415415 programme = self .general_admission .training .education_group ,
416416 type = TypeEmailFonctionProgramme .DESTINATAIRE_ADMISSION .name ,
417417 premiere_annee = False ,
@@ -515,7 +515,9 @@ def setUp(self) -> None:
515515 patched .return_value = 'foobar'
516516 self .addCleanup (self .get_remote_token_patcher .stop )
517517
518- self .save_raw_content_remotely_patcher = mock .patch ('osis_document_components.services.save_raw_content_remotely' )
518+ self .save_raw_content_remotely_patcher = mock .patch (
519+ 'osis_document_components.services.save_raw_content_remotely'
520+ )
519521 patched = self .save_raw_content_remotely_patcher .start ()
520522 patched .return_value = 'a-token'
521523 self .addCleanup (self .save_raw_content_remotely_patcher .stop )
@@ -870,9 +872,19 @@ def test_send_to_sic_with_fac_user_in_specific_statuses_to_approve_with_secondar
870872 response = self .client .post (self .url + '?approval=1' , ** self .default_headers )
871873 self .assertEqual (response .status_code , 200 )
872874
873- # Check that the admission has not been updated
875+ # Check that the admission has been updated
874876 self .general_admission .refresh_from_db ()
875- self .assertEqual (self .general_admission .status , ChoixStatutPropositionGenerale .TRAITEMENT_FAC .name )
877+ self .assertEqual (self .general_admission .status , ChoixStatutPropositionGenerale .RETOUR_DE_FAC .name )
878+
879+ self .get_pdf_from_template_patcher .assert_called_once ()
880+ pdf_context = self .get_pdf_from_template_patcher .call_args_list [0 ][0 ][2 ]
881+
882+ self .assertIn ('access_titles_names' , pdf_context )
883+ self .assertEqual (len (pdf_context ['access_titles_names' ]), 1 )
884+ self .assertEqual (pdf_context ['access_titles_names' ][0 ], secondary_studies_base_title )
885+
886+ self .general_admission .status = ChoixStatutPropositionGenerale .TRAITEMENT_FAC .name
887+ self .general_admission .save ()
876888
877889 diploma_alternative .certificate = ['token.pdf' ]
878890 diploma_alternative .save ()
@@ -1041,7 +1053,7 @@ def test_send_to_sic_with_fac_user_to_approve_with_internal_experience_as_access
10411053 decision = DecisionResultatCycle .DISTINCTION .name ,
10421054 sigle_formation = "SF1" ,
10431055 )
1044- pce_a_uuid = str (uuid .UUID (int = pce_a .pk ))
1056+ str (uuid .UUID (int = pce_a .pk ))
10451057 pce_a_pae_a = InscriptionProgrammeAnnuelFactory (
10461058 programme_cycle = pce_a ,
10471059 statut = StatutInscriptionProgrammAnnuel .ETUDIANT_UCL .name ,
@@ -1052,8 +1064,6 @@ def test_send_to_sic_with_fac_user_to_approve_with_internal_experience_as_access
10521064
10531065 self .general_admission .internal_access_titles .add (pce_a )
10541066
1055- candidate = self .general_admission .candidate
1056-
10571067 response = self .client .post (self .url + '?approval=1' , ** self .default_headers )
10581068 self .assertEqual (response .status_code , 200 )
10591069
@@ -1073,9 +1083,9 @@ def test_send_to_sic_with_fac_user_in_specific_statuses_without_approving_or_ref
10731083 self .client .force_login (user = self .fac_manager_user )
10741084
10751085 self .general_admission .status = ChoixStatutPropositionGenerale .TRAITEMENT_FAC .name
1076- self .general_admission .checklist ['current' ]['decision_facultaire' ][
1077- 'statut'
1078- ] = ChoixStatutChecklist . GEST_REUSSITE . name
1086+ self .general_admission .checklist ['current' ]['decision_facultaire' ]['statut' ] = (
1087+ ChoixStatutChecklist . GEST_REUSSITE . name
1088+ )
10791089 self .general_admission .save ()
10801090
10811091 # Invalid request -> We need to be in the right status
@@ -1089,9 +1099,9 @@ def test_send_to_sic_with_fac_user_in_specific_statuses_without_approving_or_ref
10891099 frozen_time .move_to ('2022-01-02' )
10901100
10911101 # Valid request
1092- self .general_admission .checklist ['current' ]['decision_facultaire' ][
1093- 'statut'
1094- ] = ChoixStatutChecklist . INITIAL_CANDIDAT . name
1102+ self .general_admission .checklist ['current' ]['decision_facultaire' ]['statut' ] = (
1103+ ChoixStatutChecklist . INITIAL_CANDIDAT . name
1104+ )
10951105 self .general_admission .save ()
10961106
10971107 response = self .client .post (self .url , ** self .default_headers )
@@ -1131,9 +1141,9 @@ def test_send_to_sic_with_sic_user_in_specific_statuses_without_approving_or_ref
11311141 self .client .force_login (user = self .sic_manager_user )
11321142
11331143 self .general_admission .status = ChoixStatutPropositionGenerale .TRAITEMENT_FAC .name
1134- self .general_admission .checklist ['current' ]['decision_facultaire' ][
1135- 'statut'
1136- ] = ChoixStatutChecklist . GEST_REUSSITE . name
1144+ self .general_admission .checklist ['current' ]['decision_facultaire' ]['statut' ] = (
1145+ ChoixStatutChecklist . GEST_REUSSITE . name
1146+ )
11371147 self .general_admission .save ()
11381148
11391149 frozen_time .move_to ('2022-01-02' )
@@ -1224,7 +1234,9 @@ def setUp(self) -> None:
12241234 patched .return_value = 'foobar'
12251235 self .addCleanup (self .get_remote_token_patcher .stop )
12261236
1227- self .save_raw_content_remotely_patcher = mock .patch ('osis_document_components.services.save_raw_content_remotely' )
1237+ self .save_raw_content_remotely_patcher = mock .patch (
1238+ 'osis_document_components.services.save_raw_content_remotely'
1239+ )
12281240 patched = self .save_raw_content_remotely_patcher .start ()
12291241 patched .return_value = 'a-token'
12301242 self .addCleanup (self .save_raw_content_remotely_patcher .stop )
@@ -1573,7 +1585,9 @@ def setUp(self) -> None:
15731585 patched .return_value = 'foobar'
15741586 self .addCleanup (self .get_remote_token_patcher .stop )
15751587
1576- self .save_raw_content_remotely_patcher = mock .patch ('osis_document_components.services.save_raw_content_remotely' )
1588+ self .save_raw_content_remotely_patcher = mock .patch (
1589+ 'osis_document_components.services.save_raw_content_remotely'
1590+ )
15771591 patched = self .save_raw_content_remotely_patcher .start ()
15781592 patched .return_value = 'a-token'
15791593 self .addCleanup (self .save_raw_content_remotely_patcher .stop )
@@ -2353,7 +2367,9 @@ def setUp(self) -> None:
23532367 patched .return_value = 'foobar'
23542368 self .addCleanup (self .get_remote_token_patcher .stop )
23552369
2356- self .save_raw_content_remotely_patcher = mock .patch ('osis_document_components.services.save_raw_content_remotely' )
2370+ self .save_raw_content_remotely_patcher = mock .patch (
2371+ 'osis_document_components.services.save_raw_content_remotely'
2372+ )
23572373 patched = self .save_raw_content_remotely_patcher .start ()
23582374 patched .return_value = 'a-token'
23592375 self .addCleanup (self .save_raw_content_remotely_patcher .stop )
@@ -2564,7 +2580,9 @@ def setUp(self) -> None:
25642580 patched .return_value = 'foobar'
25652581 self .addCleanup (self .get_remote_token_patcher .stop )
25662582
2567- self .save_raw_content_remotely_patcher = mock .patch ('osis_document_components.services.save_raw_content_remotely' )
2583+ self .save_raw_content_remotely_patcher = mock .patch (
2584+ 'osis_document_components.services.save_raw_content_remotely'
2585+ )
25682586 patched = self .save_raw_content_remotely_patcher .start ()
25692587 patched .return_value = 'a-token'
25702588 self .addCleanup (self .save_raw_content_remotely_patcher .stop )
0 commit comments