1
0
forked from ScoDoc/ScoDoc

API: rétabli formation.referentiel_competence_id. Tous tests OK.

This commit is contained in:
Emmanuel Viennet 2022-12-18 22:31:42 -03:00
parent de6b187e40
commit d05ea4f002
4 changed files with 4 additions and 11 deletions

View File

@ -67,7 +67,6 @@ class Formation(db.Model):
""" """
e = dict(self.__dict__) e = dict(self.__dict__)
e.pop("_sa_instance_state", None) e.pop("_sa_instance_state", None)
e.pop("referentiel_competence_id")
if "referentiel_competence" in e: if "referentiel_competence" in e:
e.pop("referentiel_competence") e.pop("referentiel_competence")
e["departement"] = self.departement.to_dict() e["departement"] = self.departement.to_dict()

View File

@ -1,7 +1,7 @@
# -*- mode: python -*- # -*- mode: python -*-
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
SCOVERSION = "9.4.18" SCOVERSION = "9.4.19"
SCONAME = "ScoDoc" SCONAME = "ScoDoc"

View File

@ -129,11 +129,8 @@ def test_abs_groupe_etat(api_headers):
assert abs["begin"] < abs["end"] assert abs["begin"] < abs["end"]
all_unique = True # vérifie que chaque étudiant n'apparait qu'une seule fois
for id in list_id_etu: assert len(set(list_id_etu)) == len(list_id_etu)
if list_id_etu.count(id) > 1:
all_unique = False
assert all_unique is True
date_debut = "Fri, 15 Apr 2021 00:00:00 GMT" date_debut = "Fri, 15 Apr 2021 00:00:00 GMT"
date_fin = "Fri, 18 Apr 2022 00:00:00 GMT" date_fin = "Fri, 18 Apr 2022 00:00:00 GMT"

View File

@ -164,12 +164,9 @@ def create_fake_etud(dept: Departement) -> Identite:
etud.code_nip = f"{etud.id}" if (etud.id % 2) else f"NIP{etud.id}" etud.code_nip = f"{etud.id}" if (etud.id % 2) else f"NIP{etud.id}"
etud.code_ine = f"INE{etud.id}" if (etud.id % 2) else f"{etud.id}" etud.code_ine = f"INE{etud.id}" if (etud.id % 2) else f"{etud.id}"
etud.date_naissance = datetime.date(2005, 2, 1) + datetime.timedelta(days=etud.id) etud.date_naissance = datetime.date(2005, 2, 1) + datetime.timedelta(days=etud.id)
etud.adresse = [models.Adresse(email=f"{etud.prenom}.{etud.nom}@example.com")]
db.session.add(etud) db.session.add(etud)
db.session.commit() db.session.commit()
adresse = models.Adresse(
etudid=etud.id, email=f"{etud.prenom}.{etud.nom}@example.com"
)
db.session.add(adresse)
admission = models.Admission(etudid=etud.id) admission = models.Admission(etudid=etud.id)
db.session.add(admission) db.session.add(admission)
db.session.commit() db.session.commit()