Browse Source

test: use IsOneOf

pull/10647/head
Nikita Pastukhov 2 years ago
parent
commit
9677975204
  1. 8
      tests/test_annotated.py

8
tests/test_annotated.py

@ -1,5 +1,5 @@
import pytest import pytest
from dirty_equals import IsDict, IsStr from dirty_equals import IsDict, IsOneOf
from fastapi import APIRouter, FastAPI, Query from fastapi import APIRouter, FastAPI, Query
from fastapi.testclient import TestClient from fastapi.testclient import TestClient
from fastapi.utils import match_pydantic_error_url from fastapi.utils import match_pydantic_error_url
@ -57,11 +57,11 @@ foo_is_short = {
{ {
"ctx": {"min_length": 1}, "ctx": {"min_length": 1},
"loc": ["query", "foo"], "loc": ["query", "foo"],
"msg": ( "msg": IsOneOf(
# PydanticV2.4 # PydanticV2.4
IsStr("String should have at least 1 characters") or "String should have at least 1 characters",
# PydanticV2.5 # PydanticV2.5
IsStr("String should have at least 1 character"), "String should have at least 1 character",
), ),
"type": "string_too_short", "type": "string_too_short",
"input": "", "input": "",

Loading…
Cancel
Save