forked from ScoDoc/ScoDoc
Fix unit tests
This commit is contained in:
parent
66b8542d56
commit
12e14dc6df
@ -25,7 +25,6 @@ from app.models import (
|
||||
Matiere,
|
||||
ModuleImpl,
|
||||
)
|
||||
from app.scodoc import notesdb as ndb
|
||||
from app.scodoc import codes_cursus
|
||||
from app.scodoc import sco_edit_matiere
|
||||
from app.scodoc import sco_edit_module
|
||||
@ -41,8 +40,6 @@ from app.scodoc.sco_exceptions import ScoValueError
|
||||
from config import Config, TestConfig
|
||||
|
||||
|
||||
from tests.unit.setup import NOTES_T
|
||||
|
||||
random.seed(12345) # tests reproductibles
|
||||
|
||||
|
||||
@ -433,6 +430,8 @@ class ScoFake(object):
|
||||
notes: liste des notes (float).
|
||||
Si non spécifié, utilise la liste NOTES_T
|
||||
"""
|
||||
from tests.unit.setup import NOTES_T
|
||||
|
||||
if notes is None:
|
||||
notes = NOTES_T
|
||||
for e in eval_list:
|
||||
|
@ -7,14 +7,13 @@ from app import db, models
|
||||
from app.models import Formation
|
||||
import app.scodoc.sco_utils as scu
|
||||
from app.scodoc import codes_cursus
|
||||
from tests.unit import sco_fake_gen
|
||||
|
||||
# Valeurs des notes saisies par les tests:
|
||||
NOTES_T = [
|
||||
float(x) for x in (20, 0, 10, 13 / 7.0, 12.5, 24.0 / 11) + tuple(range(1, 19))
|
||||
]
|
||||
|
||||
from tests.unit import sco_fake_gen
|
||||
|
||||
|
||||
def build_formation_test(
|
||||
nb_mods=1,
|
||||
|
@ -127,7 +127,7 @@ def create_formsemestre(
|
||||
modules = [
|
||||
m
|
||||
for m in formsemestre.formation.modules.filter_by(semestre_id=semestre_id)
|
||||
if (not m.parcours) # module de tronc commun
|
||||
if not m.parcours # module de tronc commun
|
||||
or (not sem_parcours_ids) # semestre sans parcours => tous
|
||||
or ({p.id for p in m.parcours} & sem_parcours_ids)
|
||||
]
|
||||
@ -329,6 +329,13 @@ def setup_from_yaml(filename: str) -> tuple[dict, Formation, list[str]]:
|
||||
with open(filename, encoding="utf-8") as f:
|
||||
doc = yaml.safe_load(f.read())
|
||||
|
||||
# Passe tous les noms en majuscules (car stockés ainsi en base)
|
||||
if "Etudiants" in doc:
|
||||
doc["Etudiants"] = {k.upper(): v for (k, v) in doc["Etudiants"].items()}
|
||||
for e in doc["Etudiants"].values():
|
||||
if "prenom" in e:
|
||||
e["prenom"] = e["prenom"].upper()
|
||||
|
||||
# Charge de ref. comp. avant la formation, de façon à pouvoir
|
||||
# re-créer les associations UE/Niveaux
|
||||
yaml_setup_but.setup_formation_referentiel(doc.get("ReferentielCompetences", {}))
|
||||
|
Loading…
Reference in New Issue
Block a user