refactor: replace IntegrationTestCase with ERPNextTestCase repo-wide

- import ERPNextTestSuite
 - use it on test class
This commit is contained in:
ruthra kumar
2026-01-20 10:12:06 +05:30
parent 0fdc961a4b
commit f1dfac417d
319 changed files with 870 additions and 867 deletions

View File

@@ -3,7 +3,6 @@
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import nowdate
from erpnext.accounts.doctype.account.account import (
@@ -12,9 +11,10 @@ from erpnext.accounts.doctype.account.account import (
update_account_number,
)
from erpnext.stock import get_company_default_inventory_account, get_warehouse_account
from erpnext.tests.utils import ERPNextTestSuite
class TestAccount(IntegrationTestCase):
class TestAccount(ERPNextTestSuite):
def test_rename_account(self):
if not frappe.db.exists("Account", "1210 - Debtors - _TC"):
acc = frappe.new_doc("Account")

View File

@@ -2,8 +2,9 @@
# See license.txt
# import frappe
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ERPNextTestSuite
class TestAccountClosingBalance(IntegrationTestCase):
class TestAccountClosingBalance(ERPNextTestSuite):
pass

View File

@@ -3,13 +3,13 @@
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
from erpnext.tests.utils import ERPNextTestSuite
class TestAccountingDimension(IntegrationTestCase):
class TestAccountingDimension(ERPNextTestSuite):
def setUp(self):
create_dimension()

View File

@@ -11,9 +11,10 @@ from erpnext.accounts.doctype.accounting_dimension.test_accounting_dimension imp
)
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
from erpnext.exceptions import InvalidAccountDimensionError, MandatoryAccountDimensionError
from erpnext.tests.utils import ERPNextTestSuite
class TestAccountingDimensionFilter(unittest.TestCase):
class TestAccountingDimensionFilter(ERPNextTestSuite):
def setUp(self):
create_dimension()
create_accounting_dimension_filter()

View File

@@ -3,7 +3,6 @@
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import add_months, nowdate
from erpnext.accounts.doctype.accounting_period.accounting_period import (
@@ -11,9 +10,10 @@ from erpnext.accounts.doctype.accounting_period.accounting_period import (
OverlapError,
)
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
from erpnext.tests.utils import ERPNextTestSuite
class TestAccountingPeriod(IntegrationTestCase):
class TestAccountingPeriod(ERPNextTestSuite):
def test_overlap(self):
ap1 = create_accounting_period(
start_date="2018-04-01", end_date="2018-06-30", company="Wind Power LLC"

View File

@@ -1,10 +1,11 @@
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ERPNextTestSuite
class TestAccountsSettings(IntegrationTestCase):
class TestAccountsSettings(ERPNextTestSuite):
def tearDown(self):
# Just in case `save` method succeeds, we need to take things back to default so that other tests
# don't break

View File

@@ -2,7 +2,6 @@
# See license.txt
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import nowdate, today
from erpnext.accounts.doctype.payment_entry.test_payment_entry import get_payment_entry
@@ -10,12 +9,13 @@ from erpnext.accounts.test.accounts_mixin import AccountsTestMixin
from erpnext.buying.doctype.purchase_order.test_purchase_order import create_purchase_order
from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order
# On IntegrationTestCase, the doctype test records and all
# On ERPNextTestSuite, the doctype test records and all
# link-field test record depdendencies are recursively loaded
# Use these module variables to add/remove to/from that list
from erpnext.tests.utils import ERPNextTestSuite
class TestAdvancePaymentLedgerEntry(AccountsTestMixin, IntegrationTestCase):
class TestAdvancePaymentLedgerEntry(AccountsTestMixin, ERPNextTestSuite):
"""
Integration tests for AdvancePaymentLedgerEntry.
Use this class for testing interactions between multiple components.

View File

@@ -2,8 +2,8 @@
# See license.txt
import unittest
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ERPNextTestSuite
class TestBank(IntegrationTestCase):
class TestBank(ERPNextTestSuite):
pass

View File

@@ -2,10 +2,8 @@
# See license.txt
import unittest
import frappe
from frappe import ValidationError
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ERPNextTestSuite
class TestBankAccount(IntegrationTestCase):
class TestBankAccount(ERPNextTestSuite):
pass

View File

@@ -2,8 +2,8 @@
# See license.txt
import unittest
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ERPNextTestSuite
class TestBankAccountSubtype(IntegrationTestCase):
class TestBankAccountSubtype(ERPNextTestSuite):
pass

View File

@@ -3,8 +3,8 @@
# import frappe
import unittest
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ERPNextTestSuite
class TestBankAccountType(IntegrationTestCase):
class TestBankAccountType(ERPNextTestSuite):
pass

View File

@@ -3,7 +3,6 @@
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import add_months, getdate
from erpnext.accounts.doctype.cost_center.test_cost_center import create_cost_center
@@ -15,10 +14,10 @@ from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import make
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
from erpnext.stock.doctype.item.test_item import create_item
from erpnext.stock.doctype.warehouse.test_warehouse import create_warehouse
from erpnext.tests.utils import if_lending_app_installed, if_lending_app_not_installed
from erpnext.tests.utils import ERPNextTestSuite, if_lending_app_installed, if_lending_app_not_installed
class TestBankClearance(IntegrationTestCase):
class TestBankClearance(ERPNextTestSuite):
@classmethod
def setUpClass(cls):
super().setUpClass()

View File

@@ -2,8 +2,8 @@
# See license.txt
import unittest
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ERPNextTestSuite
class TestBankGuarantee(IntegrationTestCase):
class TestBankGuarantee(ERPNextTestSuite):
pass

View File

@@ -4,7 +4,6 @@
import frappe
from frappe import qb
from frappe.tests import IntegrationTestCase
from frappe.utils import add_days, today
from erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool import (
@@ -13,9 +12,10 @@ from erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool
)
from erpnext.accounts.doctype.payment_entry.test_payment_entry import create_payment_entry
from erpnext.accounts.test.accounts_mixin import AccountsTestMixin
from erpnext.tests.utils import ERPNextTestSuite
class TestBankReconciliationTool(AccountsTestMixin, IntegrationTestCase):
class TestBankReconciliationTool(AccountsTestMixin, ERPNextTestSuite):
def setUp(self):
self.create_company()
self.create_customer()

View File

@@ -1,15 +1,14 @@
# Copyright (c) 2020, Frappe Technologies and Contributors
# See license.txt
import unittest
from erpnext.accounts.doctype.bank_statement_import.bank_statement_import import (
is_mt940_format,
preprocess_mt940_content,
)
from erpnext.tests.utils import ERPNextTestSuite
class TestBankStatementImport(unittest.TestCase):
class TestBankStatementImport(ERPNextTestSuite):
"""Unit tests for Bank Statement Import functions"""
def test_preprocess_mt940_content_with_long_statement_number(self):

View File

@@ -2,16 +2,16 @@
# License: GNU General Public License v3. See license.txt
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import nowdate
from erpnext.accounts.doctype.bank_transaction.test_bank_transaction import create_bank_account
from erpnext.tests.utils import ERPNextTestSuite
IBAN_1 = "DE02000000003716541159"
IBAN_2 = "DE02500105170137075030"
class TestAutoMatchParty(IntegrationTestCase):
class TestAutoMatchParty(ERPNextTestSuite):
@classmethod
def setUpClass(cls):
create_bank_account()

View File

@@ -6,7 +6,6 @@ import json
import frappe
from frappe import utils
from frappe.model.docstatus import DocStatus
from frappe.tests import IntegrationTestCase
from erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool import (
get_linked_payments,
@@ -19,10 +18,10 @@ from erpnext.accounts.doctype.payment_entry.test_payment_entry import get_paymen
from erpnext.accounts.doctype.pos_profile.test_pos_profile import make_pos_profile
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
from erpnext.tests.utils import if_lending_app_installed
from erpnext.tests.utils import ERPNextTestSuite, if_lending_app_installed
class TestBankTransaction(IntegrationTestCase):
class TestBankTransaction(ERPNextTestSuite):
def setUp(self):
make_pos_profile()

View File

@@ -2,8 +2,10 @@
# See license.txt
# import frappe
from frappe.tests import IntegrationTestCase
class TestBisectAccountingStatements(IntegrationTestCase):
from erpnext.tests.utils import ERPNextTestSuite
class TestBisectAccountingStatements(ERPNextTestSuite):
pass

View File

@@ -2,8 +2,10 @@
# See license.txt
# import frappe
from frappe.tests import IntegrationTestCase
class TestBisectNodes(IntegrationTestCase):
from erpnext.tests.utils import ERPNextTestSuite
class TestBisectNodes(ERPNextTestSuite):
pass

View File

@@ -2,8 +2,8 @@
# See license.txt
import unittest
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ERPNextTestSuite
class TestCashierClosing(IntegrationTestCase):
class TestCashierClosing(ERPNextTestSuite):
pass

View File

@@ -2,8 +2,8 @@
# See license.txt
import unittest
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ERPNextTestSuite
class TestChartofAccountsImporter(IntegrationTestCase):
class TestChartofAccountsImporter(ERPNextTestSuite):
pass

View File

@@ -2,8 +2,8 @@
# See license.txt
import unittest
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ERPNextTestSuite
class TestChequePrintTemplate(IntegrationTestCase):
class TestChequePrintTemplate(ERPNextTestSuite):
pass

View File

@@ -3,10 +3,11 @@
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ERPNextTestSuite
class TestCostCenter(IntegrationTestCase):
class TestCostCenter(ERPNextTestSuite):
def test_cost_center_creation_against_child_node(self):
cost_center = frappe.get_doc(
{

View File

@@ -4,7 +4,6 @@ import unittest
import frappe
from frappe.query_builder.functions import Sum
from frappe.tests import IntegrationTestCase
from frappe.utils import add_days, today
from erpnext.accounts.doctype.cost_center.test_cost_center import create_cost_center
@@ -16,9 +15,10 @@ from erpnext.accounts.doctype.cost_center_allocation.cost_center_allocation impo
WrongPercentageAllocation,
)
from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry
from erpnext.tests.utils import ERPNextTestSuite
class TestCostCenterAllocation(IntegrationTestCase):
class TestCostCenterAllocation(ERPNextTestSuite):
def setUp(self):
cost_centers = [
"Main Cost Center 1",
@@ -191,7 +191,7 @@ class TestCostCenterAllocation(IntegrationTestCase):
coa2.cancel()
jv.cancel()
@IntegrationTestCase.change_settings("System Settings", {"rounding_method": "Commercial Rounding"})
@ERPNextTestSuite.change_settings("System Settings", {"rounding_method": "Commercial Rounding"})
def test_debit_credit_on_cost_center_allocation_for_commercial_rounding(self):
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice

View File

@@ -3,9 +3,9 @@
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order
from erpnext.tests.utils import ERPNextTestSuite
def test_create_test_data():
@@ -108,7 +108,7 @@ def test_create_test_data():
coupon_code.insert()
class TestCouponCode(IntegrationTestCase):
class TestCouponCode(ERPNextTestSuite):
def setUp(self):
test_create_test_data()

View File

@@ -3,8 +3,8 @@
# import frappe
import unittest
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ERPNextTestSuite
class TestCurrencyExchangeSettings(IntegrationTestCase):
class TestCurrencyExchangeSettings(ERPNextTestSuite):
pass

View File

@@ -4,7 +4,6 @@ import json
import frappe
from frappe.model import mapper
from frappe.tests import IntegrationTestCase
from frappe.utils import add_days, nowdate, today
from erpnext import get_default_cost_center
@@ -18,9 +17,10 @@ from erpnext.accounts.doctype.sales_invoice.sales_invoice import (
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import (
create_sales_invoice_against_cost_center,
)
from erpnext.tests.utils import ERPNextTestSuite
class TestDunning(IntegrationTestCase):
class TestDunning(ERPNextTestSuite):
@classmethod
def setUpClass(cls):
super().setUpClass()

View File

@@ -3,8 +3,8 @@
# import frappe
import unittest
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ERPNextTestSuite
class TestDunningType(IntegrationTestCase):
class TestDunningType(ERPNextTestSuite):
pass

View File

@@ -5,15 +5,15 @@
import frappe
from frappe.query_builder import functions
from frappe.query_builder.utils import DocType
from frappe.tests import IntegrationTestCase
from frappe.utils import add_days, flt, today
from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
from erpnext.accounts.test.accounts_mixin import AccountsTestMixin
from erpnext.tests.utils import ERPNextTestSuite
class TestExchangeRateRevaluation(AccountsTestMixin, IntegrationTestCase):
class TestExchangeRateRevaluation(AccountsTestMixin, ERPNextTestSuite):
def setUp(self):
self.create_company()
self.create_usd_receivable_account()
@@ -37,7 +37,7 @@ class TestExchangeRateRevaluation(AccountsTestMixin, IntegrationTestCase):
company_doc.unrealized_exchange_gain_loss_account = company_doc.exchange_gain_loss_account
company_doc.save()
@IntegrationTestCase.change_settings(
@ERPNextTestSuite.change_settings(
"Accounts Settings",
{"allow_multi_currency_invoices_against_single_party_account": 1, "allow_stale": 0},
)
@@ -91,7 +91,7 @@ class TestExchangeRateRevaluation(AccountsTestMixin, IntegrationTestCase):
)[0]
self.assertEqual(acc_balance.balance, 8500.0)
@IntegrationTestCase.change_settings(
@ERPNextTestSuite.change_settings(
"Accounts Settings",
{"allow_multi_currency_invoices_against_single_party_account": 1, "allow_stale": 0},
)
@@ -164,7 +164,7 @@ class TestExchangeRateRevaluation(AccountsTestMixin, IntegrationTestCase):
self.assertEqual(acc_balance.balance, 0.0)
self.assertEqual(acc_balance.balance_in_account_currency, 0.0)
@IntegrationTestCase.change_settings(
@ERPNextTestSuite.change_settings(
"Accounts Settings",
{"allow_multi_currency_invoices_against_single_party_account": 1, "allow_stale": 0},
)
@@ -259,7 +259,7 @@ class TestExchangeRateRevaluation(AccountsTestMixin, IntegrationTestCase):
self.assertEqual(flt(acc_balance.balance, precision), 0.0)
self.assertEqual(flt(acc_balance.balance_in_account_currency, precision), 0.0)
@IntegrationTestCase.change_settings(
@ERPNextTestSuite.change_settings(
"Accounts Settings",
{"allow_multi_currency_invoices_against_single_party_account": 1, "allow_stale": 0},
)

View File

@@ -3,12 +3,12 @@
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry
from erpnext.tests.utils import ERPNextTestSuite
class TestFinanceBook(IntegrationTestCase):
class TestFinanceBook(ERPNextTestSuite):
def test_finance_book(self):
finance_book = create_finance_book()

View File

@@ -3,11 +3,12 @@
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import now_datetime
from erpnext.tests.utils import ERPNextTestSuite
class TestFiscalYear(IntegrationTestCase):
class TestFiscalYear(ERPNextTestSuite):
def test_extra_year(self):
if frappe.db.exists("Fiscal Year", "_Test Fiscal Year 2000"):
frappe.delete_doc("Fiscal Year", "_Test Fiscal Year 2000")

View File

@@ -4,13 +4,13 @@ import unittest
import frappe
from frappe.model.naming import parse_naming_series
from frappe.tests import IntegrationTestCase
from erpnext.accounts.doctype.gl_entry.gl_entry import rename_gle_sle_docs
from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry
from erpnext.tests.utils import ERPNextTestSuite
class TestGLEntry(IntegrationTestCase):
class TestGLEntry(ERPNextTestSuite):
def test_round_off_entry(self):
frappe.db.set_value("Company", "_Test Company", "round_off_account", "_Test Write Off - _TC")
frappe.db.set_value("Company", "_Test Company", "round_off_cost_center", "_Test Cost Center - _TC")

View File

@@ -3,16 +3,16 @@
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import add_days, flt, nowdate
from erpnext.accounts.doctype.account.test_account import create_account
from erpnext.accounts.doctype.journal_entry.journal_entry import get_payment_entry_against_invoice
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import get_gl_entries
from erpnext.tests.utils import ERPNextTestSuite
class TestInvoiceDiscounting(IntegrationTestCase):
class TestInvoiceDiscounting(ERPNextTestSuite):
def setUp(self):
self.ar_credit = create_account(
account_name="_Test Accounts Receivable Credit",

View File

@@ -2,8 +2,8 @@
# See license.txt
import unittest
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ERPNextTestSuite
class TestItemTaxTemplate(IntegrationTestCase):
class TestItemTaxTemplate(ERPNextTestSuite):
pass

View File

@@ -2,19 +2,17 @@
# License: GNU General Public License v3. See license.txt
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import flt, nowdate
from erpnext.accounts.doctype.account.test_account import get_inventory_account
from erpnext.accounts.doctype.journal_entry.journal_entry import StockAccountInvalidTransaction
from erpnext.exceptions import InvalidAccountCurrency
from erpnext.selling.doctype.customer.test_customer import make_customer, set_credit_limit
from erpnext.tests.utils import ERPNextTestSuite
class TestJournalEntry(IntegrationTestCase):
@IntegrationTestCase.change_settings(
"Accounts Settings", {"unlink_payment_on_cancellation_of_invoice": 1}
)
class TestJournalEntry(ERPNextTestSuite):
@ERPNextTestSuite.change_settings("Accounts Settings", {"unlink_payment_on_cancellation_of_invoice": 1})
def test_journal_entry_with_against_jv(self):
jv_invoice = frappe.copy_doc(self.globalTestRecords["Journal Entry"][2])
base_jv = frappe.copy_doc(self.globalTestRecords["Journal Entry"][0])

View File

@@ -3,8 +3,8 @@
# import frappe
import unittest
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ERPNextTestSuite
class TestJournalEntryTemplate(IntegrationTestCase):
class TestJournalEntryTemplate(ERPNextTestSuite):
pass

View File

@@ -3,14 +3,14 @@
import frappe
from frappe import qb
from frappe.tests import IntegrationTestCase
from frappe.utils import nowdate
from erpnext.accounts.test.accounts_mixin import AccountsTestMixin
from erpnext.accounts.utils import run_ledger_health_checks
from erpnext.tests.utils import ERPNextTestSuite
class TestLedgerHealth(AccountsTestMixin, IntegrationTestCase):
class TestLedgerHealth(AccountsTestMixin, ERPNextTestSuite):
def setUp(self):
self.create_company()
self.create_customer()

View File

@@ -2,8 +2,10 @@
# See license.txt
# import frappe
from frappe.tests import IntegrationTestCase
class TestLedgerHealthMonitor(IntegrationTestCase):
from erpnext.tests.utils import ERPNextTestSuite
class TestLedgerHealthMonitor(ERPNextTestSuite):
pass

View File

@@ -3,12 +3,12 @@
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from erpnext.accounts.doctype.ledger_merge.ledger_merge import start_merge
from erpnext.tests.utils import ERPNextTestSuite
class TestLedgerMerge(IntegrationTestCase):
class TestLedgerMerge(ERPNextTestSuite):
def test_merge_success(self):
if not frappe.db.exists("Account", "Indirect Expenses - _TC"):
acc = frappe.new_doc("Account")

View File

@@ -3,14 +3,14 @@
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import today
from erpnext.accounts.doctype.loyalty_program.test_loyalty_program import create_records
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
from erpnext.tests.utils import ERPNextTestSuite
class TestLoyaltyPointEntry(IntegrationTestCase):
class TestLoyaltyPointEntry(ERPNextTestSuite):
@classmethod
def setUpClass(cls):
super().setUpClass()

View File

@@ -3,7 +3,6 @@
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import cint, flt, getdate, today
from erpnext.accounts.doctype.loyalty_program.loyalty_program import (
@@ -11,9 +10,10 @@ from erpnext.accounts.doctype.loyalty_program.loyalty_program import (
get_loyalty_program_details_with_points,
)
from erpnext.accounts.party import get_dashboard_info
from erpnext.tests.utils import ERPNextTestSuite
class TestLoyaltyProgram(IntegrationTestCase):
class TestLoyaltyProgram(ERPNextTestSuite):
@classmethod
def setUpClass(cls):
super().setUpClass()

View File

@@ -3,10 +3,11 @@
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ERPNextTestSuite
class TestModeofPayment(IntegrationTestCase):
class TestModeofPayment(ERPNextTestSuite):
pass

View File

@@ -2,9 +2,8 @@
# See license.txt
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ERPNextTestSuite
class TestMonthlyDistribution(IntegrationTestCase):
class TestMonthlyDistribution(ERPNextTestSuite):
pass

View File

@@ -2,7 +2,6 @@
# See license.txt
import frappe
from frappe.tests import IntegrationTestCase
from erpnext.accounts.doctype.accounting_dimension.test_accounting_dimension import (
create_dimension,
@@ -11,9 +10,10 @@ from erpnext.accounts.doctype.accounting_dimension.test_accounting_dimension imp
from erpnext.accounts.doctype.opening_invoice_creation_tool.opening_invoice_creation_tool import (
get_temporary_opening_account,
)
from erpnext.tests.utils import ERPNextTestSuite
class TestOpeningInvoiceCreationTool(IntegrationTestCase):
class TestOpeningInvoiceCreationTool(ERPNextTestSuite):
@classmethod
def setUpClass(cls):
if not frappe.db.exists("Company", "_Test Opening Invoice Company"):

View File

@@ -3,8 +3,8 @@
# import frappe
import unittest
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ERPNextTestSuite
class TestPartyLink(IntegrationTestCase):
class TestPartyLink(ERPNextTestSuite):
pass

View File

@@ -4,7 +4,6 @@
import frappe
from frappe import qb
from frappe.tests import IntegrationTestCase
from frappe.utils import add_days, flt, nowdate
from erpnext.accounts.doctype.account.test_account import create_account
@@ -24,9 +23,10 @@ from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import (
)
from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order
from erpnext.setup.doctype.employee.test_employee import make_employee
from erpnext.tests.utils import ERPNextTestSuite
class TestPaymentEntry(IntegrationTestCase):
class TestPaymentEntry(ERPNextTestSuite):
def tearDown(self):
frappe.db.rollback()
@@ -425,7 +425,7 @@ class TestPaymentEntry(IntegrationTestCase):
self.assertEqual(si.payment_schedule[0].outstanding, 0)
self.assertEqual(si.payment_schedule[0].discounted_amount, 50)
@IntegrationTestCase.change_settings(
@ERPNextTestSuite.change_settings(
"Accounts Settings",
{
"allow_multi_currency_invoices_against_single_party_account": 1,
@@ -1156,7 +1156,7 @@ class TestPaymentEntry(IntegrationTestCase):
}
self.assertDictEqual(ref_details, expected_response)
@IntegrationTestCase.change_settings(
@ERPNextTestSuite.change_settings(
"Accounts Settings",
{
"unlink_payment_on_cancellation_of_invoice": 1,
@@ -1251,7 +1251,7 @@ class TestPaymentEntry(IntegrationTestCase):
si3.cancel()
si3.delete()
@IntegrationTestCase.change_settings(
@ERPNextTestSuite.change_settings(
"Accounts Settings",
{
"unlink_payment_on_cancellation_of_invoice": 1,
@@ -1947,7 +1947,7 @@ class TestPaymentEntry(IntegrationTestCase):
# 'Is Opening' should always be 'No' for normal advance payments
self.assertEqual(gl_with_opening_set, [])
@IntegrationTestCase.change_settings("Accounts Settings", {"delete_linked_ledger_entries": 1})
@ERPNextTestSuite.change_settings("Accounts Settings", {"delete_linked_ledger_entries": 1})
def test_delete_linked_exchange_gain_loss_journal(self):
from erpnext.accounts.doctype.account.test_account import create_account
from erpnext.accounts.doctype.opening_invoice_creation_tool.test_opening_invoice_creation_tool import (

View File

@@ -2,8 +2,8 @@
# See license.txt
import unittest
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ERPNextTestSuite
class TestPaymentGatewayAccount(IntegrationTestCase):
class TestPaymentGatewayAccount(ERPNextTestSuite):
pass

View File

@@ -3,7 +3,6 @@
import frappe
from frappe import qb
from frappe.tests import IntegrationTestCase
from frappe.utils import nowdate
from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry
@@ -11,9 +10,10 @@ from erpnext.accounts.doctype.payment_entry.test_payment_entry import create_pay
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order
from erpnext.stock.doctype.item.test_item import create_item
from erpnext.tests.utils import ERPNextTestSuite
class TestPaymentLedgerEntry(IntegrationTestCase):
class TestPaymentLedgerEntry(ERPNextTestSuite):
def setUp(self):
self.ple = qb.DocType("Payment Ledger Entry")
self.create_company()
@@ -445,7 +445,7 @@ class TestPaymentLedgerEntry(IntegrationTestCase):
self.assertEqual(pl_entries_for_crnote[0], expected_values[0])
self.assertEqual(pl_entries_for_crnote[1], expected_values[1])
@IntegrationTestCase.change_settings(
@ERPNextTestSuite.change_settings(
"Accounts Settings",
{"unlink_payment_on_cancellation_of_invoice": 1, "delete_linked_ledger_entries": 1},
)
@@ -474,7 +474,7 @@ class TestPaymentLedgerEntry(IntegrationTestCase):
si.delete()
self.assertRaises(frappe.DoesNotExistError, frappe.get_doc, si.doctype, si.name)
@IntegrationTestCase.change_settings(
@ERPNextTestSuite.change_settings(
"Accounts Settings",
{"unlink_payment_on_cancellation_of_invoice": 1, "delete_linked_ledger_entries": 1},
)
@@ -507,7 +507,7 @@ class TestPaymentLedgerEntry(IntegrationTestCase):
si.delete()
self.assertRaises(frappe.DoesNotExistError, frappe.get_doc, si.doctype, si.name)
@IntegrationTestCase.change_settings(
@ERPNextTestSuite.change_settings(
"Accounts Settings",
{
"unlink_payment_on_cancellation_of_invoice": 1,

View File

@@ -3,7 +3,6 @@
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import getdate
from erpnext.accounts.doctype.bank_transaction.test_bank_transaction import (
@@ -15,9 +14,10 @@ from erpnext.accounts.doctype.payment_entry.payment_entry import (
make_payment_order,
)
from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import make_purchase_invoice
from erpnext.tests.utils import ERPNextTestSuite
class TestPaymentOrder(IntegrationTestCase):
class TestPaymentOrder(ERPNextTestSuite):
def setUp(self):
# generate and use a uniq hash identifier for 'Bank Account' and it's linked GL 'Account' to avoid validation error
uniq_identifier = frappe.generate_hash(length=10)

View File

@@ -4,7 +4,6 @@
import frappe
from frappe import qb
from frappe.tests import IntegrationTestCase
from frappe.utils import add_days, add_years, flt, getdate, nowdate, today
from frappe.utils.data import getdate as convert_to_date
@@ -17,9 +16,10 @@ from erpnext.accounts.party import get_party_account
from erpnext.accounts.utils import get_fiscal_year
from erpnext.buying.doctype.purchase_order.test_purchase_order import create_purchase_order
from erpnext.stock.doctype.item.test_item import create_item
from erpnext.tests.utils import ERPNextTestSuite
class TestPaymentReconciliation(IntegrationTestCase):
class TestPaymentReconciliation(ERPNextTestSuite):
def setUp(self):
self.create_company()
self.create_item()
@@ -1233,7 +1233,7 @@ class TestPaymentReconciliation(IntegrationTestCase):
payment_vouchers = [x.get("reference_name") for x in pr.get("payments")]
self.assertCountEqual(payment_vouchers, [je2.name, pe2.name])
@IntegrationTestCase.change_settings(
@ERPNextTestSuite.change_settings(
"Accounts Settings",
{
"allow_multi_currency_invoices_against_single_party_account": 1,

View File

@@ -7,7 +7,6 @@ import unittest
from unittest.mock import patch
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import add_days, nowdate
from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry
@@ -18,6 +17,7 @@ from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sal
from erpnext.buying.doctype.purchase_order.test_purchase_order import create_purchase_order
from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order
from erpnext.setup.utils import get_exchange_rate
from erpnext.tests.utils import ERPNextTestSuite
PAYMENT_URL = "https://example.com/payment"
@@ -62,7 +62,7 @@ payment_method = [
]
class TestPaymentRequest(IntegrationTestCase):
class TestPaymentRequest(ERPNextTestSuite):
def setUp(self):
for payment_gateway in payment_gateways:
if not frappe.db.get_value("Payment Gateway", payment_gateway["gateway"], "name"):
@@ -502,7 +502,7 @@ class TestPaymentRequest(IntegrationTestCase):
return_doc=1,
)
@IntegrationTestCase.change_settings(
@ERPNextTestSuite.change_settings(
"Accounts Settings", {"allow_multi_currency_invoices_against_single_party_account": 1}
)
def test_multiple_payment_if_partially_paid_for_multi_currency(self):
@@ -620,7 +620,7 @@ class TestPaymentRequest(IntegrationTestCase):
self.assertEqual(pr.outstanding_amount, 0)
self.assertEqual(pr.grand_total, 20000)
@IntegrationTestCase.change_settings(
@ERPNextTestSuite.change_settings(
"Accounts Settings", {"allow_multi_currency_invoices_against_single_party_account": 1}
)
def test_single_payment_with_payment_term_for_multi_currency(self):

View File

@@ -2,8 +2,8 @@
# See license.txt
import unittest
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ERPNextTestSuite
class TestPaymentTerm(IntegrationTestCase):
class TestPaymentTerm(ERPNextTestSuite):
pass

View File

@@ -3,10 +3,11 @@
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ERPNextTestSuite
class TestPaymentTermsTemplate(IntegrationTestCase):
class TestPaymentTermsTemplate(ERPNextTestSuite):
def tearDown(self):
frappe.delete_doc("Payment Terms Template", "_Test Payment Terms Template For Test", force=1)

View File

@@ -3,16 +3,16 @@
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import today
from erpnext.accounts.doctype.finance_book.test_finance_book import create_finance_book
from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
from erpnext.accounts.utils import get_fiscal_year
from erpnext.tests.utils import ERPNextTestSuite
class TestPeriodClosingVoucher(IntegrationTestCase):
class TestPeriodClosingVoucher(ERPNextTestSuite):
def setUp(self):
super().setUp()
frappe.db.set_single_value("Accounts Settings", "use_legacy_controller_for_pcv", 1)

View File

@@ -3,7 +3,6 @@
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from erpnext.accounts.doctype.accounting_dimension.test_accounting_dimension import (
create_dimension,
@@ -22,9 +21,10 @@ from erpnext.stock.doctype.serial_and_batch_bundle.test_serial_and_batch_bundle
get_batch_from_bundle,
)
from erpnext.stock.doctype.stock_entry.test_stock_entry import make_stock_entry
from erpnext.tests.utils import ERPNextTestSuite
class TestPOSClosingEntry(IntegrationTestCase):
class TestPOSClosingEntry(ERPNextTestSuite):
@classmethod
def setUpClass(cls):
frappe.db.sql("delete from `tabPOS Opening Entry`")
@@ -302,7 +302,7 @@ class TestPOSClosingEntry(IntegrationTestCase):
batch_qty_with_pos = get_batch_qty(batch_no, "_Test Warehouse - _TC", item_code)
self.assertEqual(batch_qty_with_pos, 10.0)
@IntegrationTestCase.change_settings("POS Settings", {"invoice_type": "Sales Invoice"})
@ERPNextTestSuite.change_settings("POS Settings", {"invoice_type": "Sales Invoice"})
def test_closing_entries_with_sales_invoice(self):
test_user, pos_profile = init_user_and_profile()
opening_entry = create_opening_entry(pos_profile, test_user.name)

View File

@@ -5,7 +5,6 @@ import unittest
import frappe
from frappe import _
from frappe.tests import IntegrationTestCase
from erpnext.accounts.doctype.mode_of_payment.test_mode_of_payment import (
set_default_account_for_mode_of_payment,
@@ -22,9 +21,10 @@ from erpnext.stock.doctype.serial_and_batch_bundle.test_serial_and_batch_bundle
make_serial_batch_bundle,
)
from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry
from erpnext.tests.utils import ERPNextTestSuite
class TestPOSInvoice(IntegrationTestCase):
class TestPOSInvoice(ERPNextTestSuite):
@classmethod
def setUpClass(cls):
super().setUpClass()

View File

@@ -3,7 +3,6 @@
import json
import frappe
from frappe.tests import IntegrationTestCase
from erpnext.accounts.doctype.mode_of_payment.test_mode_of_payment import (
set_default_account_for_mode_of_payment,
@@ -19,9 +18,10 @@ from erpnext.stock.doctype.serial_and_batch_bundle.test_serial_and_batch_bundle
get_serial_nos_from_bundle,
)
from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry
from erpnext.tests.utils import ERPNextTestSuite
class TestPOSInvoiceMergeLog(IntegrationTestCase):
class TestPOSInvoiceMergeLog(ERPNextTestSuite):
@classmethod
def setUpClass(cls):
super().setUpClass()
@@ -315,7 +315,7 @@ class TestPOSInvoiceMergeLog(IntegrationTestCase):
self.assertNotEqual(consolidated_invoice.outstanding_amount, 800)
self.assertEqual(consolidated_invoice.status, "Paid")
@IntegrationTestCase.change_settings(
@ERPNextTestSuite.change_settings(
"System Settings", {"number_format": "#,###.###", "currency_precision": 3, "float_precision": 3}
)
def test_consolidation_round_off_error_3(self):

View File

@@ -4,21 +4,23 @@ import unittest
import frappe
from frappe.core.doctype.user_permission.test_user_permission import create_user
from frappe.tests import IntegrationTestCase
from erpnext.accounts.doctype.pos_invoice.test_pos_invoice import create_pos_invoice
from erpnext.accounts.doctype.pos_profile.test_pos_profile import make_pos_profile
from erpnext.stock.doctype.stock_entry.test_stock_entry import make_stock_entry
from erpnext.tests.utils import ERPNextTestSuite
class TestPOSOpeningEntry(IntegrationTestCase):
class TestPOSOpeningEntry(ERPNextTestSuite):
@classmethod
def setUpClass(cls):
super().setUpClass()
frappe.db.sql("delete from `tabPOS Opening Entry`")
cls.enterClassContext(cls.change_settings("POS Settings", {"invoice_type": "POS Invoice"}))
@classmethod
def tearDownClass(cls):
super().tearDownClass()
frappe.db.sql("delete from `tabPOS Opening Entry`")
def setUp(self):

View File

@@ -3,16 +3,16 @@
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import cint
from erpnext.accounts.doctype.pos_profile.pos_profile import (
get_child_nodes,
)
from erpnext.stock.get_item_details import get_pos_profile
from erpnext.tests.utils import ERPNextTestSuite
class TestPOSProfile(IntegrationTestCase):
class TestPOSProfile(ERPNextTestSuite):
def test_pos_profile(self):
make_pos_profile()

View File

@@ -2,8 +2,8 @@
# See license.txt
import unittest
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ERPNextTestSuite
class TestPOSProfileUser(IntegrationTestCase):
class TestPOSProfileUser(ERPNextTestSuite):
pass

View File

@@ -2,8 +2,8 @@
# See license.txt
import unittest
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ERPNextTestSuite
class TestPOSSettings(IntegrationTestCase):
class TestPOSSettings(ERPNextTestSuite):
pass

View File

@@ -5,7 +5,6 @@
import unittest
import frappe
from frappe.tests import IntegrationTestCase
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
@@ -13,9 +12,10 @@ from erpnext.controllers.sales_and_purchase_return import make_return_doc
from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order
from erpnext.stock.doctype.item.test_item import make_item
from erpnext.stock.get_item_details import get_item_details
from erpnext.tests.utils import ERPNextTestSuite
class TestPricingRule(IntegrationTestCase):
class TestPricingRule(ERPNextTestSuite):
def setUp(self):
delete_existing_pricing_rules()
setup_pricing_rule_data()

View File

@@ -3,7 +3,6 @@
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from erpnext.accounts.doctype.account.test_account import create_account
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import (
@@ -11,9 +10,10 @@ from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import (
create_sales_invoice,
)
from erpnext.stock.doctype.item.test_item import create_item
from erpnext.tests.utils import ERPNextTestSuite
class TestProcessDeferredAccounting(IntegrationTestCase):
class TestProcessDeferredAccounting(ERPNextTestSuite):
def test_creation_of_ledger_entry_on_submit(self):
"""test creation of gl entries on submission of document"""
change_acc_settings(acc_frozen_till_date="2023-05-31", book_deferred_entries_based_on="Months")

View File

@@ -2,8 +2,10 @@
# See license.txt
# import frappe
from frappe.tests import IntegrationTestCase
class TestProcessPaymentReconciliation(IntegrationTestCase):
from erpnext.tests.utils import ERPNextTestSuite
class TestProcessPaymentReconciliation(ERPNextTestSuite):
pass

View File

@@ -2,8 +2,10 @@
# See license.txt
# import frappe
from frappe.tests import IntegrationTestCase
class TestProcessPaymentReconciliationLog(IntegrationTestCase):
from erpnext.tests.utils import ERPNextTestSuite
class TestProcessPaymentReconciliationLog(ERPNextTestSuite):
pass

View File

@@ -3,7 +3,6 @@
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import add_days, getdate, today
from erpnext.accounts.doctype.process_statement_of_accounts.process_statement_of_accounts import (
@@ -12,9 +11,10 @@ from erpnext.accounts.doctype.process_statement_of_accounts.process_statement_of
)
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
from erpnext.accounts.test.accounts_mixin import AccountsTestMixin
from erpnext.tests.utils import ERPNextTestSuite
class TestProcessStatementOfAccounts(AccountsTestMixin, IntegrationTestCase):
class TestProcessStatementOfAccounts(AccountsTestMixin, ERPNextTestSuite):
@classmethod
def setUpClass(cls):
super().setUpClass()

View File

@@ -2,8 +2,10 @@
# See license.txt
# import frappe
from frappe.tests import IntegrationTestCase
class TestProcessSubscription(IntegrationTestCase):
from erpnext.tests.utils import ERPNextTestSuite
class TestProcessSubscription(ERPNextTestSuite):
pass

View File

@@ -3,13 +3,13 @@
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from erpnext.accounts.doctype.promotional_scheme.promotional_scheme import TransactionExists
from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order
from erpnext.tests.utils import ERPNextTestSuite
class TestPromotionalScheme(IntegrationTestCase):
class TestPromotionalScheme(ERPNextTestSuite):
def setUp(self):
if frappe.db.exists("Promotional Scheme", "_Test Scheme"):
frappe.delete_doc("Promotional Scheme", "_Test Scheme")

View File

@@ -3,7 +3,6 @@
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import add_days, cint, flt, getdate, nowdate, today
import erpnext
@@ -37,9 +36,10 @@ from erpnext.stock.doctype.serial_and_batch_bundle.test_serial_and_batch_bundle
)
from erpnext.stock.doctype.stock_entry.test_stock_entry import get_qty_after_transaction
from erpnext.stock.tests.test_utils import StockTestMixin
from erpnext.tests.utils import ERPNextTestSuite
class TestPurchaseInvoice(IntegrationTestCase, StockTestMixin):
class TestPurchaseInvoice(ERPNextTestSuite, StockTestMixin):
@classmethod
def setUpClass(cls):
super().setUpClass()
@@ -506,9 +506,7 @@ class TestPurchaseInvoice(IntegrationTestCase, StockTestMixin):
self.assertEqual(tax.tax_amount, expected_values[i][1])
self.assertEqual(tax.total, expected_values[i][2])
@IntegrationTestCase.change_settings(
"Accounts Settings", {"unlink_payment_on_cancellation_of_invoice": 1}
)
@ERPNextTestSuite.change_settings("Accounts Settings", {"unlink_payment_on_cancellation_of_invoice": 1})
def test_purchase_invoice_with_advance(self):
jv = frappe.copy_doc(self.globalTestRecords["Journal Entry"][1])
jv.insert()
@@ -559,9 +557,7 @@ class TestPurchaseInvoice(IntegrationTestCase, StockTestMixin):
)
)
@IntegrationTestCase.change_settings(
"Accounts Settings", {"unlink_payment_on_cancellation_of_invoice": 1}
)
@ERPNextTestSuite.change_settings("Accounts Settings", {"unlink_payment_on_cancellation_of_invoice": 1})
def test_invoice_with_advance_and_multi_payment_terms(self):
jv = frappe.copy_doc(self.globalTestRecords["Journal Entry"][1])
jv.insert()
@@ -1286,9 +1282,7 @@ class TestPurchaseInvoice(IntegrationTestCase, StockTestMixin):
acc_settings.submit_journal_entriessubmit_journal_entries = 0
acc_settings.save()
@IntegrationTestCase.change_settings(
"Accounts Settings", {"unlink_payment_on_cancellation_of_invoice": 1}
)
@ERPNextTestSuite.change_settings("Accounts Settings", {"unlink_payment_on_cancellation_of_invoice": 1})
def test_gain_loss_with_advance_entry(self):
unlink_enabled = frappe.db.get_single_value(
"Accounts Settings", "unlink_payment_on_cancellation_of_invoice"
@@ -1489,9 +1483,7 @@ class TestPurchaseInvoice(IntegrationTestCase, StockTestMixin):
)
frappe.db.set_value("Company", "_Test Company", "exchange_gain_loss_account", original_account)
@IntegrationTestCase.change_settings(
"Accounts Settings", {"unlink_payment_on_cancellation_of_invoice": 1}
)
@ERPNextTestSuite.change_settings("Accounts Settings", {"unlink_payment_on_cancellation_of_invoice": 1})
def test_purchase_invoice_advance_taxes(self):
from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry
@@ -2157,7 +2149,7 @@ class TestPurchaseInvoice(IntegrationTestCase, StockTestMixin):
rate = flt(sle.stock_value_difference) / flt(sle.actual_qty)
self.assertAlmostEqual(rate, 500)
@IntegrationTestCase.change_settings("Accounts Settings", {"automatically_fetch_payment_terms": 1})
@ERPNextTestSuite.change_settings("Accounts Settings", {"automatically_fetch_payment_terms": 1})
def test_payment_allocation_for_payment_terms(self):
from erpnext.buying.doctype.purchase_order.test_purchase_order import (
create_pr_against_po,
@@ -2292,7 +2284,7 @@ class TestPurchaseInvoice(IntegrationTestCase, StockTestMixin):
pi.delete()
@IntegrationTestCase.change_settings("Buying Settings", {"supplier_group": None})
@ERPNextTestSuite.change_settings("Buying Settings", {"supplier_group": None})
def test_purchase_invoice_without_supplier_group(self):
# Create a Supplier
test_supplier_name = "_Test Supplier Without Supplier Group"
@@ -2639,7 +2631,7 @@ class TestPurchaseInvoice(IntegrationTestCase, StockTestMixin):
frappe.db.set_single_value("Buying Settings", "maintain_same_rate", 1)
@IntegrationTestCase.change_settings(
@ERPNextTestSuite.change_settings(
"Buying Settings", {"maintain_same_rate": 0, "set_landed_cost_based_on_purchase_invoice_rate": 1}
)
def test_pr_status_rate_adjusted_from_pi(self):

View File

@@ -2,8 +2,8 @@
# See license.txt
import unittest
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ERPNextTestSuite
class TestPurchaseTaxesandChargesTemplate(IntegrationTestCase):
class TestPurchaseTaxesandChargesTemplate(ERPNextTestSuite):
pass

View File

@@ -4,7 +4,6 @@
import frappe
from frappe import qb
from frappe.query_builder.functions import Sum
from frappe.tests import IntegrationTestCase
from frappe.utils import add_days, nowdate, today
from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry
@@ -14,9 +13,10 @@ from erpnext.accounts.test.accounts_mixin import AccountsTestMixin
from erpnext.accounts.utils import get_fiscal_year
from erpnext.stock.doctype.item.test_item import make_item
from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import get_gl_entries, make_purchase_receipt
from erpnext.tests.utils import ERPNextTestSuite
class TestRepostAccountingLedger(AccountsTestMixin, IntegrationTestCase):
class TestRepostAccountingLedger(AccountsTestMixin, ERPNextTestSuite):
@classmethod
def setUpClass(cls):
super().setUpClass()
@@ -121,7 +121,7 @@ class TestRepostAccountingLedger(AccountsTestMixin, IntegrationTestCase):
ral.append("vouchers", {"voucher_type": si.doctype, "voucher_no": si.name})
self.assertRaises(frappe.ValidationError, ral.save)
@IntegrationTestCase.change_settings("Accounts Settings", {"delete_linked_ledger_entries": 1})
@ERPNextTestSuite.change_settings("Accounts Settings", {"delete_linked_ledger_entries": 1})
def test_04_pcv_validation(self):
# Clear old GL entries so PCV can be submitted.
gl = frappe.qb.DocType("GL Entry")

View File

@@ -2,8 +2,10 @@
# See license.txt
# import frappe
from frappe.tests import IntegrationTestCase
class TestRepostAccountingLedgerSettings(IntegrationTestCase):
from erpnext.tests.utils import ERPNextTestSuite
class TestRepostAccountingLedgerSettings(ERPNextTestSuite):
pass

View File

@@ -2,8 +2,10 @@
# See license.txt
# import frappe
from frappe.tests import IntegrationTestCase
class TestRepostPaymentLedger(IntegrationTestCase):
from erpnext.tests.utils import ERPNextTestSuite
class TestRepostPaymentLedger(ERPNextTestSuite):
pass

View File

@@ -7,7 +7,6 @@ import json
import frappe
from frappe import qb
from frappe.model.dynamic_links import get_dynamic_link_map
from frappe.tests import IntegrationTestCase, change_settings
from frappe.utils import add_days, cint, flt, format_date, getdate, nowdate, today
import erpnext
@@ -66,7 +65,7 @@ class TestSalesInvoice(ERPNextTestSuite):
for company in frappe.get_all("Company", pluck="name"):
frappe.db.set_value("Company", company, "accounts_frozen_till_date", None)
@change_settings(
@ERPNextTestSuite.change_settings(
"Accounts Settings",
{"maintain_same_internal_transaction_rate": 1, "maintain_same_rate_action": "Stop"},
)
@@ -229,9 +228,7 @@ class TestSalesInvoice(ERPNextTestSuite):
self.assertRaises(frappe.LinkExistsError, si.cancel)
unlink_payment_on_cancel_of_invoice()
@IntegrationTestCase.change_settings(
"Accounts Settings", {"unlink_payment_on_cancellation_of_invoice": 1}
)
@ERPNextTestSuite.change_settings("Accounts Settings", {"unlink_payment_on_cancellation_of_invoice": 1})
def test_payment_entry_unlink_against_standalone_credit_note(self):
from erpnext.accounts.doctype.payment_entry.test_payment_entry import get_payment_entry
@@ -844,7 +841,7 @@ class TestSalesInvoice(ERPNextTestSuite):
w = self.make()
self.assertEqual(w.outstanding_amount, w.base_rounded_total)
@IntegrationTestCase.change_settings(
@ERPNextTestSuite.change_settings(
"Accounts Settings",
{"add_taxes_from_item_tax_template": 0, "add_taxes_from_taxes_and_charges_template": 0},
)
@@ -1401,9 +1398,7 @@ class TestSalesInvoice(ERPNextTestSuite):
dn.submit()
return dn
@IntegrationTestCase.change_settings(
"Accounts Settings", {"unlink_payment_on_cancellation_of_invoice": 1}
)
@ERPNextTestSuite.change_settings("Accounts Settings", {"unlink_payment_on_cancellation_of_invoice": 1})
def test_sales_invoice_with_advance(self):
jv = frappe.copy_doc(self.globalTestRecords["Journal Entry"][0])
jv.insert()
@@ -2484,7 +2479,7 @@ class TestSalesInvoice(ERPNextTestSuite):
for gle in gl_entries:
self.assertEqual(expected_values[gle.account]["cost_center"], gle.cost_center)
@IntegrationTestCase.change_settings(
@ERPNextTestSuite.change_settings(
"Accounts Settings",
{"book_deferred_entries_based_on": "Days", "book_deferred_entries_via_journal_entry": 0},
)
@@ -2540,7 +2535,7 @@ class TestSalesInvoice(ERPNextTestSuite):
self.assertRaises(frappe.ValidationError, si.save)
@IntegrationTestCase.change_settings(
@ERPNextTestSuite.change_settings(
"Accounts Settings",
{"book_deferred_entries_based_on": "Months", "book_deferred_entries_via_journal_entry": 0},
)
@@ -3005,7 +3000,7 @@ class TestSalesInvoice(ERPNextTestSuite):
si.submit()
@IntegrationTestCase.change_settings("Selling Settings", {"enable_discount_accounting": 1})
@ERPNextTestSuite.change_settings("Selling Settings", {"enable_discount_accounting": 1})
def test_sales_invoice_with_discount_accounting_enabled(self):
discount_account = create_account(
account_name="Discount Account",
@@ -3022,7 +3017,7 @@ class TestSalesInvoice(ERPNextTestSuite):
check_gl_entries(self, si.name, expected_gle, add_days(nowdate(), -1))
@IntegrationTestCase.change_settings("Selling Settings", {"enable_discount_accounting": 1})
@ERPNextTestSuite.change_settings("Selling Settings", {"enable_discount_accounting": 1})
def test_additional_discount_for_sales_invoice_with_discount_accounting_enabled(self):
from erpnext.accounts.doctype.repost_accounting_ledger.test_repost_accounting_ledger import (
update_repost_settings,
@@ -3449,6 +3444,7 @@ class TestSalesInvoice(ERPNextTestSuite):
si.commission_rate = commission_rate
self.assertRaises(frappe.ValidationError, si.save)
@ERPNextTestSuite.change_settings("Accounts Settings", {"acc_frozen_upto": add_days(getdate(), 1)})
def test_sales_invoice_submission_post_account_freezing_date(self):
frappe.db.set_value("Company", "_Test Company", "accounts_frozen_till_date", add_days(getdate(), 1))
si = create_sales_invoice(do_not_save=True)
@@ -3460,7 +3456,7 @@ class TestSalesInvoice(ERPNextTestSuite):
si.submit()
frappe.db.set_value("Company", "_Test Company", "accounts_frozen_till_date", None)
@IntegrationTestCase.change_settings("Accounts Settings", {"over_billing_allowance": 0})
@ERPNextTestSuite.change_settings("Accounts Settings", {"over_billing_allowance": 0})
def test_over_billing_case_against_delivery_note(self):
"""
Test a case where duplicating the item with qty = 1 in the invoice
@@ -3486,7 +3482,7 @@ class TestSalesInvoice(ERPNextTestSuite):
self.assertTrue("cannot overbill" in str(err.exception).lower())
dn.cancel()
@IntegrationTestCase.change_settings(
@ERPNextTestSuite.change_settings(
"Accounts Settings",
{
"book_deferred_entries_via_journal_entry": 1,
@@ -3604,9 +3600,7 @@ class TestSalesInvoice(ERPNextTestSuite):
account.disabled = 0
account.save()
@IntegrationTestCase.change_settings(
"Accounts Settings", {"unlink_payment_on_cancellation_of_invoice": 1}
)
@ERPNextTestSuite.change_settings("Accounts Settings", {"unlink_payment_on_cancellation_of_invoice": 1})
def test_gain_loss_with_advance_entry(self):
from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry
@@ -3769,7 +3763,7 @@ class TestSalesInvoice(ERPNextTestSuite):
set_advance_flag(company="_Test Company", flag=0, default_account="")
@IntegrationTestCase.change_settings("Selling Settings", {"customer_group": None, "territory": None})
@ERPNextTestSuite.change_settings("Selling Settings", {"customer_group": None, "territory": None})
def test_sales_invoice_without_customer_group_and_territory(self):
# create a customer
if not frappe.db.exists("Customer", "_Test Simple Customer"):
@@ -3787,7 +3781,7 @@ class TestSalesInvoice(ERPNextTestSuite):
self.assertEqual(si.customer_group, None)
self.assertEqual(si.territory, None)
@IntegrationTestCase.change_settings("Selling Settings", {"allow_negative_rates_for_items": 0})
@ERPNextTestSuite.change_settings("Selling Settings", {"allow_negative_rates_for_items": 0})
def test_sales_return_negative_rate(self):
si = create_sales_invoice(is_return=1, qty=-2, rate=-10, do_not_save=True)
self.assertRaises(frappe.ValidationError, si.save)
@@ -4201,7 +4195,7 @@ class TestSalesInvoice(ERPNextTestSuite):
self.assertEqual(len(actual), 4)
self.assertEqual(expected, actual)
@IntegrationTestCase.change_settings("Accounts Settings", {"enable_common_party_accounting": True})
@ERPNextTestSuite.change_settings("Accounts Settings", {"enable_common_party_accounting": True})
def test_common_party_with_foreign_currency_jv(self):
from erpnext.accounts.doctype.account.test_account import create_account
from erpnext.accounts.doctype.opening_invoice_creation_tool.test_opening_invoice_creation_tool import (
@@ -4283,7 +4277,7 @@ class TestSalesInvoice(ERPNextTestSuite):
self.assertTrue(jv)
self.assertEqual(jv[0], si.grand_total)
@IntegrationTestCase.change_settings("Accounts Settings", {"enable_common_party_accounting": True})
@ERPNextTestSuite.change_settings("Accounts Settings", {"enable_common_party_accounting": True})
def test_common_party_with_different_currency_in_debtor_and_creditor(self):
from erpnext.accounts.doctype.account.test_account import create_account
from erpnext.accounts.doctype.opening_invoice_creation_tool.test_opening_invoice_creation_tool import (
@@ -4745,7 +4739,7 @@ class TestSalesInvoice(ERPNextTestSuite):
doc.db_set("do_not_use_batchwise_valuation", original_value)
@change_settings("Selling Settings", {"set_zero_rate_for_expired_batch": True})
@ERPNextTestSuite.change_settings("Selling Settings", {"set_zero_rate_for_expired_batch": True})
def test_zero_valuation_for_standalone_credit_note_with_expired_batch(self):
item_code = "_Test Item for Expiry Batch Zero Valuation"
make_item_for_si(

View File

@@ -2,9 +2,8 @@
# See license.txt
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ERPNextTestSuite
class TestSalesTaxesandChargesTemplate(IntegrationTestCase):
class TestSalesTaxesandChargesTemplate(ERPNextTestSuite):
pass

View File

@@ -3,12 +3,12 @@
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from erpnext.accounts.doctype.share_transfer.share_transfer import ShareDontExists
from erpnext.tests.utils import ERPNextTestSuite
class TestShareTransfer(IntegrationTestCase):
class TestShareTransfer(ERPNextTestSuite):
def setUp(self):
frappe.db.sql("delete from `tabShare Transfer`")
frappe.db.sql("delete from `tabShare Balance`")

View File

@@ -2,8 +2,8 @@
# See license.txt
import unittest
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ERPNextTestSuite
class TestShareType(IntegrationTestCase):
class TestShareType(ERPNextTestSuite):
pass

View File

@@ -2,8 +2,8 @@
# See license.txt
import unittest
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ERPNextTestSuite
class TestShareholder(IntegrationTestCase):
class TestShareholder(ERPNextTestSuite):
pass

View File

@@ -3,16 +3,16 @@
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from erpnext.accounts.doctype.shipping_rule.shipping_rule import (
FromGreaterThanToError,
ManyBlankToValuesError,
OverlappingConditionError,
)
from erpnext.tests.utils import ERPNextTestSuite
class TestShippingRule(IntegrationTestCase):
class TestShippingRule(ERPNextTestSuite):
def test_from_greater_than_to(self):
shipping_rule = frappe.copy_doc(self.globalTestRecords["Shipping Rule"][0])
shipping_rule.name = self.globalTestRecords["Shipping Rule"][0].get("name")

View File

@@ -3,7 +3,6 @@
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils.data import (
add_days,
add_months,
@@ -19,9 +18,10 @@ from frappe.utils.data import (
from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry
from erpnext.accounts.doctype.subscription.subscription import get_prorata_factor
from erpnext.tests.utils import ERPNextTestSuite
class TestSubscription(IntegrationTestCase):
class TestSubscription(ERPNextTestSuite):
def setUp(self):
make_plans()
create_parties()
@@ -470,7 +470,7 @@ class TestSubscription(IntegrationTestCase):
currency = frappe.db.get_value("Sales Invoice", subscription.invoices[0].name, "currency")
self.assertEqual(currency, "USD")
@IntegrationTestCase.change_settings(
@ERPNextTestSuite.change_settings(
"Accounts Settings",
{"allow_multi_currency_invoices_against_single_party_account": 1},
)

View File

@@ -2,8 +2,8 @@
# See license.txt
import unittest
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ERPNextTestSuite
class TestSubscriptionInvoice(IntegrationTestCase):
class TestSubscriptionInvoice(ERPNextTestSuite):
pass

View File

@@ -2,8 +2,8 @@
# See license.txt
import unittest
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ERPNextTestSuite
class TestSubscriptionPlan(IntegrationTestCase):
class TestSubscriptionPlan(ERPNextTestSuite):
pass

View File

@@ -2,8 +2,8 @@
# See license.txt
import unittest
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ERPNextTestSuite
class TestSubscriptionSettings(IntegrationTestCase):
class TestSubscriptionSettings(ERPNextTestSuite):
pass

View File

@@ -2,8 +2,8 @@
# See license.txt
import unittest
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ERPNextTestSuite
class TestTaxCategory(IntegrationTestCase):
class TestTaxCategory(ERPNextTestSuite):
pass

View File

@@ -3,14 +3,14 @@
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from erpnext.accounts.doctype.tax_rule.tax_rule import ConflictingTaxRule, get_tax_template
from erpnext.crm.doctype.opportunity.opportunity import make_quotation
from erpnext.crm.doctype.opportunity.test_opportunity import make_opportunity
from erpnext.tests.utils import ERPNextTestSuite
class TestTaxRule(IntegrationTestCase):
class TestTaxRule(ERPNextTestSuite):
@classmethod
def setUpClass(cls):
super().setUpClass()

View File

@@ -5,15 +5,15 @@ import datetime
import frappe
from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
from frappe.tests import IntegrationTestCase
from frappe.utils import add_days, add_months, today
from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry
from erpnext.accounts.utils import get_fiscal_year
from erpnext.buying.doctype.purchase_order.purchase_order import make_purchase_invoice
from erpnext.tests.utils import ERPNextTestSuite
class TestTaxWithholdingCategory(IntegrationTestCase):
class TestTaxWithholdingCategory(ERPNextTestSuite):
@classmethod
def setUpClass(cls):
super().setUpClass()
@@ -2047,7 +2047,7 @@ class TestTaxWithholdingCategory(IntegrationTestCase):
self.assertEqual(pi2.taxes, [])
self.assertEqual(payment.taxes[0].tax_amount, 6000)
@IntegrationTestCase.change_settings("Accounts Settings", {"delete_linked_ledger_entries": 1})
@ERPNextTestSuite.change_settings("Accounts Settings", {"delete_linked_ledger_entries": 1})
def test_tds_payment_entry_cancellation(self):
"""
Test payment entry cancellation clears withholding references from matched entries
@@ -2225,7 +2225,7 @@ class TestTaxWithholdingCategory(IntegrationTestCase):
self.validate_tax_withholding_entries("Purchase Invoice", pi1.name, expected_entries)
self.cleanup_invoices(invoices)
@IntegrationTestCase.change_settings("Accounts Settings", {"delete_linked_ledger_entries": 1})
@ERPNextTestSuite.change_settings("Accounts Settings", {"delete_linked_ledger_entries": 1})
def test_tds_purchase_invoice_cancellation(self):
"""
Test that after cancellation, new documents get automatically adjusted against remaining entries

View File

@@ -2,7 +2,6 @@
# See license.txt
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import today
from erpnext.accounts.doctype.payment_entry.test_payment_entry import create_payment_entry
@@ -12,9 +11,10 @@ from erpnext.accounts.test.accounts_mixin import AccountsTestMixin
from erpnext.buying.doctype.purchase_order.test_purchase_order import create_purchase_order
from erpnext.selling.doctype.sales_order.sales_order import make_sales_invoice
from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order
from erpnext.tests.utils import ERPNextTestSuite
class TestUnreconcilePayment(AccountsTestMixin, IntegrationTestCase):
class TestUnreconcilePayment(AccountsTestMixin, ERPNextTestSuite):
def setUp(self):
self.create_company()
self.create_customer()

View File

@@ -1,14 +1,14 @@
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import getdate
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
from erpnext.accounts.report.account_balance.account_balance import execute
from erpnext.tests.utils import ERPNextTestSuite
class TestAccountBalance(IntegrationTestCase):
class TestAccountBalance(ERPNextTestSuite):
def test_account_balance(self):
frappe.db.sql("delete from `tabSales Invoice` where company='_Test Company 2'")
frappe.db.sql("delete from `tabGL Entry` where company='_Test Company 2'")

View File

@@ -1,13 +1,13 @@
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import add_days, today
from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import make_purchase_invoice
from erpnext.accounts.report.accounts_payable.accounts_payable import execute
from erpnext.accounts.test.accounts_mixin import AccountsTestMixin
from erpnext.tests.utils import ERPNextTestSuite
class TestAccountsPayable(AccountsTestMixin, IntegrationTestCase):
class TestAccountsPayable(AccountsTestMixin, ERPNextTestSuite):
def setUp(self):
self.create_company()
self.create_customer()

View File

@@ -1,6 +1,5 @@
import frappe
from frappe import qb
from frappe.tests import IntegrationTestCase
from frappe.utils import add_days, flt, getdate, today
from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry
@@ -8,9 +7,10 @@ from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sal
from erpnext.accounts.report.accounts_receivable.accounts_receivable import execute
from erpnext.accounts.test.accounts_mixin import AccountsTestMixin
from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order
from erpnext.tests.utils import ERPNextTestSuite
class TestAccountsReceivable(AccountsTestMixin, IntegrationTestCase):
class TestAccountsReceivable(AccountsTestMixin, ERPNextTestSuite):
def setUp(self):
self.create_company()
self.create_customer()
@@ -199,7 +199,7 @@ class TestAccountsReceivable(AccountsTestMixin, IntegrationTestCase):
row = report[1]
self.assertTrue(len(row) == 0)
@IntegrationTestCase.change_settings(
@ERPNextTestSuite.change_settings(
"Accounts Settings",
{"allow_multi_currency_invoices_against_single_party_account": 1},
)
@@ -448,7 +448,7 @@ class TestAccountsReceivable(AccountsTestMixin, IntegrationTestCase):
],
)
@IntegrationTestCase.change_settings(
@ERPNextTestSuite.change_settings(
"Accounts Settings",
{"allow_multi_currency_invoices_against_single_party_account": 1, "allow_stale": 0},
)

View File

@@ -1,14 +1,14 @@
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import today
from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
from erpnext.accounts.report.accounts_receivable_summary.accounts_receivable_summary import execute
from erpnext.accounts.test.accounts_mixin import AccountsTestMixin
from erpnext.tests.utils import ERPNextTestSuite
class TestAccountsReceivable(AccountsTestMixin, IntegrationTestCase):
class TestAccountsReceivable(AccountsTestMixin, ERPNextTestSuite):
def setUp(self):
self.maxDiff = None
self.create_company()
@@ -112,7 +112,7 @@ class TestAccountsReceivable(AccountsTestMixin, IntegrationTestCase):
self.assertEqual(len(rpt_output), 1)
self.assertDictEqual(rpt_output[0], expected_data)
@IntegrationTestCase.change_settings("Selling Settings", {"cust_master_name": "Naming Series"})
@ERPNextTestSuite.change_settings("Selling Settings", {"cust_master_name": "Naming Series"})
def test_02_various_filters_and_output(self):
filters = {
"company": self.company,

View File

@@ -2,16 +2,16 @@
# MIT License. See license.txt
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils.data import today
from erpnext.accounts.report.balance_sheet.balance_sheet import execute
from erpnext.tests.utils import ERPNextTestSuite
COMPANY = "_Test Company 6"
COMPANY_SHORT_NAME = "_TC6"
class TestBalanceSheet(IntegrationTestCase):
class TestBalanceSheet(ERPNextTestSuite):
def test_balance_sheet(self):
frappe.db.sql(f"delete from `tabJournal Entry` where company='{COMPANY}'")
frappe.db.sql(f"delete from `tabGL Entry` where company='{COMPANY}'")

View File

@@ -2,15 +2,14 @@
# See license.txt
import frappe
from frappe.tests import IntegrationTestCase
from erpnext.accounts.report.bank_reconciliation_statement.bank_reconciliation_statement import (
execute,
)
from erpnext.tests.utils import if_lending_app_installed
from erpnext.tests.utils import ERPNextTestSuite, if_lending_app_installed
class TestBankReconciliationStatement(IntegrationTestCase):
class TestBankReconciliationStatement(ERPNextTestSuite):
@if_lending_app_installed
def test_loan_entries_in_bank_reco_statement(self):
from lending.loan_management.doctype.loan.test_loan import create_loan_accounts

View File

@@ -1,16 +1,16 @@
import frappe
from frappe import qb
from frappe.tests import IntegrationTestCase
from frappe.utils import add_days, flt, getdate, today
from frappe.utils import today
from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
from erpnext.accounts.report.customer_ledger_summary.customer_ledger_summary import execute
from erpnext.accounts.test.accounts_mixin import AccountsTestMixin
from erpnext.controllers.sales_and_purchase_return import make_return_doc
from erpnext.tests.utils import ERPNextTestSuite
class TestCustomerLedgerSummary(AccountsTestMixin, IntegrationTestCase):
class TestCustomerLedgerSummary(AccountsTestMixin, ERPNextTestSuite):
def setUp(self):
self.create_company()
self.create_customer()

View File

@@ -1,6 +1,5 @@
import frappe
from frappe import qb
from frappe.tests import IntegrationTestCase
from frappe.utils import nowdate
from erpnext.accounts.doctype.account.test_account import create_account
@@ -11,9 +10,10 @@ from erpnext.accounts.report.deferred_revenue_and_expense.deferred_revenue_and_e
)
from erpnext.accounts.test.accounts_mixin import AccountsTestMixin
from erpnext.accounts.utils import get_fiscal_year
from erpnext.tests.utils import ERPNextTestSuite
class TestDeferredRevenueAndExpense(IntegrationTestCase, AccountsTestMixin):
class TestDeferredRevenueAndExpense(ERPNextTestSuite, AccountsTestMixin):
maxDiff = None
def clear_old_entries(self):
@@ -70,7 +70,7 @@ class TestDeferredRevenueAndExpense(IntegrationTestCase, AccountsTestMixin):
def tearDown(self):
frappe.db.rollback()
@IntegrationTestCase.change_settings("Accounts Settings", {"book_deferred_entries_based_on": "Months"})
@ERPNextTestSuite.change_settings("Accounts Settings", {"book_deferred_entries_based_on": "Months"})
def test_deferred_revenue(self):
self.create_item("_Test Internet Subscription", 0, self.warehouse, self.company)
item = frappe.get_doc("Item", self.item)
@@ -137,7 +137,7 @@ class TestDeferredRevenueAndExpense(IntegrationTestCase, AccountsTestMixin):
]
self.assertEqual(report.period_total, expected)
@IntegrationTestCase.change_settings("Accounts Settings", {"book_deferred_entries_based_on": "Months"})
@ERPNextTestSuite.change_settings("Accounts Settings", {"book_deferred_entries_based_on": "Months"})
def test_deferred_expense(self):
self.create_item("_Test Office Desk", 0, self.warehouse, self.company)
item = frappe.get_doc("Item", self.item)
@@ -207,7 +207,7 @@ class TestDeferredRevenueAndExpense(IntegrationTestCase, AccountsTestMixin):
]
self.assertEqual(report.period_total, expected)
@IntegrationTestCase.change_settings("Accounts Settings", {"book_deferred_entries_based_on": "Months"})
@ERPNextTestSuite.change_settings("Accounts Settings", {"book_deferred_entries_based_on": "Months"})
def test_zero_months(self):
self.create_item("_Test Internet Subscription", 0, self.warehouse, self.company)
item = frappe.get_doc("Item", self.item)
@@ -272,7 +272,7 @@ class TestDeferredRevenueAndExpense(IntegrationTestCase, AccountsTestMixin):
]
self.assertEqual(report.period_total, expected)
@IntegrationTestCase.change_settings(
@ERPNextTestSuite.change_settings(
"Accounts Settings",
{"book_deferred_entries_based_on": "Months", "book_deferred_entries_via_journal_entry": 0},
)

View File

@@ -1,6 +1,5 @@
import frappe
from frappe import qb
from frappe.tests import IntegrationTestCase
from frappe.utils import add_days
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
@@ -8,9 +7,10 @@ from erpnext.accounts.report.general_and_payment_ledger_comparison.general_and_p
execute,
)
from erpnext.accounts.test.accounts_mixin import AccountsTestMixin
from erpnext.tests.utils import ERPNextTestSuite
class TestGeneralAndPaymentLedger(IntegrationTestCase, AccountsTestMixin):
class TestGeneralAndPaymentLedger(ERPNextTestSuite, AccountsTestMixin):
def setUp(self):
self.create_company()
self.cleanup()

View File

@@ -3,15 +3,15 @@
import frappe
from frappe import qb
from frappe.tests import IntegrationTestCase
from frappe.utils import flt, today
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
from erpnext.accounts.report.general_ledger.general_ledger import execute
from erpnext.controllers.sales_and_purchase_return import make_return_doc
from erpnext.tests.utils import ERPNextTestSuite
class TestGeneralLedger(IntegrationTestCase):
class TestGeneralLedger(ERPNextTestSuite):
def setUp(self):
self.company = "_Test Company"
self.clear_old_entries()

View File

@@ -1,6 +1,5 @@
import frappe
from frappe import qb
from frappe.tests import IntegrationTestCase
from frappe.utils import add_days, flt, get_first_day, get_last_day, nowdate
from erpnext.accounts.doctype.sales_invoice.sales_invoice import make_delivery_note, make_sales_return
@@ -10,9 +9,10 @@ from erpnext.stock.doctype.delivery_note.delivery_note import make_sales_invoice
from erpnext.stock.doctype.delivery_note.test_delivery_note import create_delivery_note
from erpnext.stock.doctype.item.test_item import create_item
from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry
from erpnext.tests.utils import ERPNextTestSuite
class TestGrossProfit(IntegrationTestCase):
class TestGrossProfit(ERPNextTestSuite):
def setUp(self):
self.create_company()
self.create_item()

View File

@@ -1,13 +1,13 @@
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import getdate, today
from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import make_purchase_invoice
from erpnext.accounts.report.item_wise_purchase_register.item_wise_purchase_register import execute
from erpnext.accounts.test.accounts_mixin import AccountsTestMixin
from erpnext.tests.utils import ERPNextTestSuite
class TestItemWisePurchaseRegister(AccountsTestMixin, IntegrationTestCase):
class TestItemWisePurchaseRegister(AccountsTestMixin, ERPNextTestSuite):
def setUp(self):
self.create_company()
self.create_supplier()

View File

@@ -1,13 +1,13 @@
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import getdate, today
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
from erpnext.accounts.report.item_wise_sales_register.item_wise_sales_register import execute
from erpnext.accounts.test.accounts_mixin import AccountsTestMixin
from erpnext.tests.utils import ERPNextTestSuite
class TestItemWiseSalesRegister(AccountsTestMixin, IntegrationTestCase):
class TestItemWiseSalesRegister(AccountsTestMixin, ERPNextTestSuite):
def setUp(self):
self.create_company()
self.create_customer()

Some files were not shown because too many files have changed in this diff Show More