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

@@ -1,10 +1,10 @@
import frappe
from frappe.tests import IntegrationTestCase
from erpnext.stock.get_item_details import get_item_details
from erpnext.tests.utils import ERPNextTestSuite
class TestGetItemDetail(IntegrationTestCase):
class TestGetItemDetail(ERPNextTestSuite):
def test_get_item_detail_purchase_order(self):
args = frappe._dict(
{

View File

@@ -2,9 +2,9 @@ import json
import frappe
from frappe.query_builder.functions import Timestamp
from frappe.tests import IntegrationTestCase
from erpnext.stock.utils import scan_barcode
from erpnext.tests.utils import ERPNextTestSuite
class StockTestMixin:
@@ -70,7 +70,7 @@ class StockTestMixin:
self.assertEqual(exp_value, act_value, msg=f"{k} doesn't match \n{exp_gle}\n{act_gle}")
class TestStockUtilities(IntegrationTestCase, StockTestMixin):
class TestStockUtilities(ERPNextTestSuite, StockTestMixin):
def test_barcode_scanning(self):
simple_item = self.make_item(properties={"barcodes": [{"barcode": "12399"}]})
self.assertEqual(scan_barcode("12399")["item_code"], simple_item.name)

View File

@@ -2,20 +2,20 @@ import json
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from hypothesis import given
from hypothesis import strategies as st
from erpnext.stock.doctype.item.test_item import make_item
from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry
from erpnext.stock.valuation import FIFOValuation, LIFOValuation, round_off_if_near_zero
from erpnext.tests.utils import ERPNextTestSuite
qty_gen = st.floats(min_value=-1e6, max_value=1e6)
value_gen = st.floats(min_value=1, max_value=1e6)
stock_queue_generator = st.lists(st.tuples(qty_gen, value_gen), min_size=10)
class TestFIFOValuation(IntegrationTestCase):
class TestFIFOValuation(ERPNextTestSuite):
def setUp(self):
self.queue = FIFOValuation([])
@@ -195,7 +195,7 @@ class TestFIFOValuation(IntegrationTestCase):
self.assertTotalValue(total_value)
class TestLIFOValuation(IntegrationTestCase):
class TestLIFOValuation(ERPNextTestSuite):
def setUp(self):
self.stack = LIFOValuation([])
@@ -317,7 +317,7 @@ class TestLIFOValuation(IntegrationTestCase):
self.assertTotalValue(total_value)
class TestLIFOValuationSLE(IntegrationTestCase):
class TestLIFOValuationSLE(ERPNextTestSuite):
ITEM_CODE = "_Test LIFO item"
WAREHOUSE = "_Test Warehouse - _TC"