From 68a6bd8de1c0f574e62317cd76e4dda0968ad360 Mon Sep 17 00:00:00 2001 From: jem-odoo Date: Wed, 13 Dec 2017 14:35:55 +0100 Subject: [PATCH] [IMP] account: add log warning when skipping a test Accounting tests are done 'post install' because their generally requried a chart of account to be installed before test execution. If a test is launched before l10n install, the test will be skipped but nobody will know it, unless you read all the logs of your server. When skipping a test, a warning should be displayed. --- addons/account/tests/account_test_classes.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addons/account/tests/account_test_classes.py b/addons/account/tests/account_test_classes.py index 20a77148bf7..42ba9268187 100644 --- a/addons/account/tests/account_test_classes.py +++ b/addons/account/tests/account_test_classes.py @@ -1,4 +1,8 @@ # -*- coding: utf-8 -*- + +import logging +_logger = logging.getLogger(__name__) + from odoo.tests.common import HttpCase from odoo.exceptions import ValidationError @@ -16,6 +20,7 @@ class AccountingTestCase(HttpCase): super(AccountingTestCase, self).setUp() domain = [('company_id', '=', self.env.ref('base.main_company').id)] if not self.env['account.account'].search_count(domain): + _logger.warn('Test skipped because there is no chart of account defined ...') self.skipTest("No Chart of account found") def check_complete_move(self, move, theorical_lines):