forked from ScoDoc/DocScoDoc
Tests YAML: check autorisations inscriptions
This commit is contained in:
parent
e11b7fa076
commit
fa911907ad
@ -135,6 +135,7 @@ Etudiants:
|
||||
code_valide: AJ
|
||||
decision_jury: AJ
|
||||
moy_ue: 9.00
|
||||
autorisations_inscription: [2]
|
||||
S2:
|
||||
notes_modules: # on joue avec les SAE seulement car elles sont "diagonales"
|
||||
"S2.1": 12.00
|
||||
@ -171,6 +172,7 @@ Etudiants:
|
||||
moy_rcue: 10.50
|
||||
est_compensable: True
|
||||
decision_annee: RED
|
||||
autorisations_inscription: [1]
|
||||
S1-red:
|
||||
notes_modules: # on joue avec les SAE seulement car elles sont "diagonales"
|
||||
"S1.1": 9.50
|
||||
@ -203,6 +205,7 @@ Etudiants:
|
||||
moy_rcue: 9.50 # la moyenne courante (et non enregistrée), donc pas 10.5
|
||||
est_compensable: False
|
||||
decision_annee: ADM
|
||||
autorisations_inscription: [2]
|
||||
geii43:
|
||||
prenom: etugeii43
|
||||
civilite: M
|
||||
|
@ -29,6 +29,7 @@ from app.models import (
|
||||
UniteEns,
|
||||
)
|
||||
from app.scodoc import sco_utils as scu
|
||||
from app.scodoc import sco_pvjury
|
||||
|
||||
|
||||
def setup_formation_referentiel(formation: Formation, refcomp_infos: dict):
|
||||
@ -292,6 +293,7 @@ def but_test_jury(formsemestre: FormSemestre, doc: dict):
|
||||
"""Test jurys BUT
|
||||
Vérifie les champs de DecisionsProposeesAnnee et UEs
|
||||
"""
|
||||
dpv = None
|
||||
for etud in formsemestre.etuds:
|
||||
deca = DecisionsProposeesAnnee(etud, formsemestre)
|
||||
doc_formsemestre = doc["Etudiants"][etud.nom]["formsemestres"][
|
||||
@ -302,3 +304,18 @@ def but_test_jury(formsemestre: FormSemestre, doc: dict):
|
||||
if "deca" in doc_formsemestre["attendu"]:
|
||||
deca_att = doc_formsemestre["attendu"]["deca"]
|
||||
but_compare_decisions_annee(deca, deca_att)
|
||||
if "autorisations_inscription" in doc_formsemestre["attendu"]:
|
||||
if dpv is None: # lazy load
|
||||
dpv = sco_pvjury.dict_pvjury(formsemestre.id)
|
||||
check_autorisations_inscription(
|
||||
etud, dpv, doc_formsemestre["attendu"]["autorisations_inscription"]
|
||||
)
|
||||
|
||||
|
||||
def check_autorisations_inscription(
|
||||
etud: Identite, dpv: dict, autorisations_inscription_att: list[int]
|
||||
):
|
||||
"""Vérifie que les autorisations d'inscription"""
|
||||
dec_etud = dpv["decisions_dict"][etud.id]
|
||||
autorisations_inscription = {d["semestre_id"] for d in dec_etud["autorisations"]}
|
||||
assert autorisations_inscription == set(autorisations_inscription_att)
|
||||
|
Loading…
Reference in New Issue
Block a user