forked from ScoDoc/ScoDoc
Fix unit test (admission etudiant dans annee courante)
This commit is contained in:
parent
85f0323a80
commit
0f5176b553
@ -19,4 +19,13 @@ def call_view(view_function, *args, **kwargs):
|
||||
|
||||
def dict_include(d: dict, ref: dict) -> bool:
|
||||
"""Checks that all keys in ref are in d, and with the same value."""
|
||||
return all((k in d) and (d[k] == ref[k]) for k in ref)
|
||||
# quick check
|
||||
ok = all((k in d) and (d[k] == ref[k]) for k in ref)
|
||||
if ok:
|
||||
return True
|
||||
# more details to ease debugging
|
||||
assert not (ref.keys() - d.keys()), "Keys missing"
|
||||
# identical keys, check values
|
||||
for k, v in ref.items():
|
||||
assert d[k] == v, "invalid value"
|
||||
return False
|
||||
|
@ -9,6 +9,7 @@ Utiliser comme:
|
||||
"""
|
||||
import datetime
|
||||
from pathlib import Path
|
||||
import time
|
||||
|
||||
from flask import current_app
|
||||
|
||||
@ -348,7 +349,7 @@ def test_import_etuds_xlsx(test_client):
|
||||
"nomlycee": "",
|
||||
"apb_classement_gr": 0,
|
||||
"villelycee": "",
|
||||
"annee": 2023,
|
||||
"annee": time.localtime()[0], # année courante
|
||||
"specialite": "",
|
||||
"francais": "",
|
||||
"nom_usuel": "",
|
||||
|
Loading…
Reference in New Issue
Block a user