From 20bb9cc9ed22a00225d78697a317a197ed2e6502 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Thu, 22 Aug 2024 19:03:29 +0200 Subject: [PATCH] FakePortal (tests): ajout INE --- tools/fakeportal/etud_minimal_template.xml | 1 + tools/fakeportal/etud_template.xml | 1 + tools/fakeportal/fakeportal.py | 7 +++++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/fakeportal/etud_minimal_template.xml b/tools/fakeportal/etud_minimal_template.xml index 2c969615b..a8d0fc38e 100644 --- a/tools/fakeportal/etud_minimal_template.xml +++ b/tools/fakeportal/etud_minimal_template.xml @@ -1,5 +1,6 @@ {nip} + {ine} {etape} {gender} {nom} diff --git a/tools/fakeportal/etud_template.xml b/tools/fakeportal/etud_template.xml index c6243be77..fd15ad84d 100644 --- a/tools/fakeportal/etud_template.xml +++ b/tools/fakeportal/etud_template.xml @@ -1,5 +1,6 @@ {nip} + {ine} {etape} {etape}/117 {diplome}/117 diff --git a/tools/fakeportal/fakeportal.py b/tools/fakeportal/fakeportal.py index 7e9abe7e2..33b81f65a 100755 --- a/tools/fakeportal/fakeportal.py +++ b/tools/fakeportal/fakeportal.py @@ -44,9 +44,11 @@ else: } # Etudiant avec tous les champs (USPN) -ETUD_TEMPLATE_FULL = open(script_dir / "etud_template.xml").read() +ETUD_TEMPLATE_FULL = open(script_dir / "etud_template.xml", encoding="UTF-8").read() # Etudiant avec seulement les champs requis -ETUD_TEMPLATE_MINI = open(script_dir / "etud_minimal_template.xml").read() +ETUD_TEMPLATE_MINI = open( + script_dir / "etud_minimal_template.xml", encoding="UTF-8" +).read() ETUD_HEAD = """ """ @@ -68,6 +70,7 @@ def make_random_etud(nip, etape=None, annee=None, template=ETUD_TEMPLATE_FULL): diplome = "VDRT" data = template.format( nip=nip, + ine=str(random.randint(1000000000, 9999999999)) + "Z", gender=gender, nom=nom, prenom=prenom,