refactor: Use IntegrationTestCase in multiple files

Signed-off-by: David <dgx.arnold@gmail.com>
This commit is contained in:
David
2024-10-08 02:13:00 +02:00
parent cd112795d3
commit 58c49dc9d2
42 changed files with 107 additions and 81 deletions

View File

@@ -1,11 +1,11 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors
# See license.txt
import unittest
import frappe
from frappe import _
from frappe.core.doctype.user_permission.test_user_permission import create_user
from frappe.tests import IntegrationTestCase
from frappe.utils import flt, get_datetime
from erpnext.support.doctype.service_level_agreement.test_service_level_agreement import (
@@ -13,7 +13,7 @@ from erpnext.support.doctype.service_level_agreement.test_service_level_agreemen
)
class TestSetUp(unittest.TestCase):
class TestSetUp(IntegrationTestCase):
def setUp(self):
frappe.db.sql("delete from `tabService Level Agreement`")
frappe.db.sql("delete from `tabService Level Priority`")

View File

@@ -1,12 +1,12 @@
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import unittest
import frappe
from frappe.tests import IntegrationTestCase
class TestIssuePriority(unittest.TestCase):
class TestIssuePriority(IntegrationTestCase):
def test_priorities(self):
make_priorities()
priorities = frappe.get_list("Issue Priority")

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 TestIssueType(unittest.TestCase):
class TestIssueType(IntegrationTestCase):
pass

View File

@@ -1,10 +1,10 @@
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import datetime
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import flt
from erpnext.support.doctype.issue_priority.test_issue_priority import make_priorities
@@ -13,7 +13,7 @@ from erpnext.support.doctype.service_level_agreement.service_level_agreement imp
)
class TestServiceLevelAgreement(unittest.TestCase):
class TestServiceLevelAgreement(IntegrationTestCase):
def setUp(self):
self.create_company()
frappe.db.set_single_value("Support Settings", "track_service_level_agreement", 1)

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 TestSupportSettings(unittest.TestCase):
class TestSupportSettings(IntegrationTestCase):
pass

View File

@@ -1,12 +1,12 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors
# See license.txt
import unittest
import frappe
from frappe.tests import IntegrationTestCase
test_records = frappe.get_test_records("Warranty Claim")
class TestWarrantyClaim(unittest.TestCase):
class TestWarrantyClaim(IntegrationTestCase):
pass

View File

@@ -2,6 +2,7 @@ import unittest
import frappe
from frappe.desk.form.assign_to import add as add_assignment
from frappe.tests import IntegrationTestCase
from frappe.utils import add_months, getdate
from erpnext.support.doctype.issue.test_issue import create_customer, make_issue
@@ -13,7 +14,7 @@ from erpnext.support.report.issue_analytics.issue_analytics import execute
months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
class TestIssueAnalytics(unittest.TestCase):
class TestIssueAnalytics(IntegrationTestCase):
@classmethod
def setUpClass(self):
frappe.db.sql("delete from `tabIssue` where company='_Test Company'")