Skip to content

Commit 8fa3e0a

Browse files
committed
[FIX] Odoo deprecation warnings which fail the tests
1 parent 616170f commit 8fa3e0a

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

fastapi/error_handlers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def convert_exception_to_status_body(exc: Exception) -> tuple[int, dict]:
2929
status_code = exc.status_code
3030
details = exc.detail
3131
elif isinstance(exc, RequestValidationError):
32-
status_code = status.HTTP_422_UNPROCESSABLE_ENTITY
32+
status_code = status.HTTP_422_UNPROCESSABLE_CONTENT
3333
details = jsonable_encoder(exc.errors())
3434
elif isinstance(exc, WebSocketRequestValidationError):
3535
status_code = status.WS_1008_POLICY_VIOLATION

fastapi/tests/test_fastapi.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,9 @@ def test_request_validation_error(self) -> None:
156156
route = "/fastapi_demo/demo/exception?exception_type=BAD&error_message="
157157
response = self.url_open(route, timeout=200)
158158
mocked_commit.assert_not_called()
159-
self.assertEqual(response.status_code, status.HTTP_422_UNPROCESSABLE_ENTITY)
159+
self.assertEqual(
160+
response.status_code, status.HTTP_422_UNPROCESSABLE_CONTENT
161+
)
160162

161163
def test_no_commit_on_exception(self) -> None:
162164
# this test check that the way we mock the cursor is working as expected

fastapi_auth_api_key/static/description/index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<?xml version="1.0" encoding="utf-8"?>
21
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
32
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
43
<head>

0 commit comments

Comments
 (0)