refactor: replace all IntegrationTestCase -> ERPNextTestSuite

This commit is contained in:
ruthra kumar
2025-07-16 13:29:02 +05:30
parent 4cdf5f542e
commit 29cf028f9a
7 changed files with 11 additions and 30 deletions

View File

@@ -1,17 +1,10 @@
# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
# import frappe
from frappe.tests import IntegrationTestCase
# On IntegrationTestCase, the doctype test records and all
# link-field test record dependencies are recursively loaded
# Use these module variables to add/remove to/from that list
EXTRA_TEST_RECORD_DEPENDENCIES = [] # eg. ["User"]
IGNORE_TEST_RECORD_DEPENDENCIES = [] # eg. ["User"]
from erpnext.tests.utils import ERPNextTestSuite
class IntegrationTestTaxWithholdingEntry(IntegrationTestCase):
class IntegrationTestTaxWithholdingEntry(ERPNextTestSuite):
"""
Integration tests for TaxWithholdingEntry.
Use this class for testing interactions between multiple components.

View File

@@ -1,17 +1,10 @@
# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
# import frappe
from frappe.tests import IntegrationTestCase
# On IntegrationTestCase, the doctype test records and all
# link-field test record dependencies are recursively loaded
# Use these module variables to add/remove to/from that list
EXTRA_TEST_RECORD_DEPENDENCIES = [] # eg. ["User"]
IGNORE_TEST_RECORD_DEPENDENCIES = [] # eg. ["User"]
from erpnext.tests.utils import ERPNextTestSuite
class IntegrationTestTaxWithholdingGroup(IntegrationTestCase):
class IntegrationTestTaxWithholdingGroup(ERPNextTestSuite):
"""
Integration tests for TaxWithholdingGroup.
Use this class for testing interactions between multiple components.

View File

@@ -3,18 +3,18 @@
import frappe
from frappe import _
from frappe.tests import IntegrationTestCase
from frappe.utils import flt, today
from erpnext.accounts.report.consolidated_trial_balance.consolidated_trial_balance import execute
from erpnext.setup.utils import get_exchange_rate
from erpnext.tests.utils import ERPNextTestSuite
class ForeignCurrencyTranslationReserveNotFoundError(frappe.ValidationError):
pass
class TestConsolidatedTrialBalance(IntegrationTestCase):
class TestConsolidatedTrialBalance(ERPNextTestSuite):
@classmethod
def setUpClass(cls):
from erpnext.accounts.report.trial_balance.test_trial_balance import create_company

View File

@@ -5,7 +5,6 @@ import unittest
import frappe
from frappe import qb
from frappe.query_builder.functions import Sum
from frappe.tests import IntegrationTestCase
from frappe.utils import add_days, add_months, flt, get_first_day, nowdate, nowtime, today
from erpnext.assets.doctype.asset.asset import (

View File

@@ -5,8 +5,7 @@ import copy
from collections import defaultdict
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import add_days, cint, today
from frappe.utils import add_days, today
from erpnext.manufacturing.doctype.production_plan.test_production_plan import make_bom
from erpnext.manufacturing.doctype.work_order.test_work_order import make_wo_order_test_record
@@ -14,9 +13,10 @@ from erpnext.manufacturing.doctype.work_order.work_order import make_stock_entry
from erpnext.stock.doctype.delivery_note.test_delivery_note import create_delivery_note
from erpnext.stock.doctype.item.test_item import make_item
from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import make_purchase_receipt
from erpnext.tests.utils import ERPNextTestSuite
class TestItemWiseInventoryAccount(IntegrationTestCase):
class TestItemWiseInventoryAccount(ERPNextTestSuite):
def setUp(self):
self.company = make_company()
self.company_abbr = frappe.db.get_value("Company", self.company, "abbr")

View File

@@ -1021,7 +1021,7 @@ class TestQuotation(ERPNextTestSuite):
quotation.reload()
self.assertEqual(quotation.status, "Ordered")
@change_settings("Accounts Settings", {"allow_pegged_currencies_exchange_rates": True})
@ERPNextTestSuite.change_settings("Accounts Settings", {"allow_pegged_currencies_exchange_rates": True})
def test_make_quotation_qar_to_inr(self):
quotation = make_quotation(
currency="QAR",

View File

@@ -2369,10 +2369,8 @@ class TestStockEntry(ERPNextTestSuite):
self.assertEqual(target_sabb.entries[0].batch_no, batch)
self.assertEqual([entry.serial_no for entry in target_sabb.entries], serial_nos[:2])
@ERPNextTestSuite.change_settings("Manufacturing Settings", {"material_consumption": 0})
def test_raw_material_missing_validation(self):
original_value = frappe.db.get_single_value("Manufacturing Settings", "material_consumption")
frappe.db.set_single_value("Manufacturing Settings", "material_consumption", 0)
stock_entry = make_stock_entry(
item_code="_Test Item",
qty=1,
@@ -2389,8 +2387,6 @@ class TestStockEntry(ERPNextTestSuite):
stock_entry.save,
)
frappe.db.set_single_value("Manufacturing Settings", "material_consumption", original_value)
@ERPNextTestSuite.change_settings(
"Manufacturing Settings",
{