mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-13 09:10:36 +00:00
refactor: replace IntegrationTestCase with ERPNextTestCase repo-wide
- import ERPNextTestSuite - use it on test class
This commit is contained in:
@@ -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(
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user