Adapte les tests unitaires jury BUT

This commit is contained in:
IDK 2023-06-28 21:25:01 +02:00 committed by iziram
parent b78f8e19a1
commit b4c10146a9

View File

@ -247,7 +247,7 @@ def but_compare_decisions_annee(deca: DecisionsProposeesAnnee, deca_att: dict):
but_check_decisions_ues(deca.decisions_ues, deca_att["decisions_ues"])
if "nb_rcues_annee" in deca_att:
assert deca_att["nb_rcues_annee"] == len(deca.rcues_annee)
assert deca_att["nb_rcues_annee"] == len(deca.get_decisions_rcues_annee())
if "decisions_rcues" in deca_att:
but_check_decisions_rcues(
@ -282,14 +282,12 @@ def check_deca_fields(formsemestre: FormSemestre, etud: Identite = None):
.filter(UniteEns.semestre_idx == formsemestre.semestre_id)
.all()
)
assert len(ues) == len(deca.decisions_rcue_by_niveau.values())
if formsemestre.semestre_id % 2:
assert deca.formsemestre_impair == formsemestre
assert ues == deca.ues_impair
else:
assert deca.formsemestre_pair == formsemestre
assert ues == deca.ues_pair
assert deca.inscription_etat == scu.INSCRIT
assert deca.inscription_etat_impair == scu.INSCRIT
assert (deca.parcour is None) or (
deca.parcour.id in {p.id for p in formsemestre.parcours}
)