Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions extendable_fastapi/tests/test_generic_extendable.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# Copyright 2023 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from fastapi.exceptions import ResponseValidationError
from requests import Response

from odoo.tests.common import tagged

from fastapi.exceptions import ResponseValidationError

from .common import FastAPITransactionCase
from .routers import demo_pydantic_router
from .schemas import PrivateCustomer, PrivateUser, User
Expand Down Expand Up @@ -87,7 +86,7 @@ def test_post_user(self):

with self._create_test_client(router=demo_pydantic_router) as test_client:
response: Response = test_client.post(
"/post_user", content=pydantic_data.model_dump_json()
"/post_user", json=pydantic_data.model_dump()
)
self.assertEqual(response.status_code, 200)
res = response.json()
Expand Down Expand Up @@ -115,7 +114,7 @@ def test_post_private_user(self):

with self._create_test_client(router=demo_pydantic_router) as test_client:
response: Response = test_client.post(
"/post_private_user", content=pydantic_data.model_dump_json()
"/post_private_user", json=pydantic_data.model_dump()
)
self.assertEqual(response.status_code, 200)
user = response.json()
Expand Down Expand Up @@ -143,7 +142,7 @@ def test_post_private_user_generic(self):

with self._create_test_client(router=demo_pydantic_router) as test_client:
response: Response = test_client.post(
"/post_private_user_generic", content=pydantic_data.model_dump_json()
"/post_private_user_generic", json=pydantic_data.model_dump()
)
self.assertEqual(response.status_code, 200)
res = response.json()
Expand Down Expand Up @@ -206,5 +205,6 @@ def test_extra_forbid_response_fails(self):
self._create_test_client(router=demo_pydantic_router) as test_client,
):
test_client.post(
"/post_private_customer", content=pydantic_data.model_dump_json()
"/post_private_customer",
json=pydantic_data.model_dump(),
)