forked from ScoDoc/DocScoDoc
test: demissions
This commit is contained in:
parent
6605f02d6b
commit
0d0c391547
@ -139,7 +139,7 @@ class NotesTable:
|
||||
- identdict: { etudid : ident }
|
||||
- sem : le formsemestre
|
||||
get_table_moyennes_triees: [ (moy_gen, moy_ue1, moy_ue2, ... moy_ues, moy_mod1, ..., moy_modn, etudid) ]
|
||||
(où toutes les valeurs sont soit des nombrs soit des chaines spéciales comme 'NA', 'NI'),
|
||||
(où toutes les valeurs sont soit des nombres soit des chaines spéciales comme 'NA', 'NI'),
|
||||
incluant les UE de sport
|
||||
|
||||
- bonus[etudid] : valeur du bonus "sport".
|
||||
|
61
scotests/test_demissions.py
Normal file
61
scotests/test_demissions.py
Normal file
@ -0,0 +1,61 @@
|
||||
# -*- mode: python -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""Test inscriptions / demissions / affichages notes
|
||||
|
||||
- Création 2 étudiants, puis formation en 1 semestre.
|
||||
- Saisie de 2 notes
|
||||
- Demission d'un étudiant
|
||||
- bulletins
|
||||
|
||||
Utiliser comme:
|
||||
scotests/scointeractive.sh -r TEST00 scotests/test_demissions.py
|
||||
|
||||
"""
|
||||
|
||||
import scotests.sco_fake_gen as sco_fake_gen # pylint: disable=import-error
|
||||
import sco_utils
|
||||
import sco_bulletins
|
||||
|
||||
G = sco_fake_gen.ScoFake(context.Notes) # pylint: disable=undefined-variable
|
||||
G.verbose = False
|
||||
|
||||
# --- Création d'étudiants
|
||||
etuds = [G.create_etud(code_nip=None) for _ in range(2)]
|
||||
# --- Mise en place formation
|
||||
form, ue_list, mod_list = G.setup_formation(
|
||||
nb_semestre=1, titre="Essai 1", acronyme="ESS01"
|
||||
)
|
||||
# Mise en place semestre
|
||||
sem, eval_list = G.setup_formsemestre(
|
||||
form,
|
||||
mod_list,
|
||||
semestre_id=1,
|
||||
date_debut="01/01/2021",
|
||||
date_fin="31/12/2021",
|
||||
titre="Essai démissions",
|
||||
)
|
||||
# Inscriptions
|
||||
for etud in etuds:
|
||||
G.inscrit_etudiant(sem, etud)
|
||||
# Notes
|
||||
G.set_etud_notes_sem(sem, eval_list, etuds)
|
||||
|
||||
# Bulletins
|
||||
bul = sco_bulletins.formsemestre_bulletinetud_dict(
|
||||
context.Notes, sem["formsemestre_id"], etuds[0]["etudid"]
|
||||
)
|
||||
print(bul["moy_gen"])
|
||||
assert bul["ins"][0]["etat"] == "I"
|
||||
|
||||
# Démission:
|
||||
context.doDemEtudiant(
|
||||
etuds[0]["etudid"], sem["formsemestre_id"], event_date="15/12/2021"
|
||||
)
|
||||
bul = sco_bulletins.formsemestre_bulletinetud_dict(
|
||||
context.Notes, sem["formsemestre_id"], etuds[0]["etudid"]
|
||||
)
|
||||
print(bul["moy_gen"])
|
||||
|
||||
assert bul["moy_gen"] == "NA"
|
||||
assert bul["ins"][0]["etat"] == "D"
|
Loading…
Reference in New Issue
Block a user