Skip to content

Commit

Permalink
Merge PR OCA#476 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by lmignon
  • Loading branch information
OCA-git-bot committed Jan 6, 2025
2 parents 140bbdf + 5b21ec2 commit dbbfea0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fastapi/tests/test_fastapi_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from requests import Response

from odoo.exceptions import UserError
from odoo.tools.misc import mute_logger

from fastapi import status

Expand Down Expand Up @@ -74,6 +75,7 @@ def test_exception_raised(self) -> None:
"error_message": "User Error",
},
)

with self.assertRaisesRegex(NotImplementedError, "Bare Exception"):
with self._create_test_client() as test_client:
test_client.get(
Expand All @@ -84,6 +86,7 @@ def test_exception_raised(self) -> None:
},
)

@mute_logger("odoo.addons.fastapi.tests.common")
def test_exception_not_raised(self) -> None:
with self._create_test_client(raise_server_exceptions=False) as test_client:
response: Response = test_client.get(
Expand Down

0 comments on commit dbbfea0

Please sign in to comment.