refactor: replace IntegrationTestCase with ERPNextTestCase repo-wide

- import ERPNextTestSuite
 - use it on test class
This commit is contained in:
ruthra kumar
2026-01-20 10:12:06 +05:30
parent 0fdc961a4b
commit f1dfac417d
319 changed files with 870 additions and 867 deletions

View File

@@ -3,7 +3,6 @@
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import (
add_days,
add_months,
@@ -37,9 +36,10 @@ from erpnext.stock.doctype.purchase_receipt.purchase_receipt import (
make_purchase_invoice as make_invoice,
)
from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import make_purchase_receipt
from erpnext.tests.utils import ERPNextTestSuite
class AssetSetup(IntegrationTestCase):
class AssetSetup(ERPNextTestSuite):
@classmethod
def setUpClass(cls):
super().setUpClass()

View File

@@ -2,8 +2,10 @@
# See license.txt
# import frappe
from frappe.tests import IntegrationTestCase
class TestAssetActivity(IntegrationTestCase):
from erpnext.tests.utils import ERPNextTestSuite
class TestAssetActivity(ERPNextTestSuite):
pass

View File

@@ -3,8 +3,7 @@
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import cint, flt, getdate, now_datetime
from frappe.utils import cint, flt, now_datetime
from erpnext.assets.doctype.asset.depreciation import post_depreciation_entries
from erpnext.assets.doctype.asset.test_asset import (
@@ -21,9 +20,10 @@ from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import make_pu
from erpnext.stock.doctype.serial_and_batch_bundle.test_serial_and_batch_bundle import (
make_serial_batch_bundle,
)
from erpnext.tests.utils import ERPNextTestSuite
class TestAssetCapitalization(IntegrationTestCase):
class TestAssetCapitalization(ERPNextTestSuite):
def setUp(self):
set_depreciation_settings_in_company()
create_asset_data()

View File

@@ -3,10 +3,12 @@
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from erpnext.assets.doctype.asset.test_asset import create_asset
from erpnext.tests.utils import ERPNextTestSuite
class TestAssetCategory(IntegrationTestCase):
class TestAssetCategory(ERPNextTestSuite):
def test_mandatory_fields(self):
asset_category = frappe.new_doc("Asset Category")
asset_category.asset_category_name = "Computers"

View File

@@ -2,8 +2,7 @@
# See license.txt
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import cstr, date_diff, flt, getdate
from frappe.utils import cstr, flt, getdate
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
from erpnext.assets.doctype.asset.depreciation import (
@@ -18,9 +17,10 @@ from erpnext.assets.doctype.asset_repair.test_asset_repair import create_asset_r
from erpnext.assets.doctype.asset_value_adjustment.test_asset_value_adjustment import (
make_asset_value_adjustment,
)
from erpnext.tests.utils import ERPNextTestSuite
class TestAssetDepreciationSchedule(IntegrationTestCase):
class TestAssetDepreciationSchedule(ERPNextTestSuite):
def setUp(self):
create_asset_data()

View File

@@ -3,14 +3,14 @@
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import add_days, get_last_day, nowdate
from erpnext.assets.doctype.asset_maintenance.asset_maintenance import calculate_next_due_date
from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import make_purchase_receipt
from erpnext.tests.utils import ERPNextTestSuite
class TestAssetMaintenance(IntegrationTestCase):
class TestAssetMaintenance(ERPNextTestSuite):
def setUp(self):
set_depreciation_settings_in_company()
self.pr = make_purchase_receipt(

View File

@@ -2,8 +2,8 @@
# See license.txt
import unittest
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ERPNextTestSuite
class TestAssetMaintenanceLog(IntegrationTestCase):
class TestAssetMaintenanceLog(ERPNextTestSuite):
pass

View File

@@ -2,8 +2,8 @@
# See license.txt
import unittest
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ERPNextTestSuite
class TestAssetMaintenanceTeam(IntegrationTestCase):
class TestAssetMaintenanceTeam(ERPNextTestSuite):
pass

View File

@@ -3,15 +3,15 @@
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import add_days, now
from erpnext.assets.doctype.asset.test_asset import create_asset, create_asset_data
from erpnext.setup.doctype.employee.test_employee import make_employee
from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import make_purchase_receipt
from erpnext.tests.utils import ERPNextTestSuite
class TestAssetMovement(IntegrationTestCase):
class TestAssetMovement(ERPNextTestSuite):
def setUp(self):
frappe.db.set_value(
"Company", "_Test Company", "capital_work_in_progress_account", "CWIP Account - _TC"

View File

@@ -26,9 +26,10 @@ from erpnext.stock.doctype.serial_and_batch_bundle.test_serial_and_batch_bundle
get_serial_nos_from_bundle,
make_serial_batch_bundle,
)
from erpnext.tests.utils import ERPNextTestSuite
class TestAssetRepair(IntegrationTestCase):
class TestAssetRepair(ERPNextTestSuite):
@classmethod
def setUpClass(cls):
super().setUpClass()

View File

@@ -2,16 +2,16 @@
# See license.txt
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import cstr
from erpnext.assets.doctype.asset.test_asset import create_asset
from erpnext.assets.doctype.asset_depreciation_schedule.asset_depreciation_schedule import (
get_depr_schedule,
)
from erpnext.tests.utils import ERPNextTestSuite
class TestAssetShiftAllocation(IntegrationTestCase):
class TestAssetShiftAllocation(ERPNextTestSuite):
@classmethod
def setUpClass(cls):
super().setUpClass()

View File

@@ -2,8 +2,10 @@
# See license.txt
# import frappe
from frappe.tests import IntegrationTestCase
class TestAssetShiftFactor(IntegrationTestCase):
from erpnext.tests.utils import ERPNextTestSuite
class TestAssetShiftFactor(ERPNextTestSuite):
pass

View File

@@ -3,7 +3,6 @@
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import add_days, cstr, get_last_day, getdate, nowdate
from erpnext.assets.doctype.asset.asset import get_asset_value_after_depreciation
@@ -14,9 +13,10 @@ from erpnext.assets.doctype.asset_depreciation_schedule.asset_depreciation_sched
)
from erpnext.assets.doctype.asset_repair.test_asset_repair import create_asset_repair
from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import make_purchase_receipt
from erpnext.tests.utils import ERPNextTestSuite
class TestAssetValueAdjustment(IntegrationTestCase):
class TestAssetValueAdjustment(ERPNextTestSuite):
def setUp(self):
create_asset_data()
frappe.db.set_value(

View File

@@ -4,10 +4,11 @@ import json
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ERPNextTestSuite
class TestLocation(IntegrationTestCase):
class TestLocation(ERPNextTestSuite):
def runTest(self):
locations = ["Basil Farm", "Division 1", "Field 1", "Block 1"]
area = 0

View File

@@ -2,8 +2,8 @@
# See license.txt
import unittest
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ERPNextTestSuite
class TestMaintenanceTeamMember(IntegrationTestCase):
class TestMaintenanceTeamMember(ERPNextTestSuite):
pass