From caf4da25448412519d71c2170e1c6cca93d77ef2 Mon Sep 17 00:00:00 2001 From: Julien Castiaux Date: Mon, 27 Nov 2023 10:40:49 +0100 Subject: [PATCH] [FIX] test_http: TestHttpStatic cases were run twice Because the class was imported in this file, unittest was discovering it again and was running the TestHttpStatic cases twice: once because of its inclusion in the test_static.py file, once more because of its inclusion in the test_web_server.py file. Changing the import solved the problem, since it is a python module object that is now exposed and not test case classes, unittest doesn't discover the classes. closes odoo/odoo#143840 X-original-commit: 8067d3bf3d9f73b95595a16100096aafff5c2075 Signed-off-by: Julien Castiaux (juc) --- odoo/addons/test_http/tests/test_web_server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/odoo/addons/test_http/tests/test_web_server.py b/odoo/addons/test_http/tests/test_web_server.py index 6d9d363a69d..f8883457fc5 100644 --- a/odoo/addons/test_http/tests/test_web_server.py +++ b/odoo/addons/test_http/tests/test_web_server.py @@ -2,7 +2,7 @@ from os import getenv from odoo.tests import tagged -from .test_static import TestHttpStatic, TestHttpStaticCache +from . import test_static # Small configuration to run the tests against a web server. @@ -11,7 +11,7 @@ WEB_SERVER_URL = getenv('WEB_SERVER_URL', 'http://localhost:80') @tagged('webserver', '-standard', '-at_install') -class TestHttpStaticWebServer(TestHttpStatic, TestHttpStaticCache): +class TestHttpStaticWebServer(test_static.TestHttpStatic, test_static.TestHttpStaticCache): @classmethod def base_url(cls): return WEB_SERVER_URL