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,13 +1,14 @@
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from erpnext import encode_company_abbr
test_records = frappe.get_test_records("Company")
class TestInit(unittest.TestCase):
class TestInit(IntegrationTestCase):
def test_encode_company_abbr(self):
abbr = "NFECT"

View File

@@ -1,14 +1,13 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
import unittest
import frappe
from frappe.desk import notifications
from frappe.tests import IntegrationTestCase
class TestNotifications(unittest.TestCase):
class TestNotifications(IntegrationTestCase):
def test_get_notifications_for_targets(self):
"""
Test notification config entries for targets as percentages

View File

@@ -1,9 +1,9 @@
# Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from erpnext.accounts.doctype.pos_profile.test_pos_profile import make_pos_profile
from erpnext.selling.page.point_of_sale.point_of_sale import get_items
@@ -11,7 +11,7 @@ from erpnext.stock.doctype.item.test_item import make_item
from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry
class TestPointOfSale(unittest.TestCase):
class TestPointOfSale(IntegrationTestCase):
@classmethod
def setUpClass(cls) -> None:
frappe.db.savepoint("before_test_point_of_sale")

View File

@@ -1,6 +1,7 @@
import unittest
import frappe
from frappe.tests import IntegrationTestCase
import erpnext
@@ -10,7 +11,7 @@ def test_method():
return "original"
class TestInit(unittest.TestCase):
class TestInit(IntegrationTestCase):
def test_regional_overrides(self):
frappe.flags.country = "Maldives"
self.assertEqual(test_method(), "original")

View File

@@ -1,12 +1,13 @@
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from erpnext.buying.doctype.purchase_order.test_purchase_order import create_purchase_order
from erpnext.buying.doctype.supplier.test_supplier import create_supplier
class TestWebsite(unittest.TestCase):
class TestWebsite(IntegrationTestCase):
def test_permission_for_custom_doctype(self):
create_user("Supplier 1", "supplier1@gmail.com")
create_user("Supplier 2", "supplier2@gmail.com")