[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.
This commit is contained in:
jem-odoo
2017-12-19 09:14:44 +01:00
parent 231c4d5fd8
commit 68a6bd8de1
@@ -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):