diff --git a/erpnext/accounts/doctype/account_closing_balance/test_account_closing_balance.py b/erpnext/accounts/doctype/account_closing_balance/test_account_closing_balance.py index 53f4e5d15af..c24fb115d0a 100644 --- a/erpnext/accounts/doctype/account_closing_balance/test_account_closing_balance.py +++ b/erpnext/accounts/doctype/account_closing_balance/test_account_closing_balance.py @@ -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): diff --git a/erpnext/accounts/doctype/bank_transaction/test_auto_match_party.py b/erpnext/accounts/doctype/bank_transaction/test_auto_match_party.py index f49b443065b..db87a72aba4 100644 --- a/erpnext/accounts/doctype/bank_transaction/test_auto_match_party.py +++ b/erpnext/accounts/doctype/bank_transaction/test_auto_match_party.py @@ -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): diff --git a/erpnext/accounts/doctype/bank_transaction/test_bank_transaction.py b/erpnext/accounts/doctype/bank_transaction/test_bank_transaction.py index ca62fc9b3f4..9f9fa349c37 100644 --- a/erpnext/accounts/doctype/bank_transaction/test_bank_transaction.py +++ b/erpnext/accounts/doctype/bank_transaction/test_bank_transaction.py @@ -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 [ diff --git a/erpnext/accounts/doctype/bisect_accounting_statements/test_bisect_accounting_statements.py b/erpnext/accounts/doctype/bisect_accounting_statements/test_bisect_accounting_statements.py index fd1793b2560..6c680c80183 100644 --- a/erpnext/accounts/doctype/bisect_accounting_statements/test_bisect_accounting_statements.py +++ b/erpnext/accounts/doctype/bisect_accounting_statements/test_bisect_accounting_statements.py @@ -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): diff --git a/erpnext/accounts/doctype/bisect_nodes/test_bisect_nodes.py b/erpnext/accounts/doctype/bisect_nodes/test_bisect_nodes.py index 1f37009d8e2..e56c0769c71 100644 --- a/erpnext/accounts/doctype/bisect_nodes/test_bisect_nodes.py +++ b/erpnext/accounts/doctype/bisect_nodes/test_bisect_nodes.py @@ -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): diff --git a/erpnext/accounts/doctype/dunning/test_dunning.py b/erpnext/accounts/doctype/dunning/test_dunning.py index 155977f7cfc..20bf1c462db 100644 --- a/erpnext/accounts/doctype/dunning/test_dunning.py +++ b/erpnext/accounts/doctype/dunning/test_dunning.py @@ -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): diff --git a/erpnext/accounts/doctype/journal_entry/test_journal_entry.py b/erpnext/accounts/doctype/journal_entry/test_journal_entry.py index ce2dff26f3b..87e335ef779 100644 --- a/erpnext/accounts/doctype/journal_entry/test_journal_entry.py +++ b/erpnext/accounts/doctype/journal_entry/test_journal_entry.py @@ -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} diff --git a/erpnext/accounts/doctype/ledger_health_monitor/test_ledger_health_monitor.py b/erpnext/accounts/doctype/ledger_health_monitor/test_ledger_health_monitor.py index bc2193f10ce..a5aacde416e 100644 --- a/erpnext/accounts/doctype/ledger_health_monitor/test_ledger_health_monitor.py +++ b/erpnext/accounts/doctype/ledger_health_monitor/test_ledger_health_monitor.py @@ -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): diff --git a/erpnext/accounts/doctype/opening_invoice_creation_tool/test_opening_invoice_creation_tool.py b/erpnext/accounts/doctype/opening_invoice_creation_tool/test_opening_invoice_creation_tool.py index bee36a86706..ead36abd38a 100644 --- a/erpnext/accounts/doctype/opening_invoice_creation_tool/test_opening_invoice_creation_tool.py +++ b/erpnext/accounts/doctype/opening_invoice_creation_tool/test_opening_invoice_creation_tool.py @@ -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): diff --git a/erpnext/accounts/doctype/payment_entry/test_payment_entry.py b/erpnext/accounts/doctype/payment_entry/test_payment_entry.py index 25ab212c760..6b347c0e41c 100644 --- a/erpnext/accounts/doctype/payment_entry/test_payment_entry.py +++ b/erpnext/accounts/doctype/payment_entry/test_payment_entry.py @@ -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() diff --git a/erpnext/accounts/doctype/payment_ledger_entry/test_payment_ledger_entry.py b/erpnext/accounts/doctype/payment_ledger_entry/test_payment_ledger_entry.py index 1de103764a4..13598735aef 100644 --- a/erpnext/accounts/doctype/payment_ledger_entry/test_payment_ledger_entry.py +++ b/erpnext/accounts/doctype/payment_ledger_entry/test_payment_ledger_entry.py @@ -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") diff --git a/erpnext/accounts/doctype/payment_order/test_payment_order.py b/erpnext/accounts/doctype/payment_order/test_payment_order.py index a261bc6b0b8..e98531bc54d 100644 --- a/erpnext/accounts/doctype/payment_order/test_payment_order.py +++ b/erpnext/accounts/doctype/payment_order/test_payment_order.py @@ -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 diff --git a/erpnext/accounts/doctype/payment_reconciliation/test_payment_reconciliation.py b/erpnext/accounts/doctype/payment_reconciliation/test_payment_reconciliation.py index 227ffaebcb0..74314e129c0 100644 --- a/erpnext/accounts/doctype/payment_reconciliation/test_payment_reconciliation.py +++ b/erpnext/accounts/doctype/payment_reconciliation/test_payment_reconciliation.py @@ -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() diff --git a/erpnext/accounts/doctype/payment_request/test_payment_request.py b/erpnext/accounts/doctype/payment_request/test_payment_request.py index 381f9b64573..42f67ab0bc8 100644 --- a/erpnext/accounts/doctype/payment_request/test_payment_request.py +++ b/erpnext/accounts/doctype/payment_request/test_payment_request.py @@ -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: diff --git a/erpnext/accounts/doctype/pos_invoice_merge_log/test_pos_invoice_merge_log.py b/erpnext/accounts/doctype/pos_invoice_merge_log/test_pos_invoice_merge_log.py index bdced41b287..f53a58bf32d 100644 --- a/erpnext/accounts/doctype/pos_invoice_merge_log/test_pos_invoice_merge_log.py +++ b/erpnext/accounts/doctype/pos_invoice_merge_log/test_pos_invoice_merge_log.py @@ -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`") diff --git a/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py b/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py index 95d668b0c4b..e184fdfc42f 100644 --- a/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py +++ b/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py @@ -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() diff --git a/erpnext/accounts/doctype/process_payment_reconciliation/test_process_payment_reconciliation.py b/erpnext/accounts/doctype/process_payment_reconciliation/test_process_payment_reconciliation.py index d54ff6f902e..68a87960802 100644 --- a/erpnext/accounts/doctype/process_payment_reconciliation/test_process_payment_reconciliation.py +++ b/erpnext/accounts/doctype/process_payment_reconciliation/test_process_payment_reconciliation.py @@ -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): diff --git a/erpnext/accounts/doctype/process_payment_reconciliation_log/test_process_payment_reconciliation_log.py b/erpnext/accounts/doctype/process_payment_reconciliation_log/test_process_payment_reconciliation_log.py index 66a4dca21e1..6705820e8b3 100644 --- a/erpnext/accounts/doctype/process_payment_reconciliation_log/test_process_payment_reconciliation_log.py +++ b/erpnext/accounts/doctype/process_payment_reconciliation_log/test_process_payment_reconciliation_log.py @@ -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): diff --git a/erpnext/accounts/doctype/process_subscription/test_process_subscription.py b/erpnext/accounts/doctype/process_subscription/test_process_subscription.py index 5ec80641192..ad52f72cf0f 100644 --- a/erpnext/accounts/doctype/process_subscription/test_process_subscription.py +++ b/erpnext/accounts/doctype/process_subscription/test_process_subscription.py @@ -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): diff --git a/erpnext/accounts/doctype/repost_accounting_ledger_settings/test_repost_accounting_ledger_settings.py b/erpnext/accounts/doctype/repost_accounting_ledger_settings/test_repost_accounting_ledger_settings.py index 2dd4c50ba7e..dac5835d728 100644 --- a/erpnext/accounts/doctype/repost_accounting_ledger_settings/test_repost_accounting_ledger_settings.py +++ b/erpnext/accounts/doctype/repost_accounting_ledger_settings/test_repost_accounting_ledger_settings.py @@ -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): diff --git a/erpnext/accounts/doctype/repost_payment_ledger/test_repost_payment_ledger.py b/erpnext/accounts/doctype/repost_payment_ledger/test_repost_payment_ledger.py index a09ba71e27c..ef169f28eff 100644 --- a/erpnext/accounts/doctype/repost_payment_ledger/test_repost_payment_ledger.py +++ b/erpnext/accounts/doctype/repost_payment_ledger/test_repost_payment_ledger.py @@ -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): diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py index 06a3eaddd03..2c1657f2835 100644 --- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py @@ -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 diff --git a/erpnext/accounts/doctype/subscription/test_subscription.py b/erpnext/accounts/doctype/subscription/test_subscription.py index 111771fb120..926abfea5a0 100644 --- a/erpnext/accounts/doctype/subscription/test_subscription.py +++ b/erpnext/accounts/doctype/subscription/test_subscription.py @@ -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() diff --git a/erpnext/accounts/doctype/tax_withholding_category/test_tax_withholding_category.py b/erpnext/accounts/doctype/tax_withholding_category/test_tax_withholding_category.py index 7a546cc4847..66639190efd 100644 --- a/erpnext/accounts/doctype/tax_withholding_category/test_tax_withholding_category.py +++ b/erpnext/accounts/doctype/tax_withholding_category/test_tax_withholding_category.py @@ -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): diff --git a/erpnext/assets/doctype/asset_activity/test_asset_activity.py b/erpnext/assets/doctype/asset_activity/test_asset_activity.py index 1c7d472c88b..01d02d43f1c 100644 --- a/erpnext/assets/doctype/asset_activity/test_asset_activity.py +++ b/erpnext/assets/doctype/asset_activity/test_asset_activity.py @@ -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): diff --git a/erpnext/assets/doctype/asset_depreciation_schedule/test_asset_depreciation_schedule.py b/erpnext/assets/doctype/asset_depreciation_schedule/test_asset_depreciation_schedule.py index c803d12fd9d..61e3761719e 100644 --- a/erpnext/assets/doctype/asset_depreciation_schedule/test_asset_depreciation_schedule.py +++ b/erpnext/assets/doctype/asset_depreciation_schedule/test_asset_depreciation_schedule.py @@ -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() diff --git a/erpnext/assets/doctype/asset_shift_allocation/test_asset_shift_allocation.py b/erpnext/assets/doctype/asset_shift_allocation/test_asset_shift_allocation.py index ba3a8bab87e..a739a7551db 100644 --- a/erpnext/assets/doctype/asset_shift_allocation/test_asset_shift_allocation.py +++ b/erpnext/assets/doctype/asset_shift_allocation/test_asset_shift_allocation.py @@ -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): diff --git a/erpnext/assets/doctype/asset_shift_factor/test_asset_shift_factor.py b/erpnext/assets/doctype/asset_shift_factor/test_asset_shift_factor.py index 12d68b02c5f..9416d325cc2 100644 --- a/erpnext/assets/doctype/asset_shift_factor/test_asset_shift_factor.py +++ b/erpnext/assets/doctype/asset_shift_factor/test_asset_shift_factor.py @@ -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): diff --git a/erpnext/bulk_transaction/doctype/bulk_transaction_log/test_bulk_transaction_log.py b/erpnext/bulk_transaction/doctype/bulk_transaction_log/test_bulk_transaction_log.py index 66e6456d103..4cd27de01e7 100644 --- a/erpnext/bulk_transaction/doctype/bulk_transaction_log/test_bulk_transaction_log.py +++ b/erpnext/bulk_transaction/doctype/bulk_transaction_log/test_bulk_transaction_log.py @@ -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): diff --git a/erpnext/bulk_transaction/doctype/bulk_transaction_log_detail/test_bulk_transaction_log_detail.py b/erpnext/bulk_transaction/doctype/bulk_transaction_log_detail/test_bulk_transaction_log_detail.py index 6b9b4637ab4..ecfdbdba49b 100644 --- a/erpnext/bulk_transaction/doctype/bulk_transaction_log_detail/test_bulk_transaction_log_detail.py +++ b/erpnext/bulk_transaction/doctype/bulk_transaction_log_detail/test_bulk_transaction_log_detail.py @@ -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): diff --git a/erpnext/buying/doctype/purchase_order/test_purchase_order.py b/erpnext/buying/doctype/purchase_order/test_purchase_order.py index a1a8bc43bba..68cab872d8f 100644 --- a/erpnext/buying/doctype/purchase_order/test_purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/test_purchase_order.py @@ -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) diff --git a/erpnext/buying/doctype/request_for_quotation/test_request_for_quotation.py b/erpnext/buying/doctype/request_for_quotation/test_request_for_quotation.py index 62c99452ff8..63d995f562b 100644 --- a/erpnext/buying/doctype/request_for_quotation/test_request_for_quotation.py +++ b/erpnext/buying/doctype/request_for_quotation/test_request_for_quotation.py @@ -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) diff --git a/erpnext/buying/doctype/supplier/test_supplier.py b/erpnext/buying/doctype/supplier/test_supplier.py index 9aa424d9c03..29caec86cce 100644 --- a/erpnext/buying/doctype/supplier/test_supplier.py +++ b/erpnext/buying/doctype/supplier/test_supplier.py @@ -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): diff --git a/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.py b/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.py index cdf0b8e3fc9..9008fa73443 100644 --- a/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.py +++ b/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.py @@ -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]) diff --git a/erpnext/buying/doctype/supplier_scorecard/test_supplier_scorecard.py b/erpnext/buying/doctype/supplier_scorecard/test_supplier_scorecard.py index c65ebe2086f..de7e8bd7b12 100644 --- a/erpnext/buying/doctype/supplier_scorecard/test_supplier_scorecard.py +++ b/erpnext/buying/doctype/supplier_scorecard/test_supplier_scorecard.py @@ -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): diff --git a/erpnext/buying/doctype/supplier_scorecard_criteria/test_supplier_scorecard_criteria.py b/erpnext/buying/doctype/supplier_scorecard_criteria/test_supplier_scorecard_criteria.py index 7b98d6d23c0..516d0e38222 100644 --- a/erpnext/buying/doctype/supplier_scorecard_criteria/test_supplier_scorecard_criteria.py +++ b/erpnext/buying/doctype/supplier_scorecard_criteria/test_supplier_scorecard_criteria.py @@ -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): diff --git a/erpnext/buying/doctype/supplier_scorecard_variable/test_supplier_scorecard_variable.py b/erpnext/buying/doctype/supplier_scorecard_variable/test_supplier_scorecard_variable.py index 8f4b2f4ecdf..cbf06e074c1 100644 --- a/erpnext/buying/doctype/supplier_scorecard_variable/test_supplier_scorecard_variable.py +++ b/erpnext/buying/doctype/supplier_scorecard_variable/test_supplier_scorecard_variable.py @@ -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: diff --git a/erpnext/manufacturing/doctype/blanket_order/test_blanket_order.py b/erpnext/manufacturing/doctype/blanket_order/test_blanket_order.py index 169197e04ca..148e38fd50d 100644 --- a/erpnext/manufacturing/doctype/blanket_order/test_blanket_order.py +++ b/erpnext/manufacturing/doctype/blanket_order/test_blanket_order.py @@ -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() diff --git a/erpnext/manufacturing/doctype/bom/test_bom.py b/erpnext/manufacturing/doctype/bom/test_bom.py index f2f9f156439..2c6806c2f1e 100644 --- a/erpnext/manufacturing/doctype/bom/test_bom.py +++ b/erpnext/manufacturing/doctype/bom/test_bom.py @@ -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): diff --git a/erpnext/manufacturing/doctype/bom_creator/test_bom_creator.py b/erpnext/manufacturing/doctype/bom_creator/test_bom_creator.py index cfcd288e098..79b9e669ae3 100644 --- a/erpnext/manufacturing/doctype/bom_creator/test_bom_creator.py +++ b/erpnext/manufacturing/doctype/bom_creator/test_bom_creator.py @@ -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() diff --git a/erpnext/manufacturing/doctype/bom_update_log/test_bom_update_log.py b/erpnext/manufacturing/doctype/bom_update_log/test_bom_update_log.py index 22eae7facd5..43d49a3e27d 100644 --- a/erpnext/manufacturing/doctype/bom_update_log/test_bom_update_log.py +++ b/erpnext/manufacturing/doctype/bom_update_log/test_bom_update_log.py @@ -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." diff --git a/erpnext/manufacturing/doctype/bom_update_tool/test_bom_update_tool.py b/erpnext/manufacturing/doctype/bom_update_tool/test_bom_update_tool.py index 0a65fe5d5ca..ff4aa2553a4 100644 --- a/erpnext/manufacturing/doctype/bom_update_tool/test_bom_update_tool.py +++ b/erpnext/manufacturing/doctype/bom_update_tool/test_bom_update_tool.py @@ -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." diff --git a/erpnext/manufacturing/doctype/job_card/test_job_card.py b/erpnext/manufacturing/doctype/job_card/test_job_card.py index cbe69a1c3e3..ad78eff7ae1 100644 --- a/erpnext/manufacturing/doctype/job_card/test_job_card.py +++ b/erpnext/manufacturing/doctype/job_card/test_job_card.py @@ -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() diff --git a/erpnext/manufacturing/doctype/plant_floor/test_plant_floor.py b/erpnext/manufacturing/doctype/plant_floor/test_plant_floor.py index 78a8662e1fc..cbc231754f9 100644 --- a/erpnext/manufacturing/doctype/plant_floor/test_plant_floor.py +++ b/erpnext/manufacturing/doctype/plant_floor/test_plant_floor.py @@ -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): diff --git a/erpnext/manufacturing/doctype/production_plan/test_production_plan.py b/erpnext/manufacturing/doctype/production_plan/test_production_plan.py index 02c39ec18b4..56e593e91a1 100644 --- a/erpnext/manufacturing/doctype/production_plan/test_production_plan.py +++ b/erpnext/manufacturing/doctype/production_plan/test_production_plan.py @@ -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 [ diff --git a/erpnext/manufacturing/doctype/routing/test_routing.py b/erpnext/manufacturing/doctype/routing/test_routing.py index 66fd9773ffb..6fe6a5456e5 100644 --- a/erpnext/manufacturing/doctype/routing/test_routing.py +++ b/erpnext/manufacturing/doctype/routing/test_routing.py @@ -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): diff --git a/erpnext/manufacturing/doctype/work_order/test_work_order.py b/erpnext/manufacturing/doctype/work_order/test_work_order.py index efbd41a9fb4..68acb9fd9f2 100644 --- a/erpnext/manufacturing/doctype/work_order/test_work_order.py +++ b/erpnext/manufacturing/doctype/work_order/test_work_order.py @@ -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" diff --git a/erpnext/manufacturing/doctype/workstation/test_workstation.py b/erpnext/manufacturing/doctype/workstation/test_workstation.py index 0c1b02c7c01..84712f8fa1b 100644 --- a/erpnext/manufacturing/doctype/workstation/test_workstation.py +++ b/erpnext/manufacturing/doctype/workstation/test_workstation.py @@ -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( diff --git a/erpnext/manufacturing/doctype/workstation_type/test_workstation_type.py b/erpnext/manufacturing/doctype/workstation_type/test_workstation_type.py index 7e62d4c4ffe..e36d3f2a583 100644 --- a/erpnext/manufacturing/doctype/workstation_type/test_workstation_type.py +++ b/erpnext/manufacturing/doctype/workstation_type/test_workstation_type.py @@ -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): diff --git a/erpnext/projects/doctype/project/test_project.py b/erpnext/projects/doctype/project/test_project.py index c21526d709a..f3f61d55b58 100644 --- a/erpnext/projects/doctype/project/test_project.py +++ b/erpnext/projects/doctype/project/test_project.py @@ -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" diff --git a/erpnext/quality_management/doctype/quality_procedure/test_quality_procedure.py b/erpnext/quality_management/doctype/quality_procedure/test_quality_procedure.py index 64022ec4c37..97bca751965 100644 --- a/erpnext/quality_management/doctype/quality_procedure/test_quality_procedure.py +++ b/erpnext/quality_management/doctype/quality_procedure/test_quality_procedure.py @@ -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( diff --git a/erpnext/selling/doctype/customer/test_customer.py b/erpnext/selling/doctype/customer/test_customer.py index 4e95fda87d9..1ddda0399b0 100644 --- a/erpnext/selling/doctype/customer/test_customer.py +++ b/erpnext/selling/doctype/customer/test_customer.py @@ -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"): diff --git a/erpnext/selling/doctype/party_specific_item/test_party_specific_item.py b/erpnext/selling/doctype/party_specific_item/test_party_specific_item.py index 8e0d8bcd16e..42f981f94b7 100644 --- a/erpnext/selling/doctype/party_specific_item/test_party_specific_item.py +++ b/erpnext/selling/doctype/party_specific_item/test_party_specific_item.py @@ -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") diff --git a/erpnext/selling/doctype/quotation/test_quotation.py b/erpnext/selling/doctype/quotation/test_quotation.py index 320b3d4f685..ecbb70a01a0 100644 --- a/erpnext/selling/doctype/quotation/test_quotation.py +++ b/erpnext/selling/doctype/quotation/test_quotation.py @@ -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) diff --git a/erpnext/setup/doctype/incoterm/test_incoterm.py b/erpnext/setup/doctype/incoterm/test_incoterm.py index e38854e648b..36ae5fd4e6a 100644 --- a/erpnext/setup/doctype/incoterm/test_incoterm.py +++ b/erpnext/setup/doctype/incoterm/test_incoterm.py @@ -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): diff --git a/erpnext/setup/doctype/transaction_deletion_record/test_transaction_deletion_record.py b/erpnext/setup/doctype/transaction_deletion_record/test_transaction_deletion_record.py index fcfb006860c..77bedaed9ea 100644 --- a/erpnext/setup/doctype/transaction_deletion_record/test_transaction_deletion_record.py +++ b/erpnext/setup/doctype/transaction_deletion_record/test_transaction_deletion_record.py @@ -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): diff --git a/erpnext/stock/doctype/batch/test_batch.py b/erpnext/stock/doctype/batch/test_batch.py index 7d94f34b161..4c761943f12 100644 --- a/erpnext/stock/doctype/batch/test_batch.py +++ b/erpnext/stock/doctype/batch/test_batch.py @@ -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( diff --git a/erpnext/stock/doctype/bin/test_bin.py b/erpnext/stock/doctype/bin/test_bin.py index 7ed3089e05e..66f14d84d51 100644 --- a/erpnext/stock/doctype/bin/test_bin.py +++ b/erpnext/stock/doctype/bin/test_bin.py @@ -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""" diff --git a/erpnext/stock/doctype/closing_stock_balance/test_closing_stock_balance.py b/erpnext/stock/doctype/closing_stock_balance/test_closing_stock_balance.py index 369c92d64a4..e477de2ff2a 100644 --- a/erpnext/stock/doctype/closing_stock_balance/test_closing_stock_balance.py +++ b/erpnext/stock/doctype/closing_stock_balance/test_closing_stock_balance.py @@ -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): diff --git a/erpnext/stock/doctype/delivery_note/test_delivery_note.py b/erpnext/stock/doctype/delivery_note/test_delivery_note.py index 23d9d2dc950..86aea2329ca 100644 --- a/erpnext/stock/doctype/delivery_note/test_delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/test_delivery_note.py @@ -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) diff --git a/erpnext/stock/doctype/delivery_trip/test_delivery_trip.py b/erpnext/stock/doctype/delivery_trip/test_delivery_trip.py index 9966af7c99b..40fe4f75df9 100644 --- a/erpnext/stock/doctype/delivery_trip/test_delivery_trip.py +++ b/erpnext/stock/doctype/delivery_trip/test_delivery_trip.py @@ -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() diff --git a/erpnext/stock/doctype/inventory_dimension/test_inventory_dimension.py b/erpnext/stock/doctype/inventory_dimension/test_inventory_dimension.py index d7f7ac2cbd2..b83543b6fbd 100644 --- a/erpnext/stock/doctype/inventory_dimension/test_inventory_dimension.py +++ b/erpnext/stock/doctype/inventory_dimension/test_inventory_dimension.py @@ -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() diff --git a/erpnext/stock/doctype/item/test_item.py b/erpnext/stock/doctype/item/test_item.py index a3751abeb07..934dde3ef41 100644 --- a/erpnext/stock/doctype/item/test_item.py +++ b/erpnext/stock/doctype/item/test_item.py @@ -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() diff --git a/erpnext/stock/doctype/item_alternative/test_item_alternative.py b/erpnext/stock/doctype/item_alternative/test_item_alternative.py index d96061e0d94..442ae755a7d 100644 --- a/erpnext/stock/doctype/item_alternative/test_item_alternative.py +++ b/erpnext/stock/doctype/item_alternative/test_item_alternative.py @@ -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() diff --git a/erpnext/stock/doctype/item_attribute/test_item_attribute.py b/erpnext/stock/doctype/item_attribute/test_item_attribute.py index 9b4dd031046..f4b49cc538c 100644 --- a/erpnext/stock/doctype/item_attribute/test_item_attribute.py +++ b/erpnext/stock/doctype/item_attribute/test_item_attribute.py @@ -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() diff --git a/erpnext/stock/doctype/item_price/test_item_price.py b/erpnext/stock/doctype/item_price/test_item_price.py index 66f474accc4..4713f4cf582 100644 --- a/erpnext/stock/doctype/item_price/test_item_price.py +++ b/erpnext/stock/doctype/item_price/test_item_price.py @@ -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() diff --git a/erpnext/stock/doctype/landed_cost_voucher/test_landed_cost_voucher.py b/erpnext/stock/doctype/landed_cost_voucher/test_landed_cost_voucher.py index cfceb989aae..b38ea5d5930 100644 --- a/erpnext/stock/doctype/landed_cost_voucher/test_landed_cost_voucher.py +++ b/erpnext/stock/doctype/landed_cost_voucher/test_landed_cost_voucher.py @@ -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) diff --git a/erpnext/stock/doctype/material_request/test_material_request.py b/erpnext/stock/doctype/material_request/test_material_request.py index 58cb655c679..9d1fd84f932 100644 --- a/erpnext/stock/doctype/material_request/test_material_request.py +++ b/erpnext/stock/doctype/material_request/test_material_request.py @@ -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]) diff --git a/erpnext/stock/doctype/packed_item/test_packed_item.py b/erpnext/stock/doctype/packed_item/test_packed_item.py index 5ace12184a7..6c710453a98 100644 --- a/erpnext/stock/doctype/packed_item/test_packed_item.py +++ b/erpnext/stock/doctype/packed_item/test_packed_item.py @@ -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." diff --git a/erpnext/stock/doctype/packing_slip/test_packing_slip.py b/erpnext/stock/doctype/packing_slip/test_packing_slip.py index 8d16b2d8fe0..dbd9892c4c3 100644 --- a/erpnext/stock/doctype/packing_slip/test_packing_slip.py +++ b/erpnext/stock/doctype/packing_slip/test_packing_slip.py @@ -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 diff --git a/erpnext/stock/doctype/pick_list/test_pick_list.py b/erpnext/stock/doctype/pick_list/test_pick_list.py index 098b52e7c75..d719dbb42de 100644 --- a/erpnext/stock/doctype/pick_list/test_pick_list.py +++ b/erpnext/stock/doctype/pick_list/test_pick_list.py @@ -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 diff --git a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py index aaeb8fb5536..488d0f5f5b3 100644 --- a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py @@ -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) diff --git a/erpnext/stock/doctype/putaway_rule/test_putaway_rule.py b/erpnext/stock/doctype/putaway_rule/test_putaway_rule.py index df285665a38..bfdf3715fc9 100644 --- a/erpnext/stock/doctype/putaway_rule/test_putaway_rule.py +++ b/erpnext/stock/doctype/putaway_rule/test_putaway_rule.py @@ -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"): diff --git a/erpnext/stock/doctype/quality_inspection/test_quality_inspection.py b/erpnext/stock/doctype/quality_inspection/test_quality_inspection.py index 95bd98fa4be..3343b208263 100644 --- a/erpnext/stock/doctype/quality_inspection/test_quality_inspection.py +++ b/erpnext/stock/doctype/quality_inspection/test_quality_inspection.py @@ -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() diff --git a/erpnext/stock/doctype/serial_and_batch_bundle/test_serial_and_batch_bundle.py b/erpnext/stock/doctype/serial_and_batch_bundle/test_serial_and_batch_bundle.py index c56c3539097..f156f993fd6 100644 --- a/erpnext/stock/doctype/serial_and_batch_bundle/test_serial_and_batch_bundle.py +++ b/erpnext/stock/doctype/serial_and_batch_bundle/test_serial_and_batch_bundle.py @@ -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 diff --git a/erpnext/stock/doctype/serial_no/test_serial_no.py b/erpnext/stock/doctype/serial_no/test_serial_no.py index 9a353d932eb..9e2861cc186 100644 --- a/erpnext/stock/doctype/serial_no/test_serial_no.py +++ b/erpnext/stock/doctype/serial_no/test_serial_no.py @@ -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() diff --git a/erpnext/stock/doctype/shipment/test_shipment.py b/erpnext/stock/doctype/shipment/test_shipment.py index 69cefd4d0cd..197f6f8342d 100644 --- a/erpnext/stock/doctype/shipment/test_shipment.py +++ b/erpnext/stock/doctype/shipment/test_shipment.py @@ -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() diff --git a/erpnext/stock/doctype/stock_entry/test_stock_entry.py b/erpnext/stock/doctype/stock_entry/test_stock_entry.py index add87eb5e0c..e4aa2fd8427 100644 --- a/erpnext/stock/doctype/stock_entry/test_stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/test_stock_entry.py @@ -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() diff --git a/erpnext/stock/doctype/stock_ledger_entry/test_stock_ledger_entry.py b/erpnext/stock/doctype/stock_ledger_entry/test_stock_ledger_entry.py index 29118d01fba..4c9f019986d 100644 --- a/erpnext/stock/doctype/stock_ledger_entry/test_stock_ledger_entry.py +++ b/erpnext/stock/doctype/stock_ledger_entry/test_stock_ledger_entry.py @@ -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: diff --git a/erpnext/stock/doctype/stock_reservation_entry/test_stock_reservation_entry.py b/erpnext/stock/doctype/stock_reservation_entry/test_stock_reservation_entry.py index 7c17800555a..6e37d246e7f 100644 --- a/erpnext/stock/doctype/stock_reservation_entry/test_stock_reservation_entry.py +++ b/erpnext/stock/doctype/stock_reservation_entry/test_stock_reservation_entry.py @@ -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" diff --git a/erpnext/stock/doctype/stock_settings/test_stock_settings.py b/erpnext/stock/doctype/stock_settings/test_stock_settings.py index 138cb536995..cce4ce74f41 100644 --- a/erpnext/stock/doctype/stock_settings/test_stock_settings.py +++ b/erpnext/stock/doctype/stock_settings/test_stock_settings.py @@ -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): diff --git a/erpnext/stock/doctype/warehouse/test_warehouse.py b/erpnext/stock/doctype/warehouse/test_warehouse.py index 6709e6174a7..9c2cca995cf 100644 --- a/erpnext/stock/doctype/warehouse/test_warehouse.py +++ b/erpnext/stock/doctype/warehouse/test_warehouse.py @@ -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() diff --git a/erpnext/subcontracting/doctype/subcontracting_bom/test_subcontracting_bom.py b/erpnext/subcontracting/doctype/subcontracting_bom/test_subcontracting_bom.py index a831211af93..f94fc806199 100644 --- a/erpnext/subcontracting/doctype/subcontracting_bom/test_subcontracting_bom.py +++ b/erpnext/subcontracting/doctype/subcontracting_bom/test_subcontracting_bom.py @@ -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): diff --git a/erpnext/subcontracting/doctype/subcontracting_order/test_subcontracting_order.py b/erpnext/subcontracting/doctype/subcontracting_order/test_subcontracting_order.py index 010d504d023..aca315e00d1 100644 --- a/erpnext/subcontracting/doctype/subcontracting_order/test_subcontracting_order.py +++ b/erpnext/subcontracting/doctype/subcontracting_order/test_subcontracting_order.py @@ -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() diff --git a/erpnext/subcontracting/doctype/subcontracting_receipt/test_subcontracting_receipt.py b/erpnext/subcontracting/doctype/subcontracting_receipt/test_subcontracting_receipt.py index d7b32bda0f6..b0355a1aeb4 100644 --- a/erpnext/subcontracting/doctype/subcontracting_receipt/test_subcontracting_receipt.py +++ b/erpnext/subcontracting/doctype/subcontracting_receipt/test_subcontracting_receipt.py @@ -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()