From 9386c1328ad933186778677ec1c7e0a5a76de879 Mon Sep 17 00:00:00 2001 From: ljain112 Date: Tue, 31 Mar 2026 17:46:46 +0530 Subject: [PATCH] test: improve test case (cherry picked from commit b73b161cbed791a8eb5e2f2939ed85a9c6534b50) --- erpnext/controllers/tests/test_item_wise_tax_details.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/controllers/tests/test_item_wise_tax_details.py b/erpnext/controllers/tests/test_item_wise_tax_details.py index a921442472e..7e19c1dc057 100644 --- a/erpnext/controllers/tests/test_item_wise_tax_details.py +++ b/erpnext/controllers/tests/test_item_wise_tax_details.py @@ -1,6 +1,7 @@ import json import frappe +from frappe.utils import flt from erpnext.tests.utils import ERPNextTestSuite, change_settings @@ -257,9 +258,8 @@ class TestTaxesAndTotals(ERPNextTestSuite): # item 1: taxable=100, tax=9.0; item 2: taxable=57, tax=5.13; item 3: taxable=1000, tax=90.0 # error diffusion: 14.13 - 9.0 = 5.130000000000001 without rounding - # 3rd item ensures the artifact is on a middle row (not corrected by last-row adjustment) for detail in doc.item_wise_tax_details: - self.assertEqual(detail.amount, round(detail.amount, 2)) + self.assertEqual(detail.amount, flt(detail.amount, detail.precision("amount"))) def test_item_wise_tax_detail_with_multi_currency_with_single_item(self): """