diff --git a/erpnext/stock/tests/test_valuation.py b/erpnext/stock/tests/test_valuation.py index e60c1caac3..05f153b4a0 100644 --- a/erpnext/stock/tests/test_valuation.py +++ b/erpnext/stock/tests/test_valuation.py @@ -132,7 +132,7 @@ class TestFIFOValuation(unittest.TestCase): total_qty = 0 for qty, rate in stock_queue: - if qty == 0: + if round_off_if_near_zero(qty) == 0: continue if qty > 0: self.queue.add_stock(qty, rate) @@ -154,7 +154,7 @@ class TestFIFOValuation(unittest.TestCase): for qty, rate in stock_queue: # don't allow negative stock - if qty == 0 or total_qty + qty < 0 or abs(qty) < 0.1: + if round_off_if_near_zero(qty) == 0 or total_qty + qty < 0 or abs(qty) < 0.1: continue if qty > 0: self.queue.add_stock(qty, rate) @@ -179,7 +179,7 @@ class TestFIFOValuation(unittest.TestCase): for qty, rate in stock_queue: # don't allow negative stock - if qty == 0 or total_qty + qty < 0 or abs(qty) < 0.1: + if round_off_if_near_zero(qty) == 0 or total_qty + qty < 0 or abs(qty) < 0.1: continue if qty > 0: self.queue.add_stock(qty, rate) @@ -282,7 +282,7 @@ class TestLIFOValuation(unittest.TestCase): total_qty = 0 for qty, rate in stock_stack: - if qty == 0: + if round_off_if_near_zero(qty) == 0: continue if qty > 0: self.stack.add_stock(qty, rate) @@ -304,7 +304,7 @@ class TestLIFOValuation(unittest.TestCase): for qty, rate in stock_stack: # don't allow negative stock - if qty == 0 or total_qty + qty < 0 or abs(qty) < 0.1: + if round_off_if_near_zero(qty) == 0 or total_qty + qty < 0 or abs(qty) < 0.1: continue if qty > 0: self.stack.add_stock(qty, rate)