mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-21 18:29:57 +00:00
refactor: replace IntegrationTestCase with ERPNextTestCase repo-wide
- import ERPNextTestSuite - use it on test class
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
# See license.txt
|
||||
import unittest
|
||||
|
||||
from frappe.tests import IntegrationTestCase
|
||||
from erpnext.tests.utils import ERPNextTestSuite
|
||||
|
||||
|
||||
class TestAuthorizationRule(IntegrationTestCase):
|
||||
class TestAuthorizationRule(ERPNextTestSuite):
|
||||
pass
|
||||
|
||||
@@ -4,10 +4,10 @@ import unittest
|
||||
from unittest import mock
|
||||
|
||||
import frappe
|
||||
from frappe.tests import IntegrationTestCase
|
||||
from frappe.utils import cint, flt
|
||||
|
||||
from erpnext.setup.utils import get_exchange_rate
|
||||
from erpnext.tests.utils import ERPNextTestSuite
|
||||
|
||||
|
||||
def save_new_records(test_records):
|
||||
@@ -78,7 +78,7 @@ def patched_requests_get(*args, **kwargs):
|
||||
|
||||
|
||||
@mock.patch("requests.get", side_effect=patched_requests_get)
|
||||
class TestCurrencyExchange(IntegrationTestCase):
|
||||
class TestCurrencyExchange(ERPNextTestSuite):
|
||||
def clear_cache(self):
|
||||
cache = frappe.cache()
|
||||
for date in test_exchange_values.keys():
|
||||
|
||||
@@ -3,10 +3,11 @@
|
||||
import unittest
|
||||
|
||||
import frappe
|
||||
from frappe.tests import IntegrationTestCase
|
||||
|
||||
from erpnext.tests.utils import ERPNextTestSuite
|
||||
|
||||
|
||||
class TestDepartment(IntegrationTestCase):
|
||||
class TestDepartment(ERPNextTestSuite):
|
||||
def test_remove_department_data(self):
|
||||
doc = create_department("Test Department")
|
||||
frappe.delete_doc("Department", doc.name)
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
# See license.txt
|
||||
import unittest
|
||||
|
||||
from frappe.tests import IntegrationTestCase
|
||||
from erpnext.tests.utils import ERPNextTestSuite
|
||||
|
||||
|
||||
class TestDriver(IntegrationTestCase):
|
||||
class TestDriver(ERPNextTestSuite):
|
||||
pass
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
# See license.txt
|
||||
import unittest
|
||||
|
||||
from frappe.tests import IntegrationTestCase
|
||||
from erpnext.tests.utils import ERPNextTestSuite
|
||||
|
||||
|
||||
class TestEmailDigest(IntegrationTestCase):
|
||||
class TestEmailDigest(ERPNextTestSuite):
|
||||
pass
|
||||
|
||||
@@ -5,14 +5,14 @@ import unittest
|
||||
import frappe
|
||||
import frappe.utils
|
||||
from frappe.query_builder import Criterion
|
||||
from frappe.tests import IntegrationTestCase
|
||||
|
||||
import erpnext
|
||||
from erpnext.accounts.utils import build_qb_match_conditions
|
||||
from erpnext.setup.doctype.employee.employee import InactiveEmployeeStatusError
|
||||
from erpnext.tests.utils import ERPNextTestSuite
|
||||
|
||||
|
||||
class TestEmployee(IntegrationTestCase):
|
||||
class TestEmployee(ERPNextTestSuite):
|
||||
def test_employee_status_left(self):
|
||||
employee1 = make_employee("test_employee_1@company.com")
|
||||
employee2 = make_employee("test_employee_2@company.com")
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
import unittest
|
||||
|
||||
import frappe
|
||||
from frappe.tests import IntegrationTestCase
|
||||
|
||||
from erpnext.setup.doctype.employee.test_employee import make_employee
|
||||
from erpnext.tests.utils import ERPNextTestSuite
|
||||
|
||||
|
||||
class TestEmployeeGroup(IntegrationTestCase):
|
||||
class TestEmployeeGroup(ERPNextTestSuite):
|
||||
pass
|
||||
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
# See license.txt
|
||||
import unittest
|
||||
|
||||
from frappe.tests import IntegrationTestCase
|
||||
from erpnext.tests.utils import ERPNextTestSuite
|
||||
|
||||
|
||||
class TestGlobalDefaults(IntegrationTestCase):
|
||||
class TestGlobalDefaults(ERPNextTestSuite):
|
||||
pass
|
||||
|
||||
@@ -5,13 +5,13 @@ from contextlib import contextmanager
|
||||
from datetime import date, timedelta
|
||||
|
||||
import frappe
|
||||
from frappe.tests import IntegrationTestCase
|
||||
from frappe.utils import getdate
|
||||
|
||||
from erpnext.setup.doctype.holiday_list.holiday_list import local_country_name
|
||||
from erpnext.tests.utils import ERPNextTestSuite
|
||||
|
||||
|
||||
class TestHolidayList(IntegrationTestCase):
|
||||
class TestHolidayList(ERPNextTestSuite):
|
||||
def test_holiday_list(self):
|
||||
today_date = getdate()
|
||||
test_holiday_dates = [today_date - timedelta(days=5), today_date - timedelta(days=4)]
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
# See license.txt
|
||||
|
||||
# import frappe
|
||||
from frappe.tests import IntegrationTestCase
|
||||
|
||||
|
||||
class TestIncoterm(IntegrationTestCase):
|
||||
from erpnext.tests.utils import ERPNextTestSuite
|
||||
|
||||
|
||||
class TestIncoterm(ERPNextTestSuite):
|
||||
pass
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
import unittest
|
||||
|
||||
import frappe
|
||||
from frappe.tests import IntegrationTestCase
|
||||
from frappe.utils.nestedset import (
|
||||
NestedSetChildExistsError,
|
||||
NestedSetInvalidMergeError,
|
||||
@@ -13,8 +12,10 @@ from frappe.utils.nestedset import (
|
||||
rebuild_tree,
|
||||
)
|
||||
|
||||
from erpnext.tests.utils import ERPNextTestSuite
|
||||
|
||||
class TestItem(IntegrationTestCase):
|
||||
|
||||
class TestItem(ERPNextTestSuite):
|
||||
def test_basic_tree(self, records=None):
|
||||
min_lft = 1
|
||||
max_rgt = frappe.db.sql("select max(rgt) from `tabItem Group`")[0][0]
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
# See license.txt
|
||||
import unittest
|
||||
|
||||
from frappe.tests import IntegrationTestCase
|
||||
from erpnext.tests.utils import ERPNextTestSuite
|
||||
|
||||
|
||||
class TestPartyType(IntegrationTestCase):
|
||||
class TestPartyType(ERPNextTestSuite):
|
||||
pass
|
||||
|
||||
@@ -3,10 +3,11 @@
|
||||
|
||||
|
||||
import frappe
|
||||
from frappe.tests import IntegrationTestCase
|
||||
|
||||
from erpnext.tests.utils import ERPNextTestSuite
|
||||
|
||||
|
||||
class TestTransactionDeletionRecord(IntegrationTestCase):
|
||||
class TestTransactionDeletionRecord(ERPNextTestSuite):
|
||||
def setUp(self):
|
||||
# Clear all deletion cache flags from previous tests
|
||||
self._clear_all_deletion_cache_flags()
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
# See license.txt
|
||||
import unittest
|
||||
|
||||
from frappe.tests import IntegrationTestCase
|
||||
from erpnext.tests.utils import ERPNextTestSuite
|
||||
|
||||
|
||||
class TestUOMConversionFactor(IntegrationTestCase):
|
||||
class TestUOMConversionFactor(ERPNextTestSuite):
|
||||
pass
|
||||
|
||||
@@ -3,11 +3,12 @@
|
||||
import unittest
|
||||
|
||||
import frappe
|
||||
from frappe.tests import IntegrationTestCase
|
||||
from frappe.utils import random_string
|
||||
|
||||
from erpnext.tests.utils import ERPNextTestSuite
|
||||
|
||||
class TestVehicle(IntegrationTestCase):
|
||||
|
||||
class TestVehicle(ERPNextTestSuite):
|
||||
def test_make_vehicle(self):
|
||||
vehicle = frappe.get_doc(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user