From 28992eb2f49648541cafad60084e0cd3818f0ff8 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Tue, 16 Jun 2026 19:53:27 +0530 Subject: [PATCH] test: reset dont_execute_stock_reposts flag in tearDown The test_prevention_of_cancelled_transaction_riv test sets frappe.flags.dont_execute_stock_reposts = True without resetting it, which leaked into the recalculate_valuation_rate tests and made repost() a no-op (incoming rate stayed unchanged). Reset the flag in tearDown so reposts run for subsequent tests. Co-Authored-By: Claude Opus 4.8 --- .../repost_item_valuation/test_repost_item_valuation.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erpnext/stock/doctype/repost_item_valuation/test_repost_item_valuation.py b/erpnext/stock/doctype/repost_item_valuation/test_repost_item_valuation.py index 64b303c5d92..f4af5054f62 100644 --- a/erpnext/stock/doctype/repost_item_valuation/test_repost_item_valuation.py +++ b/erpnext/stock/doctype/repost_item_valuation/test_repost_item_valuation.py @@ -22,6 +22,9 @@ from erpnext.tests.utils import ERPNextTestSuite class TestRepostItemValuation(ERPNextTestSuite, StockTestMixin): + def tearDown(self): + frappe.flags.dont_execute_stock_reposts = False + def test_repost_time_slot(self): repost_settings = frappe.get_doc("Stock Reposting Settings")