forked from ScoDoc/ScoDoc
Fix APi unit tests
This commit is contained in:
parent
4f07bd677c
commit
df00954bcc
@ -129,7 +129,7 @@ def check_fields(data: dict, fields: dict = None):
|
||||
"""
|
||||
assert set(data.keys()) == set(fields.keys())
|
||||
for key in data:
|
||||
if key in ("moduleimpl_id", "desc", "user_id", "external_data"):
|
||||
if key in ("moduleimpl_id", "desc", "external_data"):
|
||||
assert (
|
||||
isinstance(data[key], fields[key]) or data[key] is None
|
||||
), f"error [{key}:{type(data[key])}, {data[key]}, {fields[key]}]"
|
||||
|
@ -6,6 +6,7 @@ Ecrit par HARTMANN Matthias
|
||||
"""
|
||||
|
||||
from random import randint
|
||||
from types import NoneType
|
||||
|
||||
from tests.api.setup_test_api import (
|
||||
GET,
|
||||
@ -34,7 +35,8 @@ ASSIDUITES_FIELDS = {
|
||||
"etat": str,
|
||||
"desc": str,
|
||||
"entry_date": str,
|
||||
"user_id": str,
|
||||
"user_id": (int, NoneType),
|
||||
"user_name": (str, NoneType),
|
||||
"est_just": bool,
|
||||
"external_data": dict,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user