refactor: import from new location

This commit is contained in:
David
2024-10-06 11:54:52 +02:00
parent 13eb3c5c14
commit bda415a83d
142 changed files with 423 additions and 384 deletions

View File

@@ -5,8 +5,8 @@
import json
import frappe
from frappe.test_runner import make_test_records
from frappe.tests.utils import FrappeTestCase
from frappe.tests import IntegrationTestCase
from frappe.tests.utils import make_test_records
from frappe.utils import flt
from erpnext.accounts.party import get_due_date
@@ -23,7 +23,7 @@ test_dependencies = ["Payment Term", "Payment Terms Template"]
test_records = frappe.get_test_records("Customer")
class TestCustomer(FrappeTestCase):
class TestCustomer(IntegrationTestCase):
def setUp(self):
if not frappe.get_value("Item", "_Test Item"):
make_test_records("Item")

View File

@@ -2,7 +2,7 @@
# See license.txt
import frappe
from frappe.tests.utils import FrappeTestCase
from frappe.tests import IntegrationTestCase
from erpnext.controllers.queries import item_query
@@ -18,7 +18,7 @@ def create_party_specific_item(**args):
psi.insert()
class TestPartySpecificItem(FrappeTestCase):
class TestPartySpecificItem(IntegrationTestCase):
def setUp(self):
self.customer = frappe.get_last_doc("Customer")
self.supplier = frappe.get_last_doc("Supplier")

View File

@@ -2,7 +2,7 @@
# License: GNU General Public License v3. See license.txt
import frappe
from frappe.tests.utils import FrappeTestCase
from frappe.tests import IntegrationTestCase
from frappe.utils import add_days, add_months, flt, getdate, nowdate
from erpnext.controllers.accounts_controller import InvalidQtyError
@@ -10,7 +10,7 @@ from erpnext.controllers.accounts_controller import InvalidQtyError
test_dependencies = ["Product Bundle"]
class TestQuotation(FrappeTestCase):
class TestQuotation(IntegrationTestCase):
def test_quotation_qty(self):
qo = make_quotation(qty=0, do_not_save=True)
with self.assertRaises(InvalidQtyError):

View File

@@ -7,7 +7,7 @@ from unittest.mock import patch
import frappe
import frappe.permissions
from frappe.core.doctype.user_permission.test_user_permission import create_user
from frappe.tests.utils import FrappeTestCase, change_settings
from frappe.tests import IntegrationTestCase
from frappe.utils import add_days, flt, getdate, nowdate, today
from erpnext.accounts.test.accounts_mixin import AccountsTestMixin
@@ -33,7 +33,7 @@ from erpnext.stock.doctype.item.test_item import make_item
from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry
class TestSalesOrder(AccountsTestMixin, FrappeTestCase):
class TestSalesOrder(AccountsTestMixin, IntegrationTestCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
@@ -1316,7 +1316,9 @@ class TestSalesOrder(AccountsTestMixin, FrappeTestCase):
self.assertRaises(frappe.LinkExistsError, so_doc.cancel)
@change_settings("Accounts Settings", {"unlink_advance_payment_on_cancelation_of_order": 1})
@IntegrationTestCase.change_settings(
"Accounts Settings", {"unlink_advance_payment_on_cancelation_of_order": 1}
)
def test_advance_paid_upon_payment_cancellation(self):
from erpnext.accounts.doctype.payment_entry.test_payment_entry import get_payment_entry
@@ -1906,7 +1908,7 @@ class TestSalesOrder(AccountsTestMixin, FrappeTestCase):
self.assertEqual(len(dn.packed_items), 1)
self.assertEqual(dn.items[0].item_code, "_Test Product Bundle Item Partial 2")
@change_settings("Selling Settings", {"editable_bundle_item_rates": 1})
@IntegrationTestCase.change_settings("Selling Settings", {"editable_bundle_item_rates": 1})
def test_expired_rate_for_packed_item(self):
bundle = "_Test Product Bundle 1"
packed_item = "_Packed Item 1"
@@ -2198,7 +2200,7 @@ class TestSalesOrder(AccountsTestMixin, FrappeTestCase):
self.assertRaises(frappe.ValidationError, so1.update_status, "Draft")
@change_settings("Stock Settings", {"enable_stock_reservation": True})
@IntegrationTestCase.change_settings("Stock Settings", {"enable_stock_reservation": True})
def test_warehouse_mapping_based_on_stock_reservation(self):
self.create_company(company_name="Glass Ceiling", abbr="GC")
self.create_item("Lamy Safari 2", True, self.warehouse_stores, self.company, 2000)