FakePortal (tests): ajout INE

This commit is contained in:
Emmanuel Viennet 2024-08-22 19:03:29 +02:00
parent 8a6b167f8c
commit 20bb9cc9ed
3 changed files with 7 additions and 2 deletions

View File

@ -1,5 +1,6 @@
<etudiant>
<nip>{nip}</nip>
<ine>{ine}</ine>
<etape>{etape}</etape>
<gender>{gender}</gender>
<nom>{nom}</nom>

View File

@ -1,5 +1,6 @@
<etudiant>
<nip>{nip}</nip>
<ine>{ine}</ine>
<etape>{etape}</etape>
<versionetape>{etape}/117</versionetape>
<versiondiplome>{diplome}/117</versiondiplome>

View File

@ -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 = """<?xml version="1.0" encoding="UTF-8"?>
<etudiants>"""
@ -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,