mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-19 13:09:17 +00:00
refactor: Use IntegrationTestCase in multiple files
Signed-off-by: David <dgx.arnold@gmail.com>
This commit is contained in:
@@ -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"
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user