Fix API unit tests (assoc niveaux formation test)
This commit is contained in:
parent
f31eca97bb
commit
09d59848d6
@ -78,6 +78,13 @@ def import_formation(dept_id: int) -> Formation:
|
||||
)
|
||||
formation.referentiel_competence_id = ref_comp.id
|
||||
db.session.add(formation)
|
||||
# --- Association niveaux de compétences aux UE de S1:
|
||||
niveaux = ref_comp.get_niveaux_by_parcours(1)[1]["TC"]
|
||||
ues = formation.ues.filter_by(semestre_idx=1).all()
|
||||
assert len(niveaux) == len(ues) # le ref comp et les formation doivent correspondre
|
||||
for ue, niveau in zip(ues, niveaux):
|
||||
ue.niveau_competence = niveau
|
||||
db.session.add(ue)
|
||||
db.session.commit()
|
||||
return formation
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user