refactor: Use IntegrationTestCase in multiple files

Signed-off-by: David <dgx.arnold@gmail.com>
This commit is contained in:
David
2024-10-08 00:42:00 +02:00
parent cd112795d3
commit e75eebc7a0
85 changed files with 208 additions and 168 deletions

View File

@@ -1,10 +1,10 @@
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import datetime
import unittest
import frappe
from frappe.tests import IntegrationTestCase
LEAD_EMAIL = "test_appointment_lead@example.com"
@@ -26,7 +26,7 @@ def create_test_appointment():
return test_appointment
class TestAppointment(unittest.TestCase):
class TestAppointment(IntegrationTestCase):
def setUpClass():
frappe.db.delete("Lead", {"email_id": LEAD_EMAIL})

View File

@@ -1,9 +1,10 @@
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
# import frappe
import unittest
from frappe.tests import IntegrationTestCase
class TestAppointmentBookingSettings(unittest.TestCase):
class TestAppointmentBookingSettings(IntegrationTestCase):
pass

View File

@@ -1,9 +1,10 @@
# Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
# import frappe
import unittest
from frappe.tests import IntegrationTestCase
class TestCampaign(unittest.TestCase):
class TestCampaign(IntegrationTestCase):
pass

View File

@@ -1,9 +1,10 @@
# Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
# import frappe
import unittest
from frappe.tests import IntegrationTestCase
class TestCompetitor(unittest.TestCase):
class TestCompetitor(IntegrationTestCase):
pass

View File

@@ -1,13 +1,13 @@
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import add_days, nowdate
class TestContract(unittest.TestCase):
class TestContract(IntegrationTestCase):
def setUp(self):
frappe.db.sql("delete from `tabContract`")
self.contract_doc = get_contract()

View File

@@ -1,8 +1,9 @@
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import unittest
from frappe.tests import IntegrationTestCase
class TestContractFulfilmentChecklist(unittest.TestCase):
class TestContractFulfilmentChecklist(IntegrationTestCase):
pass

View File

@@ -1,8 +1,9 @@
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import unittest
from frappe.tests import IntegrationTestCase
class TestContractTemplate(unittest.TestCase):
class TestContractTemplate(IntegrationTestCase):
pass

View File

@@ -1,9 +1,10 @@
# Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
# import frappe
import unittest
from frappe.tests import IntegrationTestCase
class TestCRMSettings(unittest.TestCase):
class TestCRMSettings(IntegrationTestCase):
pass

View File

@@ -1,9 +1,10 @@
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
# import frappe
import unittest
from frappe.tests import IntegrationTestCase
class TestEmailCampaign(unittest.TestCase):
class TestEmailCampaign(IntegrationTestCase):
pass

View File

@@ -1,10 +1,9 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import random_string, today
from erpnext.crm.doctype.lead.lead import make_opportunity
@@ -13,7 +12,7 @@ from erpnext.crm.utils import get_linked_prospect
test_records = frappe.get_test_records("Lead")
class TestLead(unittest.TestCase):
class TestLead(IntegrationTestCase):
def test_make_customer(self):
from erpnext.crm.doctype.lead.lead import make_customer

View File

@@ -1,8 +1,9 @@
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import unittest
from frappe.tests import IntegrationTestCase
class TestMarketSegment(unittest.TestCase):
class TestMarketSegment(IntegrationTestCase):
pass

View File

@@ -1,9 +1,9 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors
# See license.txt
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import now_datetime, random_string, today
from erpnext.crm.doctype.lead.lead import make_customer
@@ -14,7 +14,7 @@ from erpnext.crm.utils import get_linked_communication_list
test_records = frappe.get_test_records("Opportunity")
class TestOpportunity(unittest.TestCase):
class TestOpportunity(IntegrationTestCase):
def test_opportunity_status(self):
doc = make_opportunity(with_items=0)
quotation = make_quotation(doc.name)

View File

@@ -1,8 +1,9 @@
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import unittest
from frappe.tests import IntegrationTestCase
class TestOpportunityType(unittest.TestCase):
class TestOpportunityType(IntegrationTestCase):
pass

View File

@@ -1,16 +1,16 @@
# Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
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
class TestProspect(unittest.TestCase):
class TestProspect(IntegrationTestCase):
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

@@ -1,8 +1,9 @@
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import unittest
from frappe.tests import IntegrationTestCase
class TestSalesStage(unittest.TestCase):
class TestSalesStage(IntegrationTestCase):
pass

View File

@@ -1,6 +1,7 @@
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,
@@ -12,7 +13,7 @@ from erpnext.crm.report.sales_pipeline_analytics.test_sales_pipeline_analytics i
)
class TestOpportunitySummaryBySalesStage(unittest.TestCase):
class TestOpportunitySummaryBySalesStage(IntegrationTestCase):
@classmethod
def setUpClass(self):
frappe.db.delete("Opportunity")