forked from ScoDoc/ScoDoc
debut d'ajout d'etapes apoge pour la base de tests unitaires
This commit is contained in:
parent
23e2a5c427
commit
7cb6dd66c3
@ -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)
|
||||
|
@ -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`
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user