forked from ScoDoc/ScoDoc
Update opolka/ScoDoc from ScoDoc/ScoDoc #2
@ -19,4 +19,13 @@ def call_view(view_function, *args, **kwargs):
|
|||||||
|
|
||||||
def dict_include(d: dict, ref: dict) -> bool:
|
def dict_include(d: dict, ref: dict) -> bool:
|
||||||
"""Checks that all keys in ref are in d, and with the same value."""
|
"""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
|
import datetime
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
import time
|
||||||
|
|
||||||
from flask import current_app
|
from flask import current_app
|
||||||
|
|
||||||
@ -348,7 +349,7 @@ def test_import_etuds_xlsx(test_client):
|
|||||||
"nomlycee": "",
|
"nomlycee": "",
|
||||||
"apb_classement_gr": 0,
|
"apb_classement_gr": 0,
|
||||||
"villelycee": "",
|
"villelycee": "",
|
||||||
"annee": 2023,
|
"annee": time.localtime()[0], # année courante
|
||||||
"specialite": "",
|
"specialite": "",
|
||||||
"francais": "",
|
"francais": "",
|
||||||
"nom_usuel": "",
|
"nom_usuel": "",
|
||||||
|
Loading…
Reference in New Issue
Block a user