debut d'ajout d'etapes apoge pour la base de tests unitaires

This commit is contained in:
leonard_montalbano 2022-06-24 16:04:40 +02:00
parent 23e2a5c427
commit 7cb6dd66c3
2 changed files with 13 additions and 0 deletions

View File

@ -474,6 +474,11 @@ class FormSemestreEtape(db.Model):
# etape_apo aurait du etre not null, mais oublié
etape_apo = db.Column(db.String(APO_CODE_STR_LEN), index=True)
def __init__(self, id, formsemestre_id, etape_apo):
self.id = id
self.formsemestre_id = formsemestre_id
self.etape_apo = etape_apo
def __bool__(self):
"Etape False if code empty"
return self.etape_apo is not None and (len(self.etape_apo) > 0)

View File

@ -482,6 +482,14 @@ def add_absences(formsemestre: FormSemestre):
id_db += 1
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
def init_test_database():
"""Appelé par la commande `flask init-test-database`