From e3a8006cf4e1ff295e5749eb978bc27b9069b51f Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Wed, 8 May 2019 21:02:49 +0200 Subject: [PATCH] [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. --- account_tax_balance/tests/test_account_tax_balance.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/account_tax_balance/tests/test_account_tax_balance.py b/account_tax_balance/tests/test_account_tax_balance.py index b27ca0a8..6c140162 100644 --- a/account_tax_balance/tests/test_account_tax_balance.py +++ b/account_tax_balance/tests/test_account_tax_balance.py @@ -34,8 +34,13 @@ class TestAccountTaxBalance(HttpCase): self.range = self.env['date.range'] def test_tax_balance(self): - tax_account_id = self.env['account.account'].search( - [('name', '=', 'Tax Paid')], limit=1).id + tax_account_id = self.env['account.account'].create({ + '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({ 'name': 'Tax 10.0%', 'amount': 10.0,