refactor: rollback after full test
diff --git a/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py
index b0a1537..e82401d 100644
--- a/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py
+++ b/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py
@@ -26,6 +26,7 @@
class TestStockReconciliation(ERPNextTestCase):
@classmethod
def setUpClass(self):
+ super().setUpClass()
create_batch_or_serial_no_items()
frappe.db.set_value("Stock Settings", None, "allow_negative_stock", 1)
diff --git a/erpnext/tests/utils.py b/erpnext/tests/utils.py
index 95e5668..91df548 100644
--- a/erpnext/tests/utils.py
+++ b/erpnext/tests/utils.py
@@ -16,15 +16,16 @@
class ERPNextTestCase(unittest.TestCase):
"""A sane default test class for ERPNext tests."""
- def setUp(self) -> None:
+
+ @classmethod
+ def setUpClass(cls) -> None:
frappe.db.commit()
- return super().setUp()
+ return super().setUpClass()
-
- def tearDown(self) -> None:
+ @classmethod
+ def tearDownClass(cls) -> None:
frappe.db.rollback()
- return super().tearDown()
-
+ return super().tearDownClass()
def create_test_contact_and_address():