Skip to content

Commit

Permalink
Adjust the tests to the pydantic version
Browse files Browse the repository at this point in the history
Signed-off-by: Aurélien Bompard <[email protected]>
  • Loading branch information
abompard committed Sep 21, 2023
1 parent 7763577 commit b2ad89b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/api/handlers/test_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
# SPDX-License-Identifier: MIT

from importlib import metadata
from unittest import mock

import httpx
Expand All @@ -18,6 +19,8 @@

from .base import BaseTestAPIV1Handler

PYDANTIC_VER = ".".join(metadata.version("pydantic").split(".")[:2])


@pytest.fixture
def publish(mocker):
Expand Down Expand Up @@ -417,7 +420,7 @@ async def test_create_user_rule_bad_matrix_dest(self, client, api_identity, db_r
"type": "value_error",
"input": "dummynick",
"ctx": {"error": {}},
"url": "https://errors.pydantic.dev/2.1/v/value_error",
"url": f"https://errors.pydantic.dev/{PYDANTIC_VER}/v/value_error",
}
]
assert caplog.messages == [expected_message]
Expand All @@ -444,7 +447,7 @@ async def test_create_user_rule_bad_email_dest(self, client, api_identity, db_ru
"type": "value_error",
"ctx": {"error": {}},
"input": "wrongvalue",
"url": "https://errors.pydantic.dev/2.1/v/value_error",
"url": f"https://errors.pydantic.dev/{PYDANTIC_VER}/v/value_error",
}
]
assert caplog.messages == [expected_message]
Expand Down

0 comments on commit b2ad89b

Please sign in to comment.