diff --git a/app/models/formations.py b/app/models/formations.py index f1947f731f..36e356472f 100644 --- a/app/models/formations.py +++ b/app/models/formations.py @@ -67,7 +67,6 @@ class Formation(db.Model): """ e = dict(self.__dict__) e.pop("_sa_instance_state", None) - e.pop("referentiel_competence_id") if "referentiel_competence" in e: e.pop("referentiel_competence") e["departement"] = self.departement.to_dict() diff --git a/sco_version.py b/sco_version.py index 48027b235f..5a42b639a0 100644 --- a/sco_version.py +++ b/sco_version.py @@ -1,7 +1,7 @@ # -*- mode: python -*- # -*- coding: utf-8 -*- -SCOVERSION = "9.4.18" +SCOVERSION = "9.4.19" SCONAME = "ScoDoc" diff --git a/tests/api/test_api_absences.py b/tests/api/test_api_absences.py index c57b3c1eae..d64a7002f4 100644 --- a/tests/api/test_api_absences.py +++ b/tests/api/test_api_absences.py @@ -129,11 +129,8 @@ def test_abs_groupe_etat(api_headers): assert abs["begin"] < abs["end"] - all_unique = True - for id in list_id_etu: - if list_id_etu.count(id) > 1: - all_unique = False - assert all_unique is True + # vérifie que chaque étudiant n'apparait qu'une seule fois + assert len(set(list_id_etu)) == len(list_id_etu) date_debut = "Fri, 15 Apr 2021 00:00:00 GMT" date_fin = "Fri, 18 Apr 2022 00:00:00 GMT" diff --git a/tools/fakedatabase/create_test_api_database.py b/tools/fakedatabase/create_test_api_database.py index 996007c8e9..f62f4f7285 100644 --- a/tools/fakedatabase/create_test_api_database.py +++ b/tools/fakedatabase/create_test_api_database.py @@ -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_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.adresse = [models.Adresse(email=f"{etud.prenom}.{etud.nom}@example.com")] db.session.add(etud) 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) db.session.add(admission) db.session.commit()