ajout d'étapes apo dans la base de tests unitaires

This commit is contained in:
leonard_montalbano 2022-06-27 16:11:48 +02:00
parent 7cb6dd66c3
commit 35a6427e2f

View File

@ -38,7 +38,8 @@ from app.models import (
NotesNotes,
ApcReferentielCompetences,
ApcCompetence,
Absence, FormSemestreEtape,
Absence,
FormSemestreEtape,
)
from app import db
from app.models.but_refcomp import (
@ -486,8 +487,24 @@ def create_etape_apo(formsemestre: FormSemestre):
"""
Ajoute étape apoge au formsemestre
"""
etape_apo = FormSemestreEtape(id=1, formsemestre_id=formsemestre.id, etape_apo="A1")
formsemestre.etapes = etape_apo
etape_apo1 = FormSemestreEtape(
id=1, formsemestre_id=formsemestre.id, etape_apo="A1"
)
db.session.add(etape_apo1)
etape_apo2 = FormSemestreEtape(
id=2, formsemestre_id=formsemestre.id, etape_apo="A2"
)
db.session.add(etape_apo2)
etape_apo3 = FormSemestreEtape(
id=3, formsemestre_id=formsemestre.id, etape_apo="A3"
)
db.session.add(etape_apo3)
list_etapes = [etape_apo1, etape_apo2, etape_apo3]
formsemestre.etapes = list_etapes
db.session.commit()
def init_test_database():