Fix test unit: test_formations

This commit is contained in:
Emmanuel Viennet 2023-01-31 14:58:24 -03:00 committed by iziram
parent 3c1acc9c00
commit 21b5474a6f
3 changed files with 3 additions and 2 deletions

View File

@ -64,7 +64,7 @@ class Formation(db.Model):
return f"""Formation {self.titre} ({self.acronyme}) [version {self.version}] code {self.formation_code}"""
def to_dict(self, with_refcomp_attrs=False):
""" "as a dict.
"""As a dict.
Si with_refcomp_attrs, ajoute attributs permettant de retrouver le ref. de comp.
"""
e = dict(self.__dict__)

View File

@ -119,6 +119,7 @@ def formation_export(
formation: Formation = Formation.query.get_or_404(formation_id)
f_dict = formation.to_dict(with_refcomp_attrs=True)
if not export_ids:
del f_dict["id"]
del f_dict["formation_id"]
del f_dict["dept_id"]
ues = formation.ues

View File

@ -178,7 +178,7 @@ def test_formations(test_client):
# --- Export de formation_id
exp = sco_formations.formation_export(
formation_id=formation_id, format="json"
formation_id=formation_id, format="json", export_ids=True
).get_data(as_text=True)
assert isinstance(exp, str)
load_exp = json.loads(exp)