fix: only load data for tests that need it
diff --git a/erpnext/accounts/report/tax_detail/test_tax_detail.py b/erpnext/accounts/report/tax_detail/test_tax_detail.py
index 772b9a4..78b15b1 100644
--- a/erpnext/accounts/report/tax_detail/test_tax_detail.py
+++ b/erpnext/accounts/report/tax_detail/test_tax_detail.py
@@ -69,11 +69,7 @@
'report_name': 'Tax Detail'
}, user=frappe.session.user)
- def setUp(self):
- self.load_testdocs()
- self.load_defcols()
-
- def tearDown(self):
+ def rm_testdocs(self):
"Remove the Company and all data"
from erpnext.setup.doctype.company.delete_company_transactions import delete_company_transactions
delete_company_transactions(self.company.name)
@@ -81,6 +77,8 @@
def test_report(self):
+ self.load_testdocs()
+ self.load_defcols()
report_name = save_custom_report(
'Tax Detail',
'_Test Tax Detail',
@@ -119,6 +117,8 @@
self.assertListEqual(data.get('report_summary'),
[{'label': label, 'datatype': 'Currency', 'value': value} for label, value in expected])
+ self.rm_testdocs()
+
def test_filter_match(self):
# None - treated as -inf number except range
self.assertTrue(filter_match(None, '!='))