[IMP] account_tax_balance: Ensure test correctness (2)

Tests failed if you don't have an account called 'Tax Paid' in your test DB, which
can happen when you are integrating tests in other environments, for example with
other starting language.
pull/736/head
Pedro M. Baeza 2019-05-08 21:02:49 +02:00 committed by Francisco Ivan Anton Prieto
parent 44b469d0c2
commit e3a8006cf4
1 changed files with 7 additions and 2 deletions

View File

@ -34,8 +34,13 @@ class TestAccountTaxBalance(HttpCase):
self.range = self.env['date.range'] self.range = self.env['date.range']
def test_tax_balance(self): def test_tax_balance(self):
tax_account_id = self.env['account.account'].search( tax_account_id = self.env['account.account'].create({
[('name', '=', 'Tax Paid')], limit=1).id 'name': 'Tax Paid',
'code': 'TAXTEST',
'user_type_id': self.env.ref(
'account.data_account_type_current_liabilities'
).id,
}).id
tax = self.env['account.tax'].create({ tax = self.env['account.tax'].create({
'name': 'Tax 10.0%', 'name': 'Tax 10.0%',
'amount': 10.0, 'amount': 10.0,