[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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user