forked from ScoDoc/ScoDoc
ajout tests unitaires pour la route referentiel_competences
This commit is contained in:
parent
9faf1c48ae
commit
cacf437ef7
@ -28,6 +28,7 @@ from tests.api.tools_test_api import (
|
||||
FORMATION_EXPORT_UE_MATIERE_MODULE_FIELDS,
|
||||
FORMATION_EXPORT_UE_MATIERE_MODULE_COEF_FIELDS,
|
||||
MODULE_FIELDS,
|
||||
REF_COMP_FIELDS,
|
||||
)
|
||||
from tests.api.tools_test_api import FORMATION_FIELDS, MODIMPL_FIELDS
|
||||
|
||||
@ -263,9 +264,32 @@ def test_referentiel_competences(api_headers):
|
||||
Route: "/formation/<int:formation_id>/referentiel_competences",
|
||||
"""
|
||||
r = requests.get(
|
||||
API_URL + "/formation/1/referentiel_competences",
|
||||
f"{API_URL}/formation/1/referentiel_competences",
|
||||
headers=api_headers,
|
||||
verify=CHECK_CERTIFICATE,
|
||||
)
|
||||
assert r.status_code == 200
|
||||
# XXX TODO ajouter un referentiel competence dans la base de test
|
||||
|
||||
ref_comp = r.json()
|
||||
assert verify_fields(ref_comp, REF_COMP_FIELDS) is True
|
||||
assert isinstance(ref_comp["dept_id"], int)
|
||||
assert isinstance(ref_comp["annexe"], str)
|
||||
assert isinstance(ref_comp["specialite"], str)
|
||||
assert isinstance(ref_comp["specialite_long"], str)
|
||||
assert isinstance(ref_comp["type_structure"], str)
|
||||
assert isinstance(ref_comp["type_departement"], str)
|
||||
assert isinstance(ref_comp["type_titre"], str)
|
||||
assert isinstance(ref_comp["version_orebut"], str)
|
||||
assert isinstance(ref_comp["scodoc_date_loaded"], str)
|
||||
assert isinstance(ref_comp["scodoc_orig_filename"], str)
|
||||
assert isinstance(ref_comp["competences"], dict)
|
||||
assert isinstance(ref_comp["parcours"], dict)
|
||||
|
||||
# ERROR
|
||||
id_formation_inexistant = 1516476846861656351
|
||||
r_error = requests.get(
|
||||
f"{API_URL}/formation/{id_formation_inexistant}/referentiel_competences",
|
||||
headers=api_headers,
|
||||
verify=CHECK_CERTIFICATE,
|
||||
)
|
||||
assert r_error.status_code == 404
|
||||
|
@ -508,6 +508,21 @@ EVAL_FIELDS = {
|
||||
|
||||
SAISIE_NOTES_FIELDS = {"datetime_debut", "datetime_fin", "datetime_mediane"}
|
||||
|
||||
REF_COMP_FIELDS = {
|
||||
"dept_id",
|
||||
"annexe",
|
||||
"specialite",
|
||||
"specialite_long",
|
||||
"type_structure",
|
||||
"type_departement",
|
||||
"type_titre",
|
||||
"version_orebut",
|
||||
"scodoc_date_loaded",
|
||||
"scodoc_orig_filename",
|
||||
"competences",
|
||||
"parcours",
|
||||
}
|
||||
|
||||
ABSENCES_FIELDS = {
|
||||
"jour",
|
||||
"matin",
|
||||
|
Loading…
Reference in New Issue
Block a user