refactor: replace all IntegrationTestCase -> ERPNextTestSuite

This commit is contained in:
ruthra kumar
2025-07-16 13:29:02 +05:30
parent ea2763432d
commit 253fbc2a70
10 changed files with 16 additions and 31 deletions

View File

@@ -4733,7 +4733,7 @@ class TestSalesInvoice(ERPNextTestSuite):
doc.db_set("do_not_use_batchwise_valuation", original_value)
@change_settings("Selling Settings", {"set_zero_rate_for_expired_batch": True})
@ERPNextTestSuite.change_settings("Selling Settings", {"set_zero_rate_for_expired_batch": True})
def test_zero_valuation_for_standalone_credit_note_with_expired_batch(self):
item_code = "_Test Item for Expiry Batch Zero Valuation"
make_item_for_si(

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

@@ -4,7 +4,6 @@
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

@@ -2474,7 +2474,7 @@ class TestAccountsController(ERPNextTestSuite):
po.items[0].delivered_by_supplier = 1
po.save()
@IntegrationTestCase.change_settings("Global Defaults", {"use_posting_datetime_for_naming_documents": 1})
@ERPNextTestSuite.change_settings("Global Defaults", {"use_posting_datetime_for_naming_documents": 1})
def test_document_naming_rule_based_on_posting_date(self):
frappe.new_doc(
"Document Naming Rule", document_type="Sales Invoice", prefix="SI-.MM.-.YYYY.-"

View File

@@ -3,7 +3,6 @@
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import add_days, today
from erpnext.manufacturing.doctype.production_plan.test_production_plan import make_bom
@@ -12,9 +11,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

@@ -180,7 +180,7 @@ class TestQuotation(ERPNextTestSuite):
self.assertTrue(quotation.payment_schedule)
@IntegrationTestCase.change_settings(
@ERPNextTestSuite.change_settings(
"Accounts Settings",
{"automatically_fetch_payment_terms": 1},
)
@@ -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",
@@ -1074,7 +1074,7 @@ class TestQuotation(ERPNextTestSuite):
quotation.reload()
self.assertEqual(quotation.status, "Open")
@IntegrationTestCase.change_settings(
@ERPNextTestSuite.change_settings(
"Accounts Settings",
{"automatically_fetch_payment_terms": 1},
)

View File

@@ -2864,7 +2864,7 @@ class TestDeliveryNote(ERPNextTestSuite):
for entry in sabb.entries:
self.assertEqual(entry.incoming_rate, 200)
@IntegrationTestCase.change_settings("Selling Settings", {"validate_selling_price": 1})
@ERPNextTestSuite.change_settings("Selling Settings", {"validate_selling_price": 1})
def test_validate_selling_price(self):
item_code = make_item("VSP Item", properties={"is_stock_item": 1}).name
make_stock_entry(item_code=item_code, target="_Test Warehouse - _TC", qty=1, basic_rate=10)

View File

@@ -2368,7 +2368,7 @@ 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])
@IntegrationTestCase.change_settings("Manufacturing Settings", {"material_consumption": 0})
@ERPNextTestSuite.change_settings("Manufacturing Settings", {"material_consumption": 0})
def test_raw_material_missing_validation(self):
stock_entry = make_stock_entry(
item_code="_Test Item",
@@ -2386,7 +2386,7 @@ class TestStockEntry(ERPNextTestSuite):
stock_entry.save,
)
@IntegrationTestCase.change_settings(
@ERPNextTestSuite.change_settings(
"Manufacturing Settings",
{
"material_consumption": 1,