Update opolka/ScoDoc from ScoDoc/ScoDoc #2

Merged
opolka merged 1272 commits from ScoDoc/ScoDoc:master into master 2024-05-27 09:11:04 +02:00
2 changed files with 12 additions and 2 deletions
Showing only changes of commit 0f5176b553 - Show all commits

View File

@ -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

View File

@ -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": "",