We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 140bbdf + 5b21ec2 commit dbbfea0Copy full SHA for dbbfea0
fastapi/tests/test_fastapi_demo.py
@@ -6,6 +6,7 @@
6
from requests import Response
7
8
from odoo.exceptions import UserError
9
+from odoo.tools.misc import mute_logger
10
11
from fastapi import status
12
@@ -74,6 +75,7 @@ def test_exception_raised(self) -> None:
74
75
"error_message": "User Error",
76
},
77
)
78
+
79
with self.assertRaisesRegex(NotImplementedError, "Bare Exception"):
80
with self._create_test_client() as test_client:
81
test_client.get(
@@ -84,6 +86,7 @@ def test_exception_raised(self) -> None:
84
86
85
87
88
89
+ @mute_logger("odoo.addons.fastapi.tests.common")
90
def test_exception_not_raised(self) -> None:
91
with self._create_test_client(raise_server_exceptions=False) as test_client:
92
response: Response = test_client.get(
0 commit comments