From 324674d6634b9531fe21a0f220114bffafd06a26 Mon Sep 17 00:00:00 2001 From: John Herholz Date: Sun, 18 Aug 2024 13:35:38 +0200 Subject: [PATCH] fix test request handler mock --- webservice/tests/common.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/webservice/tests/common.py b/webservice/tests/common.py index 3bbc4633..3608af3a 100644 --- a/webservice/tests/common.py +++ b/webservice/tests/common.py @@ -39,9 +39,10 @@ def _request_handler(cls, s: Session, r: PreparedRequest, /, **kw): if r.url.startswith("https://localhost.demo.odoo/") or r.url.startswith( "https://custom.url" ): - r = Response() - r.status_code = 200 - r._content = b"{}" + response = Response() + response.status_code = 200 + response.request = r + response._content = b"{}" return r return super()._request_handler(s, r, **kw)