refactor: rollback after full test
This commit is contained in:
parent
06fa35a9c1
commit
acdb26a4bb
@ -26,6 +26,7 @@ from erpnext.tests.utils import ERPNextTestCase, change_settings
|
|||||||
class TestStockReconciliation(ERPNextTestCase):
|
class TestStockReconciliation(ERPNextTestCase):
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(self):
|
def setUpClass(self):
|
||||||
|
super().setUpClass()
|
||||||
create_batch_or_serial_no_items()
|
create_batch_or_serial_no_items()
|
||||||
frappe.db.set_value("Stock Settings", None, "allow_negative_stock", 1)
|
frappe.db.set_value("Stock Settings", None, "allow_negative_stock", 1)
|
||||||
|
|
||||||
|
@ -16,15 +16,16 @@ ReportName = NewType("ReportName", str)
|
|||||||
class ERPNextTestCase(unittest.TestCase):
|
class ERPNextTestCase(unittest.TestCase):
|
||||||
"""A sane default test class for ERPNext tests."""
|
"""A sane default test class for ERPNext tests."""
|
||||||
|
|
||||||
def setUp(self) -> None:
|
|
||||||
|
@classmethod
|
||||||
|
def setUpClass(cls) -> None:
|
||||||
frappe.db.commit()
|
frappe.db.commit()
|
||||||
return super().setUp()
|
return super().setUpClass()
|
||||||
|
|
||||||
|
@classmethod
|
||||||
def tearDown(self) -> None:
|
def tearDownClass(cls) -> None:
|
||||||
frappe.db.rollback()
|
frappe.db.rollback()
|
||||||
return super().tearDown()
|
return super().tearDownClass()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def create_test_contact_and_address():
|
def create_test_contact_and_address():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user