From a447c6e5f99ed4763797c07c3638e6d42444ee8d Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Thu, 30 Sep 2021 14:35:21 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20regression:=20validations=20UE=20quand=20?= =?UTF-8?q?semestre=20valid=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/scodoc/sco_parcours_dut.py | 2 +- tests/unit/test_sco_basic.py | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/app/scodoc/sco_parcours_dut.py b/app/scodoc/sco_parcours_dut.py index be4f983f3..cb10bf4b5 100644 --- a/app/scodoc/sco_parcours_dut.py +++ b/app/scodoc/sco_parcours_dut.py @@ -916,7 +916,7 @@ def formsemestre_validate_ues(formsemestre_id, etudid, code_etat_sem, assiduite) and ue_status["moy"] >= nt.parcours.NOTES_BARRE_VALID_UE ): code_ue = ADM - elif isinstance(ue_status["moy"], float): + elif not isinstance(ue_status["moy"], float): # aucune note (pas de moyenne) dans l'UE: ne la valide pas code_ue = None elif valid_semestre: diff --git a/tests/unit/test_sco_basic.py b/tests/unit/test_sco_basic.py index 88f3bd991..6917ee615 100644 --- a/tests/unit/test_sco_basic.py +++ b/tests/unit/test_sco_basic.py @@ -27,6 +27,7 @@ from app.scodoc import sco_codes_parcours from app.scodoc import sco_evaluations from app.scodoc import sco_formsemestre_validation from app.scodoc import sco_parcours_dut +from app.scodoc import sco_cache from app.scodoc import sco_saisie_notes from app.scodoc import sco_utils as scu @@ -197,3 +198,19 @@ def run_sco_basic(verbose=False): assert not sco_parcours_dut.formsemestre_has_decisions( sem["formsemestre_id"] ), "décisions non effacées" + + # --- Décision de jury et validations des ECTS d'UE + for etud in etuds[:5]: # les etudiants notés + sco_formsemestre_validation.formsemestre_validation_etud_manu( + sem["formsemestre_id"], + etud["etudid"], + code_etat=sco_codes_parcours.ADJ, + assidu=True, + redirect=False, + ) + # Vérifie que toutes les UE des étudiants notés ont été acquises: + nt = sco_cache.NotesTableCache.get(sem["formsemestre_id"]) + for etud in etuds[:5]: + dec_ues = nt.get_etud_decision_ues(etud["etudid"]) + for ue_id in dec_ues: + assert dec_ues[ue_id]["code"] in {"ADM", "CMP"}