From 88bb3ad8cd803fcfb46a7c02348312573809f8d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marques?= Date: Mon, 1 Mar 2021 11:30:14 +0000 Subject: [PATCH] [FIX] account_tax_balance: Fix tests Take into account previously created taxes TT28423 --- account_tax_balance/tests/test_account_tax_balance.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/account_tax_balance/tests/test_account_tax_balance.py b/account_tax_balance/tests/test_account_tax_balance.py index 0f11a27c..d12a4fa9 100644 --- a/account_tax_balance/tests/test_account_tax_balance.py +++ b/account_tax_balance/tests/test_account_tax_balance.py @@ -38,6 +38,9 @@ class TestAccountTaxBalance(HttpCase): self.range = self.env["date.range"] def test_tax_balance(self): + previous_taxes_ids = ( + self.env["account.tax"].search([("has_moves", "=", True)]).ids + ) tax_account_id = ( self.env["account.account"] .create( @@ -126,7 +129,9 @@ class TestAccountTaxBalance(HttpCase): self.assertEqual(action["context"]["to_date"], current_range[0].date_end) # exercise search has_moves = True - taxes = self.env["account.tax"].search([("has_moves", "=", True)]) + taxes = self.env["account.tax"].search( + [("has_moves", "=", True), ("id", "not in", previous_taxes_ids)] + ) self.assertEqual(len(taxes), 1) self.assertEqual(taxes[0].name, "Tax 10.0%")