From fbdbcdd8c01f9385869e1d0813f694cdd67a03c7 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Wed, 7 May 2025 12:19:30 +0530 Subject: [PATCH] refactor(test): Activity Cost to use ERPNextTestSuite --- .../activity_cost/test_activity_cost.py | 27 +++---------------- 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/erpnext/projects/doctype/activity_cost/test_activity_cost.py b/erpnext/projects/doctype/activity_cost/test_activity_cost.py index a3eb176693a..470b21cca87 100644 --- a/erpnext/projects/doctype/activity_cost/test_activity_cost.py +++ b/erpnext/projects/doctype/activity_cost/test_activity_cost.py @@ -6,37 +6,16 @@ import frappe from frappe.tests import IntegrationTestCase from erpnext.projects.doctype.activity_cost.activity_cost import DuplicationError +from erpnext.tests.utils import ERPNextTestSuite -class TestActivityCost(IntegrationTestCase): +class TestActivityCost(ERPNextTestSuite): @classmethod def setUpClass(cls): super().setUpClass() + # TODO: only 1 employee is required cls.make_employees() - @classmethod - def make_employees(cls): - records = [ - { - "company": "_Test Company", - "date_of_birth": "1980-01-01", - "date_of_joining": "2010-01-01", - "department": "_Test Department - _TC", - "doctype": "Employee", - "first_name": "_Test Employee", - "gender": "Female", - "naming_series": "_T-Employee-", - "status": "Active", - "user_id": "test@example.com", - }, - ] - cls.employees = [] - for x in records: - if not frappe.db.exists("Employee", {"first_name": x.get("first_name")}): - cls.employees.append(frappe.get_doc(x).insert()) - else: - cls.employees.append(frappe.get_doc("Employee", {"first_name": x.get("first_name")})) - def test_duplication(self): frappe.db.sql("delete from `tabActivity Cost`") activity_cost1 = frappe.new_doc("Activity Cost")