Files
odoo_source/odoo/addons/test_http/tests/test_web_server.py
T
Julien Castiaux caf4da2544 [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) <juc@odoo.com>
2023-12-01 15:51:53 +00:00

28 lines
996 B
Python

# Part of Odoo. See LICENSE file for full copyright and licensing details.
from os import getenv
from odoo.tests import tagged
from . import test_static
# Small configuration to run the tests against a web server.
# WEB_SERVER_URL=http://localhost:80 odoo-bin -i test_http --test-tags webserver
WEB_SERVER_URL = getenv('WEB_SERVER_URL', 'http://localhost:80')
@tagged('webserver', '-standard', '-at_install')
class TestHttpStaticWebServer(test_static.TestHttpStatic, test_static.TestHttpStaticCache):
@classmethod
def base_url(cls):
return WEB_SERVER_URL
def assertDownloadGizeh(self, url, x_sendfile=None, assert_filename='gizeh.png'):
# X-Sendfile and X-Accel-Redirect http response headers should
# have been consummed by the web server. We should get the
# ultimate response which holds the file.
return super().assertDownloadGizeh(
url,
x_sendfile=False,
assert_filename=assert_filename
)