summaryrefslogtreecommitdiff
path: root/addons/test_mail
diff options
context:
space:
mode:
authorChristophe Monniez <moc@odoo.com>2019-10-25 11:27:35 +0000
committerChristophe Monniez <moc@odoo.com>2019-10-30 12:35:23 +0000
commit8d5da6e4be05428f3243f92c0464d3c1f6a43873 (patch)
treea0fdc729641ef638d1edfb3646c463eba28f3697 /addons/test_mail
parentb6ed34e134f868d7ccdfcb436592e0cc343fa3b5 (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/test_mail')
-rw-r--r--addons/test_mail/tests/test_mail_redirect.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/test_mail/tests/test_mail_redirect.py b/addons/test_mail/tests/test_mail_redirect.py
index 6149e2f429b..706a9704319 100644
--- a/addons/test_mail/tests/test_mail_redirect.py
+++ b/addons/test_mail/tests/test_mail_redirect.py
@@ -2,9 +2,10 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from werkzeug.urls import url_decode, url_parse
-from odoo.tests.common import HttpCase
+from odoo.tests.common import HttpCase, tagged
+@tagged('-at_install', 'post_install')
class TestMultiCompany(HttpCase):
def test_redirect_to_records(self):