refactor(test): tax rule; removed setUpClass, tearDownClass

This commit is contained in:
ruthra kumar
2026-02-17 16:03:25 +05:30
parent aa998219b1
commit cb693e05bf
32 changed files with 60 additions and 184 deletions

View File

@@ -13,19 +13,16 @@ months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct",
class TestIssueAnalytics(ERPNextTestSuite):
@classmethod
def setUpClass(cls):
super().setUpClass()
frappe.db.sql("delete from `tabIssue` where company='_Test Company'")
def setUp(self):
frappe.db.set_single_value("Support Settings", "track_service_level_agreement", 1)
current_month_date = getdate()
last_month_date = add_months(current_month_date, -1)
cls.current_month = str(months[current_month_date.month - 1]).lower()
cls.last_month = str(months[last_month_date.month - 1]).lower()
self.current_month = str(months[current_month_date.month - 1]).lower()
self.last_month = str(months[last_month_date.month - 1]).lower()
if current_month_date.year != last_month_date.year:
cls.current_month += "_" + str(current_month_date.year)
cls.last_month += "_" + str(last_month_date.year)
self.current_month += "_" + str(current_month_date.year)
self.last_month += "_" + str(last_month_date.year)
def test_issue_analytics(self):
create_service_level_agreements_for_issues()