diff options
| author | Christophe Monniez <moc@odoo.com> | 2019-10-25 11:27:35 +0000 |
|---|---|---|
| committer | Christophe Monniez <moc@odoo.com> | 2019-10-30 12:35:23 +0000 |
| commit | 8d5da6e4be05428f3243f92c0464d3c1f6a43873 (patch) | |
| tree | a0fdc729641ef638d1edfb3646c463eba28f3697 /addons/web | |
| parent | b6ed34e134f868d7ccdfcb436592e0cc343fa3b5 (diff) | |
[IMP] tests: log a warning when HttpCase test in at_install
When loading a page on an existing starting database, registry is not
fully loaded causing potential error when trying to access model
existing in database (views, menitem, ...) since model added in last
loaded module does not exist in registry.
Thus, executing browser js test may lead to errors when executed during
an update on a database with other modules installed.
HTTPCase should be executed post_install to ensure that registry is
fully loaded to avoid this problem.
Since HTTPCase are slower than other test, it is also a good idea to
execute them at the end, in order to prioritize fast fail.
With this commit, a warning is isued if such a test class is tagged to
run at install time.
While at it, remove deprecated at_install and post_install helpers and
remove the deprecated phantom_js alias.
closes odoo/odoo#39462
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Diffstat (limited to 'addons/web')
| -rw-r--r-- | addons/web/tests/test_image.py | 3 | ||||
| -rw-r--r-- | addons/web/tests/test_js.py | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/addons/web/tests/test_image.py b/addons/web/tests/test_image.py index 0795d78c925..161a064516c 100644 --- a/addons/web/tests/test_image.py +++ b/addons/web/tests/test_image.py @@ -6,9 +6,10 @@ import base64 from PIL import Image -from odoo.tests.common import HttpCase +from odoo.tests.common import HttpCase, tagged +@tagged('-at_install', 'post_install') class TestImage(HttpCase): def test_01_content_image_resize_placeholder(self): """The goal of this test is to make sure the placeholder image is diff --git a/addons/web/tests/test_js.py b/addons/web/tests/test_js.py index 2547a82d978..ffaf11392f2 100644 --- a/addons/web/tests/test_js.py +++ b/addons/web/tests/test_js.py @@ -12,7 +12,7 @@ class WebSuite(odoo.tests.HttpCase): def test_js(self): # webclient desktop test suite - self.phantom_js('/web/tests?mod=web&failfast', "", "", login='admin', timeout=1800) + self.browser_js('/web/tests?mod=web&failfast', "", "", login='admin', timeout=1800) def test_check_suite(self): # verify no js test is using `QUnit.only` as it forbid any other test to be executed @@ -39,4 +39,4 @@ class MobileWebSuite(odoo.tests.HttpCase): def test_mobile_js(self): # webclient mobile test suite - self.phantom_js('/web/tests/mobile?mod=web&failfast', "", "", login='admin', timeout=1800) + self.browser_js('/web/tests/mobile?mod=web&failfast', "", "", login='admin', timeout=1800) |
