refactor: replace IntegrationTestCase with ERPNextTestCase repo-wide

- import ERPNextTestSuite
 - use it on test class
This commit is contained in:
ruthra kumar
2026-01-20 10:12:06 +05:30
parent 0fdc961a4b
commit f1dfac417d
319 changed files with 870 additions and 867 deletions

View File

@@ -4,7 +4,8 @@ import datetime
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ERPNextTestSuite
LEAD_EMAIL = "test_appointment_lead@example.com"
@@ -26,7 +27,7 @@ def create_test_appointment():
return test_appointment
class TestAppointment(IntegrationTestCase):
class TestAppointment(ERPNextTestSuite):
@classmethod
def setUpClass(cls):
super().setUpClass()

View File

@@ -3,8 +3,8 @@
# import frappe
import unittest
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ERPNextTestSuite
class TestAppointmentBookingSettings(IntegrationTestCase):
class TestAppointmentBookingSettings(ERPNextTestSuite):
pass

View File

@@ -3,8 +3,8 @@
# import frappe
import unittest
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ERPNextTestSuite
class TestCampaign(IntegrationTestCase):
class TestCampaign(ERPNextTestSuite):
pass

View File

@@ -3,8 +3,8 @@
# import frappe
import unittest
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ERPNextTestSuite
class TestCompetitor(IntegrationTestCase):
class TestCompetitor(ERPNextTestSuite):
pass

View File

@@ -3,11 +3,12 @@
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import add_days, nowdate
from erpnext.tests.utils import ERPNextTestSuite
class TestContract(IntegrationTestCase):
class TestContract(ERPNextTestSuite):
def setUp(self):
frappe.db.sql("delete from `tabContract`")
self.contract_doc = get_contract()

View File

@@ -2,8 +2,8 @@
# See license.txt
import unittest
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ERPNextTestSuite
class TestContractFulfilmentChecklist(IntegrationTestCase):
class TestContractFulfilmentChecklist(ERPNextTestSuite):
pass

View File

@@ -2,8 +2,8 @@
# See license.txt
import unittest
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ERPNextTestSuite
class TestContractTemplate(IntegrationTestCase):
class TestContractTemplate(ERPNextTestSuite):
pass

View File

@@ -3,8 +3,8 @@
# import frappe
import unittest
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ERPNextTestSuite
class TestCRMSettings(IntegrationTestCase):
class TestCRMSettings(ERPNextTestSuite):
pass

View File

@@ -3,8 +3,8 @@
# import frappe
import unittest
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ERPNextTestSuite
class TestEmailCampaign(IntegrationTestCase):
class TestEmailCampaign(ERPNextTestSuite):
pass

View File

@@ -2,8 +2,8 @@
# See license.txt
import unittest
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ERPNextTestSuite
class TestMarketSegment(IntegrationTestCase):
class TestMarketSegment(ERPNextTestSuite):
pass

View File

@@ -2,8 +2,8 @@
# See license.txt
import unittest
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ERPNextTestSuite
class TestOpportunityType(IntegrationTestCase):
class TestOpportunityType(ERPNextTestSuite):
pass

View File

@@ -3,14 +3,14 @@
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import random_string
from erpnext.crm.doctype.lead.lead import add_lead_to_prospect
from erpnext.crm.doctype.lead.test_lead import make_lead
from erpnext.tests.utils import ERPNextTestSuite
class TestProspect(IntegrationTestCase):
class TestProspect(ERPNextTestSuite):
def test_add_lead_to_prospect_and_address_linking(self):
lead_doc = make_lead()
address_doc = make_address(address_title=lead_doc.name)

View File

@@ -2,8 +2,8 @@
# See license.txt
import unittest
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ERPNextTestSuite
class TestSalesStage(IntegrationTestCase):
class TestSalesStage(ERPNextTestSuite):
pass

View File

@@ -1,8 +1,3 @@
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from erpnext.crm.report.opportunity_summary_by_sales_stage.opportunity_summary_by_sales_stage import (
execute,
)
@@ -11,9 +6,10 @@ from erpnext.crm.report.sales_pipeline_analytics.test_sales_pipeline_analytics i
create_customer,
create_opportunity,
)
from erpnext.tests.utils import ERPNextTestSuite
class TestOpportunitySummaryBySalesStage(IntegrationTestCase):
class TestOpportunitySummaryBySalesStage(ERPNextTestSuite):
@classmethod
def setUpClass(cls):
super().setUpClass()

View File

@@ -1,12 +1,12 @@
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from erpnext.crm.report.sales_pipeline_analytics.sales_pipeline_analytics import execute
from erpnext.tests.utils import ERPNextTestSuite
class TestSalesPipelineAnalytics(IntegrationTestCase):
class TestSalesPipelineAnalytics(ERPNextTestSuite):
def setUp(self):
create_company()
create_customer()