refactor: add bare unit test cases

mainly for LLMs to catch up with the convention
This commit is contained in:
David
2024-10-06 11:56:22 +02:00
parent bda415a83d
commit 2adb417408
85 changed files with 850 additions and 85 deletions

View File

@@ -2,7 +2,16 @@
# See license.txt
# import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
class UnitTestAccountClosingBalance(UnitTestCase):
"""
Unit tests for AccountClosingBalance.
Use this class for testing individual functions and methods.
"""
pass
class TestAccountClosingBalance(IntegrationTestCase):

View File

@@ -2,12 +2,21 @@
# License: GNU General Public License v3. See license.txt
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.utils import nowdate
from erpnext.accounts.doctype.bank_transaction.test_bank_transaction import create_bank_account
class UnitTestBankTransaction(UnitTestCase):
"""
Unit tests for BankTransaction.
Use this class for testing individual functions and methods.
"""
pass
class TestAutoMatchParty(IntegrationTestCase):
@classmethod
def setUpClass(cls):

View File

@@ -6,7 +6,7 @@ import json
import frappe
from frappe import utils
from frappe.model.docstatus import DocStatus
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool import (
get_linked_payments,
@@ -21,6 +21,15 @@ from erpnext.tests.utils import if_lending_app_installed
test_dependencies = ["Item", "Cost Center"]
class UnitTestBankTransaction(UnitTestCase):
"""
Unit tests for BankTransaction.
Use this class for testing individual functions and methods.
"""
pass
class TestBankTransaction(IntegrationTestCase):
def setUp(self):
for dt in [

View File

@@ -2,7 +2,16 @@
# See license.txt
# import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
class UnitTestBisectAccountingStatements(UnitTestCase):
"""
Unit tests for BisectAccountingStatements.
Use this class for testing individual functions and methods.
"""
pass
class TestBisectAccountingStatements(IntegrationTestCase):

View File

@@ -2,7 +2,16 @@
# See license.txt
# import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
class UnitTestBisectNodes(UnitTestCase):
"""
Unit tests for BisectNodes.
Use this class for testing individual functions and methods.
"""
pass
class TestBisectNodes(IntegrationTestCase):

View File

@@ -1,7 +1,7 @@
# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.utils import add_days, nowdate, today
from erpnext import get_default_cost_center
@@ -19,6 +19,15 @@ from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import (
test_dependencies = ["Company", "Cost Center"]
class UnitTestDunning(UnitTestCase):
"""
Unit tests for Dunning.
Use this class for testing individual functions and methods.
"""
pass
class TestDunning(IntegrationTestCase):
@classmethod
def setUpClass(cls):

View File

@@ -2,7 +2,7 @@
# License: GNU General Public License v3. See license.txt
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.tests.utils import change_settings
from frappe.utils import flt, nowdate
@@ -11,6 +11,15 @@ from erpnext.accounts.doctype.journal_entry.journal_entry import StockAccountInv
from erpnext.exceptions import InvalidAccountCurrency
class UnitTestJournalEntry(UnitTestCase):
"""
Unit tests for JournalEntry.
Use this class for testing individual functions and methods.
"""
pass
class TestJournalEntry(IntegrationTestCase):
@IntegrationTestCase.change_settings(
"Accounts Settings", {"unlink_payment_on_cancellation_of_invoice": 1}

View File

@@ -2,7 +2,16 @@
# See license.txt
# import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
class UnitTestLedgerHealthMonitor(UnitTestCase):
"""
Unit tests for LedgerHealthMonitor.
Use this class for testing individual functions and methods.
"""
pass
class TestLedgerHealthMonitor(IntegrationTestCase):

View File

@@ -2,7 +2,7 @@
# See license.txt
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from erpnext.accounts.doctype.accounting_dimension.test_accounting_dimension import (
create_dimension,
@@ -15,6 +15,15 @@ from erpnext.accounts.doctype.opening_invoice_creation_tool.opening_invoice_crea
test_dependencies = ["Customer", "Supplier", "Accounting Dimension"]
class UnitTestOpeningInvoiceCreationTool(UnitTestCase):
"""
Unit tests for OpeningInvoiceCreationTool.
Use this class for testing individual functions and methods.
"""
pass
class TestOpeningInvoiceCreationTool(IntegrationTestCase):
@classmethod
def setUpClass(self):

View File

@@ -4,7 +4,7 @@
import frappe
from frappe import qb
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.utils import add_days, flt, nowdate
from erpnext.accounts.doctype.account.test_account import create_account
@@ -28,6 +28,15 @@ from erpnext.setup.doctype.employee.test_employee import make_employee
test_dependencies = ["Item"]
class UnitTestPaymentEntry(UnitTestCase):
"""
Unit tests for PaymentEntry.
Use this class for testing individual functions and methods.
"""
pass
class TestPaymentEntry(IntegrationTestCase):
def tearDown(self):
frappe.db.rollback()

View File

@@ -3,7 +3,7 @@
import frappe
from frappe import qb
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.utils import nowdate
from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry
@@ -13,6 +13,15 @@ from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_orde
from erpnext.stock.doctype.item.test_item import create_item
class UnitTestPaymentLedgerEntry(UnitTestCase):
"""
Unit tests for PaymentLedgerEntry.
Use this class for testing individual functions and methods.
"""
pass
class TestPaymentLedgerEntry(IntegrationTestCase):
def setUp(self):
self.ple = qb.DocType("Payment Ledger Entry")

View File

@@ -3,7 +3,7 @@
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.utils import getdate
from erpnext.accounts.doctype.bank_transaction.test_bank_transaction import (
@@ -17,6 +17,15 @@ from erpnext.accounts.doctype.payment_entry.payment_entry import (
from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import make_purchase_invoice
class UnitTestPaymentOrder(UnitTestCase):
"""
Unit tests for PaymentOrder.
Use this class for testing individual functions and methods.
"""
pass
class TestPaymentOrder(IntegrationTestCase):
def setUp(self):
# generate and use a uniq hash identifier for 'Bank Account' and it's linked GL 'Account' to avoid validation error

View File

@@ -4,7 +4,7 @@
import frappe
from frappe import qb
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.utils import add_days, add_years, flt, getdate, nowdate, today
from erpnext import get_default_cost_center
@@ -20,6 +20,15 @@ from erpnext.stock.doctype.item.test_item import create_item
test_dependencies = ["Item"]
class UnitTestPaymentReconciliation(UnitTestCase):
"""
Unit tests for PaymentReconciliation.
Use this class for testing individual functions and methods.
"""
pass
class TestPaymentReconciliation(IntegrationTestCase):
def setUp(self):
self.create_company()

View File

@@ -6,7 +6,7 @@ import unittest
from unittest.mock import patch
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from erpnext.accounts.doctype.payment_entry.test_payment_entry import create_payment_terms_template
from erpnext.accounts.doctype.payment_request.payment_request import make_payment_request
@@ -57,6 +57,15 @@ payment_method = [
]
class UnitTestPaymentRequest(UnitTestCase):
"""
Unit tests for PaymentRequest.
Use this class for testing individual functions and methods.
"""
pass
class TestPaymentRequest(IntegrationTestCase):
def setUp(self):
for payment_gateway in payment_gateways:

View File

@@ -4,7 +4,7 @@
import json
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.tests.utils import change_settings
from erpnext.accounts.doctype.pos_closing_entry.test_pos_closing_entry import init_user_and_profile
@@ -19,6 +19,15 @@ from erpnext.stock.doctype.serial_and_batch_bundle.test_serial_and_batch_bundle
from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry
class UnitTestPosInvoiceMergeLog(UnitTestCase):
"""
Unit tests for PosInvoiceMergeLog.
Use this class for testing individual functions and methods.
"""
pass
class TestPOSInvoiceMergeLog(IntegrationTestCase):
def test_consolidated_invoice_creation(self):
frappe.db.sql("delete from `tabPOS Invoice`")

View File

@@ -5,7 +5,7 @@
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import make_purchase_invoice
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
@@ -15,6 +15,15 @@ from erpnext.stock.doctype.item.test_item import make_item
from erpnext.stock.get_item_details import get_item_details
class UnitTestPricingRule(UnitTestCase):
"""
Unit tests for PricingRule.
Use this class for testing individual functions and methods.
"""
pass
class TestPricingRule(IntegrationTestCase):
def setUp(self):
delete_existing_pricing_rules()

View File

@@ -2,7 +2,16 @@
# See license.txt
# import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
class UnitTestProcessPaymentReconciliation(UnitTestCase):
"""
Unit tests for ProcessPaymentReconciliation.
Use this class for testing individual functions and methods.
"""
pass
class TestProcessPaymentReconciliation(IntegrationTestCase):

View File

@@ -2,7 +2,16 @@
# See license.txt
# import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
class UnitTestProcessPaymentReconciliationLog(UnitTestCase):
"""
Unit tests for ProcessPaymentReconciliationLog.
Use this class for testing individual functions and methods.
"""
pass
class TestProcessPaymentReconciliationLog(IntegrationTestCase):

View File

@@ -2,7 +2,16 @@
# See license.txt
# import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
class UnitTestProcessSubscription(UnitTestCase):
"""
Unit tests for ProcessSubscription.
Use this class for testing individual functions and methods.
"""
pass
class TestProcessSubscription(IntegrationTestCase):

View File

@@ -2,7 +2,16 @@
# See license.txt
# import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
class UnitTestRepostAccountingLedgerSettings(UnitTestCase):
"""
Unit tests for RepostAccountingLedgerSettings.
Use this class for testing individual functions and methods.
"""
pass
class TestRepostAccountingLedgerSettings(IntegrationTestCase):

View File

@@ -2,7 +2,16 @@
# See license.txt
# import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
class UnitTestRepostPaymentLedger(UnitTestCase):
"""
Unit tests for RepostPaymentLedger.
Use this class for testing individual functions and methods.
"""
pass
class TestRepostPaymentLedger(IntegrationTestCase):

View File

@@ -7,7 +7,7 @@ import json
import frappe
from frappe import qb
from frappe.model.dynamic_links import get_dynamic_link_map
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.utils import add_days, flt, format_date, getdate, nowdate, today
import erpnext
@@ -46,6 +46,15 @@ from erpnext.stock.doctype.stock_reconciliation.test_stock_reconciliation import
from erpnext.stock.utils import get_incoming_rate, get_stock_balance
class UnitTestSalesInvoice(UnitTestCase):
"""
Unit tests for SalesInvoice.
Use this class for testing individual functions and methods.
"""
pass
class TestSalesInvoice(IntegrationTestCase):
def setUp(self):
from erpnext.stock.doctype.stock_ledger_entry.test_stock_ledger_entry import create_items

View File

@@ -3,7 +3,7 @@
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.utils.data import (
add_days,
add_months,
@@ -21,6 +21,15 @@ from erpnext.accounts.doctype.subscription.subscription import get_prorata_facto
test_dependencies = ("UOM", "Item Group", "Item")
class UnitTestSubscription(UnitTestCase):
"""
Unit tests for Subscription.
Use this class for testing individual functions and methods.
"""
pass
class TestSubscription(IntegrationTestCase):
def setUp(self):
make_plans()

View File

@@ -6,7 +6,7 @@ import unittest
import frappe
from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.utils import add_days, today
from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry
@@ -16,6 +16,15 @@ from erpnext.buying.doctype.purchase_order.purchase_order import make_purchase_i
test_dependencies = ["Supplier Group", "Customer Group"]
class UnitTestTaxWithholdingCategory(UnitTestCase):
"""
Unit tests for TaxWithholdingCategory.
Use this class for testing individual functions and methods.
"""
pass
class TestTaxWithholdingCategory(IntegrationTestCase):
@classmethod
def setUpClass(self):

View File

@@ -2,7 +2,16 @@
# See license.txt
# import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
class UnitTestAssetActivity(UnitTestCase):
"""
Unit tests for AssetActivity.
Use this class for testing individual functions and methods.
"""
pass
class TestAssetActivity(IntegrationTestCase):

View File

@@ -2,7 +2,7 @@
# See license.txt
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.utils import cstr, flt
from erpnext.assets.doctype.asset.depreciation import (
@@ -15,6 +15,15 @@ from erpnext.assets.doctype.asset_depreciation_schedule.asset_depreciation_sched
)
class UnitTestAssetDepreciationSchedule(UnitTestCase):
"""
Unit tests for AssetDepreciationSchedule.
Use this class for testing individual functions and methods.
"""
pass
class TestAssetDepreciationSchedule(IntegrationTestCase):
def setUp(self):
create_asset_data()

View File

@@ -2,7 +2,7 @@
# See license.txt
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.utils import cstr
from erpnext.assets.doctype.asset.test_asset import create_asset
@@ -11,6 +11,15 @@ from erpnext.assets.doctype.asset_depreciation_schedule.asset_depreciation_sched
)
class UnitTestAssetShiftAllocation(UnitTestCase):
"""
Unit tests for AssetShiftAllocation.
Use this class for testing individual functions and methods.
"""
pass
class TestAssetShiftAllocation(IntegrationTestCase):
@classmethod
def setUpClass(cls):

View File

@@ -2,7 +2,16 @@
# See license.txt
# import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
class UnitTestAssetShiftFactor(UnitTestCase):
"""
Unit tests for AssetShiftFactor.
Use this class for testing individual functions and methods.
"""
pass
class TestAssetShiftFactor(IntegrationTestCase):

View File

@@ -2,7 +2,16 @@
# See license.txt
# import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
class UnitTestBulkTransactionLog(UnitTestCase):
"""
Unit tests for BulkTransactionLog.
Use this class for testing individual functions and methods.
"""
pass
class TestBulkTransactionLog(IntegrationTestCase):

View File

@@ -2,7 +2,16 @@
# See license.txt
# import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
class UnitTestBulkTransactionLogDetail(UnitTestCase):
"""
Unit tests for BulkTransactionLogDetail.
Use this class for testing individual functions and methods.
"""
pass
class TestBulkTransactionLogDetail(IntegrationTestCase):

View File

@@ -5,7 +5,7 @@
import json
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.utils import add_days, flt, getdate, nowdate
from frappe.utils.data import today
@@ -28,6 +28,15 @@ from erpnext.stock.doctype.purchase_receipt.purchase_receipt import (
)
class UnitTestPurchaseOrder(UnitTestCase):
"""
Unit tests for PurchaseOrder.
Use this class for testing individual functions and methods.
"""
pass
class TestPurchaseOrder(IntegrationTestCase):
def test_purchase_order_qty(self):
po = create_purchase_order(qty=1, do_not_save=True)

View File

@@ -5,7 +5,7 @@
from urllib.parse import urlparse
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.utils import nowdate
from erpnext.buying.doctype.request_for_quotation.request_for_quotation import (
@@ -21,6 +21,15 @@ from erpnext.stock.doctype.item.test_item import make_item
from erpnext.templates.pages.rfq import check_supplier_has_docname_access
class UnitTestRequestForQuotation(UnitTestCase):
"""
Unit tests for RequestForQuotation.
Use this class for testing individual functions and methods.
"""
pass
class TestRequestforQuotation(IntegrationTestCase):
def test_rfq_qty(self):
rfq = make_request_for_quotation(qty=0, do_not_save=True)

View File

@@ -12,7 +12,16 @@ from erpnext.exceptions import PartyDisabled
test_dependencies = ["Payment Term", "Payment Terms Template"]
test_records = frappe.get_test_records("Supplier")
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
class UnitTestSupplier(UnitTestCase):
"""
Unit tests for Supplier.
Use this class for testing individual functions and methods.
"""
pass
class TestSupplier(IntegrationTestCase):

View File

@@ -3,11 +3,20 @@
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from erpnext.controllers.accounts_controller import InvalidQtyError
class UnitTestSupplierQuotation(UnitTestCase):
"""
Unit tests for SupplierQuotation.
Use this class for testing individual functions and methods.
"""
pass
class TestPurchaseOrder(IntegrationTestCase):
def test_supplier_quotation_qty(self):
sq = frappe.copy_doc(test_records[0])

View File

@@ -3,7 +3,16 @@
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
class UnitTestSupplierScorecard(UnitTestCase):
"""
Unit tests for SupplierScorecard.
Use this class for testing individual functions and methods.
"""
pass
class TestSupplierScorecard(IntegrationTestCase):

View File

@@ -3,7 +3,16 @@
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
class UnitTestSupplierScorecardCriteria(UnitTestCase):
"""
Unit tests for SupplierScorecardCriteria.
Use this class for testing individual functions and methods.
"""
pass
class TestSupplierScorecardCriteria(IntegrationTestCase):

View File

@@ -3,13 +3,22 @@
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from erpnext.buying.doctype.supplier_scorecard_variable.supplier_scorecard_variable import (
VariablePathNotFound,
)
class UnitTestSupplierScorecardVariable(UnitTestCase):
"""
Unit tests for SupplierScorecardVariable.
Use this class for testing individual functions and methods.
"""
pass
class TestSupplierScorecardVariable(IntegrationTestCase):
def test_variable_exist(self):
for d in test_existing_variables:

View File

@@ -1,7 +1,7 @@
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.utils import add_months, today
from erpnext import get_company_currency
@@ -10,6 +10,15 @@ from erpnext.stock.doctype.item.test_item import make_item
from .blanket_order import make_order
class UnitTestBlanketOrder(UnitTestCase):
"""
Unit tests for BlanketOrder.
Use this class for testing individual functions and methods.
"""
pass
class TestBlanketOrder(IntegrationTestCase):
def setUp(self):
frappe.flags.args = frappe._dict()

View File

@@ -6,7 +6,7 @@ from collections import deque
from functools import partial
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.tests.utils import timeout
from frappe.utils import cstr, flt
@@ -26,6 +26,15 @@ test_records = frappe.get_test_records("BOM")
test_dependencies = ["Item", "Quality Inspection Template"]
class UnitTestBom(UnitTestCase):
"""
Unit tests for Bom.
Use this class for testing individual functions and methods.
"""
pass
class TestBOM(IntegrationTestCase):
@timeout
def test_get_items(self):

View File

@@ -4,7 +4,7 @@
import random
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from erpnext.manufacturing.doctype.bom_creator.bom_creator import (
add_item,
@@ -13,6 +13,15 @@ from erpnext.manufacturing.doctype.bom_creator.bom_creator import (
from erpnext.stock.doctype.item.test_item import make_item
class UnitTestBomCreator(UnitTestCase):
"""
Unit tests for BomCreator.
Use this class for testing individual functions and methods.
"""
pass
class TestBOMCreator(IntegrationTestCase):
def setUp(self) -> None:
create_items()

View File

@@ -2,7 +2,7 @@
# See license.txt
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from erpnext.manufacturing.doctype.bom_update_log.bom_update_log import (
BOMMissingError,
@@ -16,6 +16,15 @@ from erpnext.manufacturing.doctype.bom_update_tool.bom_update_tool import (
test_records = frappe.get_test_records("BOM")
class UnitTestBomUpdateLog(UnitTestCase):
"""
Unit tests for BomUpdateLog.
Use this class for testing individual functions and methods.
"""
pass
class TestBOMUpdateLog(IntegrationTestCase):
"Test BOM Update Tool Operations via BOM Update Log."

View File

@@ -2,7 +2,7 @@
# License: GNU General Public License v3. See license.txt
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.tests.utils import timeout
from erpnext.manufacturing.doctype.bom_update_log.test_bom_update_log import (
@@ -15,6 +15,15 @@ from erpnext.stock.doctype.item.test_item import create_item
test_records = frappe.get_test_records("BOM")
class UnitTestBomUpdateTool(UnitTestCase):
"""
Unit tests for BomUpdateTool.
Use this class for testing individual functions and methods.
"""
pass
class TestBOMUpdateTool(IntegrationTestCase):
"Test major functions run via BOM Update Tool."

View File

@@ -5,7 +5,7 @@
from typing import Literal
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.tests.utils import make_test_records
from frappe.utils import random_string
from frappe.utils.data import add_to_date, now, today
@@ -26,6 +26,15 @@ from erpnext.manufacturing.doctype.workstation.test_workstation import make_work
from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry
class UnitTestJobCard(UnitTestCase):
"""
Unit tests for JobCard.
Use this class for testing individual functions and methods.
"""
pass
class TestJobCard(IntegrationTestCase):
def setUp(self):
make_bom_for_jc_tests()

View File

@@ -2,7 +2,16 @@
# See license.txt
# import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
class UnitTestPlantFloor(UnitTestCase):
"""
Unit tests for PlantFloor.
Use this class for testing individual functions and methods.
"""
pass
class TestPlantFloor(IntegrationTestCase):

View File

@@ -1,7 +1,7 @@
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.utils import add_to_date, flt, getdate, now_datetime, nowdate
from erpnext.controllers.item_variant import create_variant
@@ -22,6 +22,15 @@ from erpnext.stock.doctype.stock_reconciliation.test_stock_reconciliation import
)
class UnitTestProductionPlan(UnitTestCase):
"""
Unit tests for ProductionPlan.
Use this class for testing individual functions and methods.
"""
pass
class TestProductionPlan(IntegrationTestCase):
def setUp(self):
for item in [

View File

@@ -1,7 +1,7 @@
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.tests.utils import make_test_records
from erpnext.manufacturing.doctype.job_card.job_card import OperationSequenceError
@@ -9,6 +9,15 @@ from erpnext.manufacturing.doctype.work_order.test_work_order import make_wo_ord
from erpnext.stock.doctype.item.test_item import make_item
class UnitTestRouting(UnitTestCase):
"""
Unit tests for Routing.
Use this class for testing individual functions and methods.
"""
pass
class TestRouting(IntegrationTestCase):
@classmethod
def setUpClass(cls):

View File

@@ -3,7 +3,7 @@
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.tests.utils import timeout
from frappe.utils import add_days, add_months, add_to_date, cint, flt, now, today
@@ -35,6 +35,15 @@ from erpnext.stock.utils import get_bin
test_dependencies = ["BOM"]
class UnitTestWorkOrder(UnitTestCase):
"""
Unit tests for WorkOrder.
Use this class for testing individual functions and methods.
"""
pass
class TestWorkOrder(IntegrationTestCase):
def setUp(self):
self.warehouse = "_Test Warehouse 2 - _TC"

View File

@@ -1,7 +1,7 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors
# See license.txt
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.tests.utils import make_test_records
from erpnext.manufacturing.doctype.operation.test_operation import make_operation
@@ -17,6 +17,15 @@ test_records = frappe.get_test_records("Workstation")
make_test_records("Workstation")
class UnitTestWorkstation(UnitTestCase):
"""
Unit tests for Workstation.
Use this class for testing individual functions and methods.
"""
pass
class TestWorkstation(IntegrationTestCase):
def test_validate_timings(self):
check_if_within_operating_hours(

View File

@@ -2,7 +2,16 @@
# See license.txt
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
class UnitTestWorkstationType(UnitTestCase):
"""
Unit tests for WorkstationType.
Use this class for testing individual functions and methods.
"""
pass
class TestWorkstationType(IntegrationTestCase):

View File

@@ -2,7 +2,7 @@
# License: GNU General Public License v3. See license.txt
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.utils import add_days, getdate, nowdate
from erpnext.projects.doctype.project_template.test_project_template import make_project_template
@@ -14,6 +14,15 @@ test_records = frappe.get_test_records("Project")
test_ignore = ["Sales Order"]
class UnitTestProject(UnitTestCase):
"""
Unit tests for Project.
Use this class for testing individual functions and methods.
"""
pass
class TestProject(IntegrationTestCase):
def test_project_with_template_having_no_parent_and_depend_tasks(self):
project_name = "Test Project with Template - No Parent and Dependend Tasks"

View File

@@ -2,11 +2,20 @@
# See license.txt
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from .quality_procedure import add_node
class UnitTestQualityProcedure(UnitTestCase):
"""
Unit tests for QualityProcedure.
Use this class for testing individual functions and methods.
"""
pass
class TestQualityProcedure(IntegrationTestCase):
def test_add_node(self):
procedure = create_procedure(

View File

@@ -5,7 +5,7 @@
import json
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.tests.utils import make_test_records
from frappe.utils import flt
@@ -23,6 +23,15 @@ test_dependencies = ["Payment Term", "Payment Terms Template"]
test_records = frappe.get_test_records("Customer")
class UnitTestCustomer(UnitTestCase):
"""
Unit tests for Customer.
Use this class for testing individual functions and methods.
"""
pass
class TestCustomer(IntegrationTestCase):
def setUp(self):
if not frappe.get_value("Item", "_Test Item"):

View File

@@ -2,7 +2,7 @@
# See license.txt
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from erpnext.controllers.queries import item_query
@@ -18,6 +18,15 @@ def create_party_specific_item(**args):
psi.insert()
class UnitTestPartySpecificItem(UnitTestCase):
"""
Unit tests for PartySpecificItem.
Use this class for testing individual functions and methods.
"""
pass
class TestPartySpecificItem(IntegrationTestCase):
def setUp(self):
self.customer = frappe.get_last_doc("Customer")

View File

@@ -2,7 +2,7 @@
# License: GNU General Public License v3. See license.txt
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.utils import add_days, add_months, flt, getdate, nowdate
from erpnext.controllers.accounts_controller import InvalidQtyError
@@ -10,6 +10,15 @@ from erpnext.controllers.accounts_controller import InvalidQtyError
test_dependencies = ["Product Bundle"]
class UnitTestQuotation(UnitTestCase):
"""
Unit tests for Quotation.
Use this class for testing individual functions and methods.
"""
pass
class TestQuotation(IntegrationTestCase):
def test_quotation_qty(self):
qo = make_quotation(qty=0, do_not_save=True)

View File

@@ -2,7 +2,16 @@
# See license.txt
# import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
class UnitTestIncoterm(UnitTestCase):
"""
Unit tests for Incoterm.
Use this class for testing individual functions and methods.
"""
pass
class TestIncoterm(IntegrationTestCase):

View File

@@ -3,7 +3,16 @@
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
class UnitTestTransactionDeletionRecord(UnitTestCase):
"""
Unit tests for TransactionDeletionRecord.
Use this class for testing individual functions and methods.
"""
pass
class TestTransactionDeletionRecord(IntegrationTestCase):

View File

@@ -5,7 +5,7 @@ import json
import frappe
from frappe.exceptions import ValidationError
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.utils import cint, flt
from frappe.utils.data import add_to_date, getdate
@@ -24,6 +24,15 @@ from erpnext.stock.get_item_details import get_item_details
from erpnext.stock.serial_batch_bundle import SerialBatchCreation
class UnitTestBatch(UnitTestCase):
"""
Unit tests for Batch.
Use this class for testing individual functions and methods.
"""
pass
class TestBatch(IntegrationTestCase):
def test_item_has_batch_enabled(self):
self.assertRaises(

View File

@@ -2,12 +2,21 @@
# See license.txt
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from erpnext.stock.doctype.item.test_item import make_item
from erpnext.stock.utils import _create_bin
class UnitTestBin(UnitTestCase):
"""
Unit tests for Bin.
Use this class for testing individual functions and methods.
"""
pass
class TestBin(IntegrationTestCase):
def test_concurrent_inserts(self):
"""Ensure no duplicates are possible in case of concurrent inserts"""

View File

@@ -2,7 +2,16 @@
# See license.txt
# import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
class UnitTestClosingStockBalance(UnitTestCase):
"""
Unit tests for ClosingStockBalance.
Use this class for testing individual functions and methods.
"""
pass
class TestClosingStockBalance(IntegrationTestCase):

View File

@@ -5,7 +5,7 @@
import json
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.utils import add_days, cstr, flt, getdate, nowdate, nowtime, today
from erpnext.accounts.doctype.account.test_account import get_inventory_account
@@ -43,6 +43,15 @@ from erpnext.stock.doctype.warehouse.test_warehouse import get_warehouse
from erpnext.stock.stock_ledger import get_previous_sle
class UnitTestDeliveryNote(UnitTestCase):
"""
Unit tests for DeliveryNote.
Use this class for testing individual functions and methods.
"""
pass
class TestDeliveryNote(IntegrationTestCase):
def test_delivery_note_qty(self):
dn = create_delivery_note(qty=0, do_not_save=True)

View File

@@ -3,7 +3,7 @@
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.utils import add_days, flt, now_datetime, nowdate
import erpnext
@@ -14,6 +14,15 @@ from erpnext.stock.doctype.delivery_trip.delivery_trip import (
from erpnext.tests.utils import create_test_contact_and_address
class UnitTestDeliveryTrip(UnitTestCase):
"""
Unit tests for DeliveryTrip.
Use this class for testing individual functions and methods.
"""
pass
class TestDeliveryTrip(IntegrationTestCase):
def setUp(self):
super().setUp()

View File

@@ -3,7 +3,7 @@
import frappe
from frappe.custom.doctype.custom_field.custom_field import create_custom_field
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.utils import nowdate, nowtime
from erpnext.stock.doctype.delivery_note.test_delivery_note import create_delivery_note
@@ -19,6 +19,15 @@ from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry
from erpnext.stock.doctype.warehouse.test_warehouse import create_warehouse
class UnitTestInventoryDimension(UnitTestCase):
"""
Unit tests for InventoryDimension.
Use this class for testing individual functions and methods.
"""
pass
class TestInventoryDimension(IntegrationTestCase):
def setUp(self):
prepare_test_data()

View File

@@ -7,7 +7,7 @@ import json
import frappe
from frappe.custom.doctype.property_setter.property_setter import make_property_setter
from frappe.test_runner import make_test_objects
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.utils import add_days, today
from erpnext.controllers.item_variant import (
@@ -74,6 +74,15 @@ def make_item(item_code=None, properties=None, uoms=None, barcode=None):
return item
class UnitTestItem(UnitTestCase):
"""
Unit tests for Item.
Use this class for testing individual functions and methods.
"""
pass
class TestItem(IntegrationTestCase):
def setUp(self):
super().setUp()

View File

@@ -2,7 +2,7 @@
# See license.txt
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.utils import flt
from erpnext.controllers.subcontracting_controller import make_rm_stock_entry
@@ -26,6 +26,15 @@ from erpnext.subcontracting.doctype.subcontracting_order.subcontracting_order im
)
class UnitTestItemAlternative(UnitTestCase):
"""
Unit tests for ItemAlternative.
Use this class for testing individual functions and methods.
"""
pass
class TestItemAlternative(IntegrationTestCase):
def setUp(self):
super().setUp()

View File

@@ -6,11 +6,20 @@ import frappe
test_records = frappe.get_test_records("Item Attribute")
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from erpnext.stock.doctype.item_attribute.item_attribute import ItemAttributeIncrementError
class UnitTestItemAttribute(UnitTestCase):
"""
Unit tests for ItemAttribute.
Use this class for testing individual functions and methods.
"""
pass
class TestItemAttribute(IntegrationTestCase):
def setUp(self):
super().setUp()

View File

@@ -3,13 +3,22 @@
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.tests.utils import make_test_records_for_doctype
from erpnext.stock.doctype.item_price.item_price import ItemPriceDuplicateItem
from erpnext.stock.get_item_details import get_price_list_rate_for, process_args
class UnitTestItemPrice(UnitTestCase):
"""
Unit tests for ItemPrice.
Use this class for testing individual functions and methods.
"""
pass
class TestItemPrice(IntegrationTestCase):
def setUp(self):
super().setUp()

View File

@@ -3,7 +3,7 @@
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.utils import add_days, add_to_date, flt, now, nowtime, today
from erpnext.accounts.doctype.account.test_account import create_account, get_inventory_account
@@ -21,6 +21,15 @@ from erpnext.stock.doctype.serial_and_batch_bundle.test_serial_and_batch_bundle
from erpnext.stock.serial_batch_bundle import SerialNoValuation
class UnitTestLandedCostVoucher(UnitTestCase):
"""
Unit tests for LandedCostVoucher.
Use this class for testing individual functions and methods.
"""
pass
class TestLandedCostVoucher(IntegrationTestCase):
def test_landed_cost_voucher(self):
frappe.db.set_single_value("Buying Settings", "allow_multiple_items", 1)

View File

@@ -6,7 +6,7 @@
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.utils import flt, today
from erpnext.controllers.accounts_controller import InvalidQtyError
@@ -20,6 +20,15 @@ from erpnext.stock.doctype.material_request.material_request import (
)
class UnitTestMaterialRequest(UnitTestCase):
"""
Unit tests for MaterialRequest.
Use this class for testing individual functions and methods.
"""
pass
class TestMaterialRequest(IntegrationTestCase):
def test_material_request_qty(self):
mr = frappe.copy_doc(test_records[0])

View File

@@ -3,7 +3,7 @@
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.utils import add_to_date, nowdate
from erpnext.selling.doctype.sales_order.sales_order import make_delivery_note
@@ -40,6 +40,15 @@ def create_product_bundle(
return bundle, components
class UnitTestPackedItem(UnitTestCase):
"""
Unit tests for PackedItem.
Use this class for testing individual functions and methods.
"""
pass
class TestPackedItem(IntegrationTestCase):
"Test impact on Packed Items table in various scenarios."

View File

@@ -3,7 +3,7 @@
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from erpnext.selling.doctype.product_bundle.test_product_bundle import make_product_bundle
from erpnext.stock.doctype.delivery_note.delivery_note import make_packing_slip
@@ -11,6 +11,15 @@ from erpnext.stock.doctype.delivery_note.test_delivery_note import create_delive
from erpnext.stock.doctype.item.test_item import make_item
class UnitTestPackingSlip(UnitTestCase):
"""
Unit tests for PackingSlip.
Use this class for testing individual functions and methods.
"""
pass
class TestPackingSlip(IntegrationTestCase):
def test_packing_slip(self):
# Step - 1: Create a Product Bundle

View File

@@ -3,7 +3,7 @@
import frappe
from frappe import _dict
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from erpnext.selling.doctype.sales_order.sales_order import create_pick_list
from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order
@@ -24,6 +24,15 @@ from erpnext.stock.doctype.stock_reconciliation.stock_reconciliation import (
test_dependencies = ["Item", "Sales Invoice", "Stock Entry", "Batch"]
class UnitTestPickList(UnitTestCase):
"""
Unit tests for PickList.
Use this class for testing individual functions and methods.
"""
pass
class TestPickList(IntegrationTestCase):
def test_pick_list_picks_warehouse_for_each_item(self):
item_code = make_item().name

View File

@@ -2,7 +2,7 @@
# License: GNU General Public License v3. See license.txt
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.utils import add_days, cint, cstr, flt, get_datetime, getdate, nowtime, today
from pypika import functions as fn
@@ -26,6 +26,15 @@ from erpnext.stock.doctype.serial_and_batch_bundle.test_serial_and_batch_bundle
from erpnext.stock.doctype.warehouse.test_warehouse import create_warehouse
class UnitTestPurchaseReceipt(UnitTestCase):
"""
Unit tests for PurchaseReceipt.
Use this class for testing individual functions and methods.
"""
pass
class TestPurchaseReceipt(IntegrationTestCase):
def setUp(self):
frappe.db.set_single_value("Buying Settings", "allow_multiple_items", 1)

View File

@@ -2,7 +2,7 @@
# See license.txt
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from erpnext.stock.doctype.batch.test_batch import make_new_batch
from erpnext.stock.doctype.item.test_item import make_item
@@ -16,6 +16,15 @@ from erpnext.stock.doctype.warehouse.test_warehouse import create_warehouse
from erpnext.stock.get_item_details import get_conversion_factor
class UnitTestPutawayRule(UnitTestCase):
"""
Unit tests for PutawayRule.
Use this class for testing individual functions and methods.
"""
pass
class TestPutawayRule(IntegrationTestCase):
def setUp(self):
if not frappe.db.exists("Item", "_Rice"):

View File

@@ -2,7 +2,7 @@
# See license.txt
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.utils import nowdate
from erpnext.controllers.stock_controller import (
@@ -18,6 +18,15 @@ from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry
# test_records = frappe.get_test_records('Quality Inspection')
class UnitTestQualityInspection(UnitTestCase):
"""
Unit tests for QualityInspection.
Use this class for testing individual functions and methods.
"""
pass
class TestQualityInspection(IntegrationTestCase):
def setUp(self):
super().setUp()

View File

@@ -4,7 +4,7 @@
import json
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.utils import flt, nowtime, today
from erpnext.stock.doctype.item.test_item import make_item
@@ -16,6 +16,15 @@ from erpnext.stock.doctype.serial_and_batch_bundle.serial_and_batch_bundle impor
from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry
class UnitTestSerialAndBatchBundle(UnitTestCase):
"""
Unit tests for SerialAndBatchBundle.
Use this class for testing individual functions and methods.
"""
pass
class TestSerialandBatchBundle(IntegrationTestCase):
def test_inward_outward_serial_valuation(self):
from erpnext.stock.doctype.delivery_note.test_delivery_note import create_delivery_note

View File

@@ -7,7 +7,7 @@
import frappe
from frappe import _dict
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from erpnext.stock.doctype.delivery_note.test_delivery_note import create_delivery_note
from erpnext.stock.doctype.item.test_item import make_item
@@ -25,6 +25,15 @@ test_dependencies = ["Item"]
test_records = frappe.get_test_records("Serial No")
class UnitTestSerialNo(UnitTestCase):
"""
Unit tests for SerialNo.
Use this class for testing individual functions and methods.
"""
pass
class TestSerialNo(IntegrationTestCase):
def tearDown(self):
frappe.db.rollback()

View File

@@ -4,11 +4,20 @@
from datetime import date, timedelta
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from erpnext.stock.doctype.delivery_note.delivery_note import make_shipment
class UnitTestShipment(UnitTestCase):
"""
Unit tests for Shipment.
Use this class for testing individual functions and methods.
"""
pass
class TestShipment(IntegrationTestCase):
def test_shipment_from_delivery_note(self):
delivery_note = create_test_delivery_note()

View File

@@ -3,7 +3,7 @@
from frappe.permissions import add_user_permission, remove_user_permission
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.utils import add_days, cstr, flt, get_time, getdate, nowtime, today
from erpnext.accounts.doctype.account.test_account import get_inventory_account
@@ -49,6 +49,15 @@ def get_sle(**args):
)
class UnitTestStockEntry(UnitTestCase):
"""
Unit tests for StockEntry.
Use this class for testing individual functions and methods.
"""
pass
class TestStockEntry(IntegrationTestCase):
def tearDown(self):
frappe.db.rollback()

View File

@@ -8,7 +8,7 @@ from uuid import uuid4
import frappe
from frappe.core.page.permission_manager.permission_manager import reset
from frappe.custom.doctype.property_setter.property_setter import make_property_setter
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.utils import add_days, add_to_date, flt, today
from erpnext.accounts.doctype.gl_entry.gl_entry import rename_gle_sle_docs
@@ -1551,6 +1551,15 @@ def get_unique_suffix():
return str(uuid4())[:8].upper()
class UnitTestStockLedgerEntry(UnitTestCase):
"""
Unit tests for StockLedgerEntry.
Use this class for testing individual functions and methods.
"""
pass
class TestDeferredNaming(IntegrationTestCase):
@classmethod
def setUpClass(cls) -> None:

View File

@@ -4,7 +4,7 @@
from random import randint
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.utils import today
from erpnext.selling.doctype.sales_order.sales_order import create_pick_list, make_delivery_note
@@ -21,6 +21,15 @@ from erpnext.stock.doctype.stock_reservation_entry.stock_reservation_entry impor
from erpnext.stock.utils import get_stock_balance
class UnitTestStockReservationEntry(UnitTestCase):
"""
Unit tests for StockReservationEntry.
Use this class for testing individual functions and methods.
"""
pass
class TestStockReservationEntry(IntegrationTestCase):
def setUp(self) -> None:
self.warehouse = "_Test Warehouse - _TC"

View File

@@ -3,7 +3,16 @@
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
class UnitTestStockSettings(UnitTestCase):
"""
Unit tests for StockSettings.
Use this class for testing individual functions and methods.
"""
pass
class TestStockSettings(IntegrationTestCase):

View File

@@ -2,7 +2,7 @@
# License: GNU General Public License v3. See license.txt
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.tests.utils import make_test_records
import erpnext
@@ -14,6 +14,15 @@ from erpnext.stock.doctype.warehouse.warehouse import convert_to_group_or_ledger
test_records = frappe.get_test_records("Warehouse")
class UnitTestWarehouse(UnitTestCase):
"""
Unit tests for Warehouse.
Use this class for testing individual functions and methods.
"""
pass
class TestWarehouse(IntegrationTestCase):
def setUp(self):
super().setUp()

View File

@@ -2,7 +2,16 @@
# See license.txt
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
class UnitTestSubcontractingBom(UnitTestCase):
"""
Unit tests for SubcontractingBom.
Use this class for testing individual functions and methods.
"""
pass
class TestSubcontractingBOM(IntegrationTestCase):

View File

@@ -5,7 +5,7 @@ import copy
from collections import defaultdict
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.utils import flt
from erpnext.buying.doctype.purchase_order.purchase_order import get_mapped_subcontracting_order
@@ -32,6 +32,15 @@ from erpnext.subcontracting.doctype.subcontracting_order.subcontracting_order im
)
class UnitTestSubcontractingOrder(UnitTestCase):
"""
Unit tests for SubcontractingOrder.
Use this class for testing individual functions and methods.
"""
pass
class TestSubcontractingOrder(IntegrationTestCase):
def setUp(self):
make_subcontracted_items()

View File

@@ -5,7 +5,7 @@
import copy
import frappe
from frappe.tests import IntegrationTestCase
from frappe.tests import IntegrationTestCase, UnitTestCase
from frappe.utils import add_days, cint, flt, nowtime, today
import erpnext
@@ -40,6 +40,15 @@ from erpnext.subcontracting.doctype.subcontracting_order.subcontracting_order im
)
class UnitTestSubcontractingReceipt(UnitTestCase):
"""
Unit tests for SubcontractingReceipt.
Use this class for testing individual functions and methods.
"""
pass
class TestSubcontractingReceipt(IntegrationTestCase):
def setUp(self):
make_subcontracted_items()