From 59a761e4209ecea83253d65bbcfd127cdf04b286 Mon Sep 17 00:00:00 2001
From: Nikita Pastukhov <diementros@yandex.ru>
Date: Tue, 14 Nov 2023 15:31:24 +0300
Subject: [PATCH] Fix pydanticV2.5 tests
---
tests/test_annotated.py | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/tests/test_annotated.py b/tests/test_annotated.py
index 2222be97..f430d1fb 100644
--- a/tests/test_annotated.py
+++ b/tests/test_annotated.py
@@ -1,5 +1,5 @@
import pytest
-from dirty_equals import IsDict
+from dirty_equals import IsDict, IsOneOf
from fastapi import APIRouter, FastAPI, Query
from fastapi.testclient import TestClient
from fastapi.utils import match_pydantic_error_url
@@ -57,7 +57,12 @@ foo_is_short = {
{
"ctx": {"min_length": 1},
"loc": ["query", "foo"],
- "msg": "String should have at least 1 character",
+ "msg": IsOneOf(
+ # PydanticV2.4
+ "String should have at least 1 characters",
+ # PydanticV2.5
+ "String should have at least 1 character",
+ ),
"type": "string_too_short",
"input": "",
"url": match_pydantic_error_url("string_too_short"),
--
2.43.0