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 <noreply@anthropic.com>
This commit is contained in:
Rohit Waghchaure
2026-06-16 19:53:27 +05:30
parent 0ae61c4921
commit 28992eb2f4

View File

@@ -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")