mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-07 07:02:54 +00:00
refactor(test): remove redundant tearDown, tearDownClass and rollback
This commit is contained in:
@@ -18,9 +18,6 @@ from erpnext.tests.utils import ERPNextTestSuite, create_test_contact_and_addres
|
||||
|
||||
|
||||
class TestCustomer(ERPNextTestSuite):
|
||||
def tearDown(self):
|
||||
set_credit_limit("_Test Customer", "_Test Company", 0)
|
||||
|
||||
def test_get_customer_group_details(self):
|
||||
doc = frappe.new_doc("Customer Group")
|
||||
doc.customer_group_name = "_Testing Customer Group"
|
||||
@@ -180,8 +177,6 @@ class TestCustomer(ERPNextTestSuite):
|
||||
# rename back to original
|
||||
frappe.rename_doc("Customer", new_name, "_Test Customer 1")
|
||||
|
||||
frappe.db.rollback()
|
||||
|
||||
def test_freezed_customer(self):
|
||||
frappe.db.set_value("Customer", "_Test Customer", "is_frozen", 1)
|
||||
|
||||
|
||||
@@ -54,9 +54,6 @@ class TestSalesOrder(AccountsTestMixin, ERPNextTestSuite):
|
||||
def setUp(self):
|
||||
self.create_customer("_Test Customer Credit")
|
||||
|
||||
def tearDown(self):
|
||||
frappe.db.rollback()
|
||||
|
||||
@ERPNextTestSuite.change_settings(
|
||||
"Stock Settings",
|
||||
{
|
||||
|
||||
@@ -13,9 +13,6 @@ from erpnext.tests.utils import ERPNextTestSuite
|
||||
|
||||
|
||||
class TestPaymentTermsStatusForSalesOrder(ERPNextTestSuite):
|
||||
def tearDown(self):
|
||||
frappe.db.rollback()
|
||||
|
||||
def create_payment_terms_template(self):
|
||||
# create template for 50-50 payments
|
||||
template = None
|
||||
|
||||
@@ -17,9 +17,6 @@ class TestSalesPartnerTargetVarianceBasedOnItemGroup(ERPNextTestSuite):
|
||||
def setUp(self):
|
||||
self.fiscal_year = get_fiscal_year(nowdate())[0]
|
||||
|
||||
def tearDown(self):
|
||||
frappe.db.rollback()
|
||||
|
||||
def test_achieved_target_and_variance_for_partner(self):
|
||||
# Create a Target Distribution
|
||||
distribution = create_target_distribution(self.fiscal_year)
|
||||
|
||||
@@ -13,9 +13,6 @@ class TestSalesPersonTargetVarianceBasedOnItemGroup(ERPNextTestSuite):
|
||||
def setUp(self):
|
||||
self.fiscal_year = get_fiscal_year(nowdate())[0]
|
||||
|
||||
def tearDown(self):
|
||||
frappe.db.rollback()
|
||||
|
||||
def test_achieved_target_and_variance(self):
|
||||
# Create a Target Distribution
|
||||
distribution = create_target_distribution(self.fiscal_year)
|
||||
|
||||
Reference in New Issue
Block a user