diff --git a/webservice/tests/common.py b/webservice/tests/common.py index f1e018ff..8619f224 100644 --- a/webservice/tests/common.py +++ b/webservice/tests/common.py @@ -37,10 +37,10 @@ def setUpClass(cls): @classmethod def _request_handler(cls, s: Session, r: PreparedRequest, /, **kw): - if r.url.startswith("http://localhost.demo.odoo/") or r.url.startswith( + if r.url.startswith("https://localhost.demo.odoo/") or r.url.startswith( "https://custom.url" ): - return cls._super_send(s, r, **kw) + return cls._super_send(r, **kw) return super()._request_handler(s, r, **kw) diff --git a/webservice/tests/test_webservice.py b/webservice/tests/test_webservice.py index b6c4b224..3c7fc312 100644 --- a/webservice/tests/test_webservice.py +++ b/webservice/tests/test_webservice.py @@ -16,7 +16,7 @@ class TestWebService(CommonWebService): @classmethod def _setup_records(cls): res = super()._setup_records() - cls.url = "http://localhost.demo.odoo/" + cls.url = "https://localhost.demo.odoo/" cls.webservice = cls.env["webservice.backend"].create( { "name": "WebService", @@ -104,7 +104,7 @@ def test_web_service_get_url_combine(self): def test_web_service_get_url_combine_full_url(self): endpoint = "api/test" responses.add(responses.GET, self.url + endpoint, body="{}") - result = self.webservice.call("get", url="http://localhost.demo.odoo/api/test") + result = self.webservice.call("get", url="https://localhost.demo.odoo/api/test") self.assertEqual(result, b"{}") self.assertEqual(len(responses.calls), 1) self.assertEqual(