refactor: Use IntegrationTestCase in multiple files

Signed-off-by: David <dgx.arnold@gmail.com>
This commit is contained in:
David
2024-10-08 00:42:00 +02:00
parent cd112795d3
commit e75eebc7a0
85 changed files with 208 additions and 168 deletions

View File

@@ -1,9 +1,10 @@
# Copyright (c) 2020, Frappe Technologies and Contributors # Copyright (c) 2020, Frappe Technologies and Contributors
# See license.txt # See license.txt
# import frappe # import frappe
import unittest import unittest
from frappe.tests import IntegrationTestCase
class TestBankStatementImport(unittest.TestCase):
class TestBankStatementImport(IntegrationTestCase):
pass pass

View File

@@ -1,9 +1,9 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
import frappe import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import now_datetime, nowdate from frappe.utils import now_datetime, nowdate
from erpnext.accounts.doctype.budget.budget import BudgetError, get_actual_expense from erpnext.accounts.doctype.budget.budget import BudgetError, get_actual_expense
@@ -14,7 +14,7 @@ from erpnext.buying.doctype.purchase_order.test_purchase_order import create_pur
test_dependencies = ["Monthly Distribution"] test_dependencies = ["Monthly Distribution"]
class TestBudget(unittest.TestCase): class TestBudget(IntegrationTestCase):
def test_monthly_budget_crossed_ignore(self): def test_monthly_budget_crossed_ignore(self):
set_total_expense_zero(nowdate(), "cost_center") set_total_expense_zero(nowdate(), "cost_center")

View File

@@ -1,8 +1,9 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
from frappe.tests import IntegrationTestCase
class TestCashierClosing(unittest.TestCase):
class TestCashierClosing(IntegrationTestCase):
pass pass

View File

@@ -1,8 +1,9 @@
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
from frappe.tests import IntegrationTestCase
class TestChartofAccountsImporter(unittest.TestCase):
class TestChartofAccountsImporter(IntegrationTestCase):
pass pass

View File

@@ -1,10 +1,11 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
from frappe.tests import IntegrationTestCase
# test_records = frappe.get_test_records('Cheque Print Template') # test_records = frappe.get_test_records('Cheque Print Template')
class TestChequePrintTemplate(unittest.TestCase): class TestChequePrintTemplate(IntegrationTestCase):
pass pass

View File

@@ -1,14 +1,14 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt # License: GNU General Public License v3. See license.txt
import unittest import unittest
import frappe import frappe
from frappe.tests import IntegrationTestCase
test_records = frappe.get_test_records("Cost Center") test_records = frappe.get_test_records("Cost Center")
class TestCostCenter(unittest.TestCase): class TestCostCenter(IntegrationTestCase):
def test_cost_center_creation_against_child_node(self): def test_cost_center_creation_against_child_node(self):
if not frappe.db.get_value("Cost Center", {"name": "_Test Cost Center 2 - _TC"}): if not frappe.db.get_value("Cost Center", {"name": "_Test Cost Center 2 - _TC"}):
frappe.get_doc(test_records[1]).insert() frappe.get_doc(test_records[1]).insert()

View File

@@ -1,9 +1,9 @@
# Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
import frappe import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import add_days, today from frappe.utils import add_days, today
from erpnext.accounts.doctype.cost_center.test_cost_center import create_cost_center from erpnext.accounts.doctype.cost_center.test_cost_center import create_cost_center
@@ -17,7 +17,7 @@ from erpnext.accounts.doctype.cost_center_allocation.cost_center_allocation impo
from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry
class TestCostCenterAllocation(unittest.TestCase): class TestCostCenterAllocation(IntegrationTestCase):
def setUp(self): def setUp(self):
cost_centers = [ cost_centers = [
"Main Cost Center 1", "Main Cost Center 1",

View File

@@ -1,9 +1,9 @@
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
import frappe import frappe
from frappe.tests import IntegrationTestCase
from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order
@@ -110,7 +110,7 @@ def test_create_test_data():
coupon_code.insert() coupon_code.insert()
class TestCouponCode(unittest.TestCase): class TestCouponCode(IntegrationTestCase):
def setUp(self): def setUp(self):
test_create_test_data() test_create_test_data()

View File

@@ -1,9 +1,10 @@
# Copyright (c) 2021, Wahni Green Technologies Pvt. Ltd. and contributors # Copyright (c) 2021, Wahni Green Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt # For license information, please see license.txt
# import frappe # import frappe
import unittest import unittest
from frappe.tests import IntegrationTestCase
class TestCurrencyExchangeSettings(unittest.TestCase):
class TestCurrencyExchangeSettings(IntegrationTestCase):
pass pass

View File

@@ -1,9 +1,10 @@
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
# import frappe # import frappe
import unittest import unittest
from frappe.tests import IntegrationTestCase
class TestDunningType(unittest.TestCase):
class TestDunningType(IntegrationTestCase):
pass pass

View File

@@ -1,14 +1,14 @@
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
import frappe import frappe
from frappe.tests import IntegrationTestCase
from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry
class TestFinanceBook(unittest.TestCase): class TestFinanceBook(IntegrationTestCase):
def test_finance_book(self): def test_finance_book(self):
finance_book = create_finance_book() finance_book = create_finance_book()

View File

@@ -1,16 +1,15 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt # License: GNU General Public License v3. See license.txt
import unittest import unittest
import frappe import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import now_datetime from frappe.utils import now_datetime
test_ignore = ["Company"] test_ignore = ["Company"]
class TestFiscalYear(unittest.TestCase): class TestFiscalYear(IntegrationTestCase):
def test_extra_year(self): def test_extra_year(self):
if frappe.db.exists("Fiscal Year", "_Test Fiscal Year 2000"): if frappe.db.exists("Fiscal Year", "_Test Fiscal Year 2000"):
frappe.delete_doc("Fiscal Year", "_Test Fiscal Year 2000") frappe.delete_doc("Fiscal Year", "_Test Fiscal Year 2000")

View File

@@ -1,17 +1,16 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt # License: GNU General Public License v3. See license.txt
import unittest import unittest
import frappe import frappe
from frappe.model.naming import parse_naming_series 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.gl_entry.gl_entry import rename_gle_sle_docs
from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry
class TestGLEntry(unittest.TestCase): class TestGLEntry(IntegrationTestCase):
def test_round_off_entry(self): 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_account", "_Test Write Off - _TC")
frappe.db.set_value("Company", "_Test Company", "round_off_cost_center", "_Test Cost Center - _TC") frappe.db.set_value("Company", "_Test Company", "round_off_cost_center", "_Test Cost Center - _TC")

View File

@@ -1,9 +1,9 @@
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
import frappe import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import add_days, flt, nowdate from frappe.utils import add_days, flt, nowdate
from erpnext.accounts.doctype.account.test_account import create_account from erpnext.accounts.doctype.account.test_account import create_account
@@ -12,7 +12,7 @@ from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sal
from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import get_gl_entries from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import get_gl_entries
class TestInvoiceDiscounting(unittest.TestCase): class TestInvoiceDiscounting(IntegrationTestCase):
def setUp(self): def setUp(self):
self.ar_credit = create_account( self.ar_credit = create_account(
account_name="_Test Accounts Receivable Credit", account_name="_Test Accounts Receivable Credit",

View File

@@ -1,8 +1,9 @@
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
from frappe.tests import IntegrationTestCase
class TestItemTaxTemplate(unittest.TestCase):
class TestItemTaxTemplate(IntegrationTestCase):
pass pass

View File

@@ -1,9 +1,10 @@
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
# import frappe # import frappe
import unittest import unittest
from frappe.tests import IntegrationTestCase
class TestJournalEntryTemplate(unittest.TestCase):
class TestJournalEntryTemplate(IntegrationTestCase):
pass pass

View File

@@ -1,14 +1,14 @@
# Copyright (c) 2021, Wahni Green Technologies Pvt. Ltd. and Contributors # Copyright (c) 2021, Wahni Green Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
import frappe import frappe
from frappe.tests import IntegrationTestCase
from erpnext.accounts.doctype.ledger_merge.ledger_merge import start_merge from erpnext.accounts.doctype.ledger_merge.ledger_merge import start_merge
class TestLedgerMerge(unittest.TestCase): class TestLedgerMerge(IntegrationTestCase):
def test_merge_success(self): def test_merge_success(self):
if not frappe.db.exists("Account", "Indirect Expenses - _TC"): if not frappe.db.exists("Account", "Indirect Expenses - _TC"):
acc = frappe.new_doc("Account") acc = frappe.new_doc("Account")

View File

@@ -1,16 +1,16 @@
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
import frappe import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import today from frappe.utils import today
from erpnext.accounts.doctype.loyalty_program.test_loyalty_program import create_records 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.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
class TestLoyaltyPointEntry(unittest.TestCase): class TestLoyaltyPointEntry(IntegrationTestCase):
@classmethod @classmethod
def setUpClass(cls): def setUpClass(cls):
# Create test records # Create test records

View File

@@ -1,9 +1,9 @@
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
import frappe import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import cint, flt, getdate, today from frappe.utils import cint, flt, getdate, today
from erpnext.accounts.doctype.loyalty_program.loyalty_program import ( from erpnext.accounts.doctype.loyalty_program.loyalty_program import (
@@ -13,7 +13,7 @@ from erpnext.accounts.doctype.loyalty_program.loyalty_program import (
from erpnext.accounts.party import get_dashboard_info from erpnext.accounts.party import get_dashboard_info
class TestLoyaltyProgram(unittest.TestCase): class TestLoyaltyProgram(IntegrationTestCase):
@classmethod @classmethod
def setUpClass(self): def setUpClass(self):
# create relevant item, customer, loyalty program, etc # create relevant item, customer, loyalty program, etc

View File

@@ -1,10 +1,11 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
from frappe.tests import IntegrationTestCase
# test_records = frappe.get_test_records('Mode of Payment') # test_records = frappe.get_test_records('Mode of Payment')
class TestModeofPayment(unittest.TestCase): class TestModeofPayment(IntegrationTestCase):
pass pass

View File

@@ -1,13 +1,12 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors
# See license.txt # See license.txt
import unittest import unittest
import frappe import frappe
from frappe.tests import IntegrationTestCase
test_records = frappe.get_test_records("Monthly Distribution") test_records = frappe.get_test_records("Monthly Distribution")
class TestMonthlyDistribution(unittest.TestCase): class TestMonthlyDistribution(IntegrationTestCase):
pass pass

View File

@@ -1,9 +1,10 @@
# Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
# import frappe # import frappe
import unittest import unittest
from frappe.tests import IntegrationTestCase
class TestPartyLink(unittest.TestCase):
class TestPartyLink(IntegrationTestCase):
pass pass

View File

@@ -1,12 +1,13 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
from frappe.tests import IntegrationTestCase
# test_records = frappe.get_test_records('Payment Gateway Account') # test_records = frappe.get_test_records('Payment Gateway Account')
test_ignore = ["Payment Gateway"] test_ignore = ["Payment Gateway"]
class TestPaymentGatewayAccount(unittest.TestCase): class TestPaymentGatewayAccount(IntegrationTestCase):
pass pass

View File

@@ -1,8 +1,9 @@
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
from frappe.tests import IntegrationTestCase
class TestPaymentTerm(unittest.TestCase):
class TestPaymentTerm(IntegrationTestCase):
pass pass

View File

@@ -1,12 +1,12 @@
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
import frappe import frappe
from frappe.tests import IntegrationTestCase
class TestPaymentTermsTemplate(unittest.TestCase): class TestPaymentTermsTemplate(IntegrationTestCase):
def tearDown(self): def tearDown(self):
frappe.delete_doc("Payment Terms Template", "_Test Payment Terms Template For Test", force=1) frappe.delete_doc("Payment Terms Template", "_Test Payment Terms Template For Test", force=1)

View File

@@ -1,10 +1,9 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt # License: GNU General Public License v3. See license.txt
import unittest import unittest
import frappe import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import today from frappe.utils import today
from erpnext.accounts.doctype.finance_book.test_finance_book import create_finance_book from erpnext.accounts.doctype.finance_book.test_finance_book import create_finance_book
@@ -13,7 +12,7 @@ from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sal
from erpnext.accounts.utils import get_fiscal_year from erpnext.accounts.utils import get_fiscal_year
class TestPeriodClosingVoucher(unittest.TestCase): class TestPeriodClosingVoucher(IntegrationTestCase):
def test_closing_entry(self): def test_closing_entry(self):
frappe.db.sql("delete from `tabGL Entry` where company='Test PCV Company'") frappe.db.sql("delete from `tabGL Entry` where company='Test PCV Company'")
frappe.db.sql("delete from `tabPeriod Closing Voucher` where company='Test PCV Company'") frappe.db.sql("delete from `tabPeriod Closing Voucher` where company='Test PCV Company'")

View File

@@ -1,9 +1,9 @@
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
import frappe import frappe
from frappe.tests import IntegrationTestCase
from erpnext.accounts.doctype.accounting_dimension.test_accounting_dimension import ( from erpnext.accounts.doctype.accounting_dimension.test_accounting_dimension import (
create_dimension, create_dimension,
@@ -24,7 +24,7 @@ from erpnext.stock.doctype.serial_and_batch_bundle.test_serial_and_batch_bundle
from erpnext.stock.doctype.stock_entry.test_stock_entry import make_stock_entry from erpnext.stock.doctype.stock_entry.test_stock_entry import make_stock_entry
class TestPOSClosingEntry(unittest.TestCase): class TestPOSClosingEntry(IntegrationTestCase):
def setUp(self): def setUp(self):
# Make stock available for POS Sales # Make stock available for POS Sales
make_stock_entry(target="_Test Warehouse - _TC", qty=2, basic_rate=100) make_stock_entry(target="_Test Warehouse - _TC", qty=2, basic_rate=100)

View File

@@ -1,11 +1,11 @@
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import copy import copy
import unittest import unittest
import frappe import frappe
from frappe import _ from frappe import _
from frappe.tests import IntegrationTestCase
from erpnext.accounts.doctype.pos_invoice.pos_invoice import make_sales_return from erpnext.accounts.doctype.pos_invoice.pos_invoice import make_sales_return
from erpnext.accounts.doctype.pos_profile.test_pos_profile import make_pos_profile from erpnext.accounts.doctype.pos_profile.test_pos_profile import make_pos_profile
@@ -20,7 +20,7 @@ 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 from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry
class TestPOSInvoice(unittest.TestCase): class TestPOSInvoice(IntegrationTestCase):
@classmethod @classmethod
def setUpClass(cls): def setUpClass(cls):
make_stock_entry(target="_Test Warehouse - _TC", item_code="_Test Item", qty=800, basic_rate=100) make_stock_entry(target="_Test Warehouse - _TC", item_code="_Test Item", qty=800, basic_rate=100)

View File

@@ -1,6 +1,5 @@
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import json import json
import frappe import frappe

View File

@@ -1,12 +1,12 @@
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
import frappe import frappe
from frappe.tests import IntegrationTestCase
class TestPOSOpeningEntry(unittest.TestCase): class TestPOSOpeningEntry(IntegrationTestCase):
pass pass

View File

@@ -1,9 +1,9 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors
# See license.txt # See license.txt
import unittest import unittest
import frappe import frappe
from frappe.tests import IntegrationTestCase
from erpnext.accounts.doctype.pos_profile.pos_profile import ( from erpnext.accounts.doctype.pos_profile.pos_profile import (
get_child_nodes, get_child_nodes,
@@ -13,7 +13,7 @@ from erpnext.stock.get_item_details import get_pos_profile
test_dependencies = ["Item"] test_dependencies = ["Item"]
class TestPOSProfile(unittest.TestCase): class TestPOSProfile(IntegrationTestCase):
def test_pos_profile(self): def test_pos_profile(self):
make_pos_profile() make_pos_profile()
@@ -50,7 +50,7 @@ def get_customers_list(pos_profile=None):
customer_groups.extend( customer_groups.extend(
[d.get("name") for d in get_child_nodes("Customer Group", d.get("customer_group"))] [d.get("name") for d in get_child_nodes("Customer Group", d.get("customer_group"))]
) )
cond = "customer_group in (%s)" % (", ".join(["%s"] * len(customer_groups))) cond = "customer_group in ({})".format(", ".join(["%s"] * len(customer_groups)))
return ( return (
frappe.db.sql( frappe.db.sql(
@@ -72,7 +72,7 @@ def get_items_list(pos_profile, company):
for d in pos_profile.get("item_groups"): for d in pos_profile.get("item_groups"):
args_list.extend([d.name for d in get_child_nodes("Item Group", d.item_group)]) args_list.extend([d.name for d in get_child_nodes("Item Group", d.item_group)])
if args_list: if args_list:
cond = "and i.item_group in (%s)" % (", ".join(["%s"] * len(args_list))) cond = "and i.item_group in ({})".format(", ".join(["%s"] * len(args_list)))
return frappe.db.sql( return frappe.db.sql(
f""" f"""

View File

@@ -1,8 +1,9 @@
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
from frappe.tests import IntegrationTestCase
class TestPOSProfileUser(unittest.TestCase):
class TestPOSProfileUser(IntegrationTestCase):
pass pass

View File

@@ -1,8 +1,9 @@
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
from frappe.tests import IntegrationTestCase
class TestPOSSettings(unittest.TestCase):
class TestPOSSettings(IntegrationTestCase):
pass pass

View File

@@ -1,9 +1,9 @@
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
import frappe import frappe
from frappe.tests import IntegrationTestCase
from erpnext.accounts.doctype.account.test_account import create_account from erpnext.accounts.doctype.account.test_account import create_account
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import ( from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import (
@@ -13,7 +13,7 @@ from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import (
from erpnext.stock.doctype.item.test_item import create_item from erpnext.stock.doctype.item.test_item import create_item
class TestProcessDeferredAccounting(unittest.TestCase): class TestProcessDeferredAccounting(IntegrationTestCase):
def test_creation_of_ledger_entry_on_submit(self): def test_creation_of_ledger_entry_on_submit(self):
"""test creation of gl entries on submission of document""" """test creation of gl entries on submission of document"""
change_acc_settings(acc_frozen_upto="2023-05-31", book_deferred_entries_based_on="Months") change_acc_settings(acc_frozen_upto="2023-05-31", book_deferred_entries_based_on="Months")

View File

@@ -1,15 +1,15 @@
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
import frappe import frappe
from frappe.tests import IntegrationTestCase
from erpnext.accounts.doctype.promotional_scheme.promotional_scheme import TransactionExists 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.selling.doctype.sales_order.test_sales_order import make_sales_order
class TestPromotionalScheme(unittest.TestCase): class TestPromotionalScheme(IntegrationTestCase):
def setUp(self): def setUp(self):
if frappe.db.exists("Promotional Scheme", "_Test Scheme"): if frappe.db.exists("Promotional Scheme", "_Test Scheme"):
frappe.delete_doc("Promotional Scheme", "_Test Scheme") frappe.delete_doc("Promotional Scheme", "_Test Scheme")

View File

@@ -1,10 +1,11 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors
# See license.txt # See license.txt
import unittest import unittest
from frappe.tests import IntegrationTestCase
# test_records = frappe.get_test_records('Purchase Taxes and Charges Template') # test_records = frappe.get_test_records('Purchase Taxes and Charges Template')
class TestPurchaseTaxesandChargesTemplate(unittest.TestCase): class TestPurchaseTaxesandChargesTemplate(IntegrationTestCase):
pass pass

View File

@@ -1,12 +1,12 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors
# See license.txt # See license.txt
import unittest import unittest
import frappe import frappe
from frappe.tests import IntegrationTestCase
test_records = frappe.get_test_records("Sales Taxes and Charges Template") test_records = frappe.get_test_records("Sales Taxes and Charges Template")
class TestSalesTaxesandChargesTemplate(unittest.TestCase): class TestSalesTaxesandChargesTemplate(IntegrationTestCase):
pass pass

View File

@@ -1,16 +1,16 @@
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
import frappe import frappe
from frappe.tests import IntegrationTestCase
from erpnext.accounts.doctype.share_transfer.share_transfer import ShareDontExists from erpnext.accounts.doctype.share_transfer.share_transfer import ShareDontExists
test_dependencies = ["Share Type", "Shareholder"] test_dependencies = ["Share Type", "Shareholder"]
class TestShareTransfer(unittest.TestCase): class TestShareTransfer(IntegrationTestCase):
def setUp(self): def setUp(self):
frappe.db.sql("delete from `tabShare Transfer`") frappe.db.sql("delete from `tabShare Transfer`")
frappe.db.sql("delete from `tabShare Balance`") frappe.db.sql("delete from `tabShare Balance`")

View File

@@ -1,8 +1,9 @@
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
from frappe.tests import IntegrationTestCase
class TestShareType(unittest.TestCase):
class TestShareType(IntegrationTestCase):
pass pass

View File

@@ -1,8 +1,9 @@
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
from frappe.tests import IntegrationTestCase
class TestShareholder(unittest.TestCase):
class TestShareholder(IntegrationTestCase):
pass pass

View File

@@ -1,9 +1,9 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt # License: GNU General Public License v3. See license.txt
import unittest import unittest
import frappe import frappe
from frappe.tests import IntegrationTestCase
from erpnext.accounts.doctype.shipping_rule.shipping_rule import ( from erpnext.accounts.doctype.shipping_rule.shipping_rule import (
FromGreaterThanToError, FromGreaterThanToError,
@@ -14,7 +14,7 @@ from erpnext.accounts.doctype.shipping_rule.shipping_rule import (
test_records = frappe.get_test_records("Shipping Rule") test_records = frappe.get_test_records("Shipping Rule")
class TestShippingRule(unittest.TestCase): class TestShippingRule(IntegrationTestCase):
def test_from_greater_than_to(self): def test_from_greater_than_to(self):
shipping_rule = frappe.copy_doc(test_records[0]) shipping_rule = frappe.copy_doc(test_records[0])
shipping_rule.name = test_records[0].get("name") shipping_rule.name = test_records[0].get("name")

View File

@@ -1,8 +1,9 @@
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
from frappe.tests import IntegrationTestCase
class TestSubscriptionInvoice(unittest.TestCase):
class TestSubscriptionInvoice(IntegrationTestCase):
pass pass

View File

@@ -1,8 +1,9 @@
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
from frappe.tests import IntegrationTestCase
class TestSubscriptionPlan(unittest.TestCase):
class TestSubscriptionPlan(IntegrationTestCase):
pass pass

View File

@@ -1,8 +1,9 @@
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
from frappe.tests import IntegrationTestCase
class TestSubscriptionSettings(unittest.TestCase):
class TestSubscriptionSettings(IntegrationTestCase):
pass pass

View File

@@ -1,8 +1,9 @@
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
from frappe.tests import IntegrationTestCase
class TestTaxCategory(unittest.TestCase):
class TestTaxCategory(IntegrationTestCase):
pass pass

View File

@@ -1,9 +1,9 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
import frappe import frappe
from frappe.tests import IntegrationTestCase
from erpnext.accounts.doctype.tax_rule.tax_rule import ConflictingTaxRule, get_tax_template 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.opportunity import make_quotation
@@ -12,7 +12,7 @@ from erpnext.crm.doctype.opportunity.test_opportunity import make_opportunity
test_records = frappe.get_test_records("Tax Rule") test_records = frappe.get_test_records("Tax Rule")
class TestTaxRule(unittest.TestCase): class TestTaxRule(IntegrationTestCase):
@classmethod @classmethod
def setUpClass(cls): def setUpClass(cls):
frappe.db.set_single_value("Shopping Cart Settings", "enabled", 0) frappe.db.set_single_value("Shopping Cart Settings", "enabled", 0)

View File

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

View File

@@ -1,10 +1,9 @@
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt # License: GNU General Public License v3. See license.txt
import unittest import unittest
import frappe import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import today from frappe.utils import today
from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry
@@ -16,7 +15,7 @@ from erpnext.accounts.report.sales_payment_summary.sales_payment_summary import
test_dependencies = ["Sales Invoice"] test_dependencies = ["Sales Invoice"]
class TestSalesPaymentSummary(unittest.TestCase): class TestSalesPaymentSummary(IntegrationTestCase):
@classmethod @classmethod
def setUpClass(self): def setUpClass(self):
create_records() create_records()

View File

@@ -1,5 +1,7 @@
import unittest import unittest
from frappe.tests import IntegrationTestCase
from erpnext.tests.utils import ReportFilters, ReportName, execute_script_report from erpnext.tests.utils import ReportFilters, ReportName, execute_script_report
DEFAULT_FILTERS = { DEFAULT_FILTERS = {
@@ -34,7 +36,7 @@ REPORT_FILTER_TEST_CASES: list[tuple[ReportName, ReportFilters]] = [
OPTIONAL_FILTERS = {} OPTIONAL_FILTERS = {}
class TestReports(unittest.TestCase): class TestReports(IntegrationTestCase):
def test_execute_all_accounts_reports(self): def test_execute_all_accounts_reports(self):
"""Test that all script report in stock modules are executable with supported filters""" """Test that all script report in stock modules are executable with supported filters"""
for report, filter in REPORT_FILTER_TEST_CASES: for report, filter in REPORT_FILTER_TEST_CASES:

View File

@@ -2,6 +2,7 @@ import unittest
import frappe import frappe
from frappe.test_runner import make_test_objects from frappe.test_runner import make_test_objects
from frappe.tests import IntegrationTestCase
from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry
from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import make_purchase_invoice from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import make_purchase_invoice
@@ -16,7 +17,7 @@ from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import make_pu
from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry
class TestUtils(unittest.TestCase): class TestUtils(IntegrationTestCase):
@classmethod @classmethod
def setUpClass(cls): def setUpClass(cls):
super().setUpClass() super().setUpClass()

View File

@@ -1,9 +1,9 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
import frappe import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import ( from frappe.utils import (
add_days, add_days,
add_months, add_months,
@@ -42,7 +42,7 @@ from erpnext.stock.doctype.purchase_receipt.purchase_receipt import (
from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import make_purchase_receipt from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import make_purchase_receipt
class AssetSetup(unittest.TestCase): class AssetSetup(IntegrationTestCase):
@classmethod @classmethod
def setUpClass(cls): def setUpClass(cls):
set_depreciation_settings_in_company() set_depreciation_settings_in_company()

View File

@@ -1,9 +1,9 @@
# Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
import frappe import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import cint, flt, getdate, now_datetime from frappe.utils import cint, flt, getdate, now_datetime
from erpnext.assets.doctype.asset.depreciation import post_depreciation_entries from erpnext.assets.doctype.asset.depreciation import post_depreciation_entries
@@ -21,7 +21,7 @@ from erpnext.stock.doctype.serial_and_batch_bundle.test_serial_and_batch_bundle
) )
class TestAssetCapitalization(unittest.TestCase): class TestAssetCapitalization(IntegrationTestCase):
def setUp(self): def setUp(self):
set_depreciation_settings_in_company() set_depreciation_settings_in_company()
create_asset_data() create_asset_data()

View File

@@ -1,12 +1,12 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
import frappe import frappe
from frappe.tests import IntegrationTestCase
class TestAssetCategory(unittest.TestCase): class TestAssetCategory(IntegrationTestCase):
def test_mandatory_fields(self): def test_mandatory_fields(self):
asset_category = frappe.new_doc("Asset Category") asset_category = frappe.new_doc("Asset Category")
asset_category.asset_category_name = "Computers" asset_category.asset_category_name = "Computers"

View File

@@ -1,16 +1,16 @@
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
import frappe import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import add_days, get_last_day, nowdate from frappe.utils import add_days, get_last_day, nowdate
from erpnext.assets.doctype.asset_maintenance.asset_maintenance import calculate_next_due_date from erpnext.assets.doctype.asset_maintenance.asset_maintenance import calculate_next_due_date
from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import make_purchase_receipt from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import make_purchase_receipt
class TestAssetMaintenance(unittest.TestCase): class TestAssetMaintenance(IntegrationTestCase):
def setUp(self): def setUp(self):
set_depreciation_settings_in_company() set_depreciation_settings_in_company()
self.pr = make_purchase_receipt( self.pr = make_purchase_receipt(

View File

@@ -1,8 +1,9 @@
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
from frappe.tests import IntegrationTestCase
class TestAssetMaintenanceLog(unittest.TestCase):
class TestAssetMaintenanceLog(IntegrationTestCase):
pass pass

View File

@@ -1,8 +1,9 @@
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
from frappe.tests import IntegrationTestCase
class TestAssetMaintenanceTeam(unittest.TestCase):
class TestAssetMaintenanceTeam(IntegrationTestCase):
pass pass

View File

@@ -1,9 +1,9 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
import frappe import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import now from frappe.utils import now
from erpnext.assets.doctype.asset.test_asset import create_asset_data from erpnext.assets.doctype.asset.test_asset import create_asset_data
@@ -11,7 +11,7 @@ from erpnext.setup.doctype.employee.test_employee import make_employee
from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import make_purchase_receipt from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import make_purchase_receipt
class TestAssetMovement(unittest.TestCase): class TestAssetMovement(IntegrationTestCase):
def setUp(self): def setUp(self):
frappe.db.set_value( frappe.db.set_value(
"Company", "_Test Company", "capital_work_in_progress_account", "CWIP Account - _TC" "Company", "_Test Company", "capital_work_in_progress_account", "CWIP Account - _TC"

View File

@@ -1,9 +1,9 @@
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
import frappe import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import flt, nowdate, nowtime, today from frappe.utils import flt, nowdate, nowtime, today
from erpnext.assets.doctype.asset.asset import ( from erpnext.assets.doctype.asset.asset import (
@@ -25,7 +25,7 @@ from erpnext.stock.doctype.serial_and_batch_bundle.test_serial_and_batch_bundle
) )
class TestAssetRepair(unittest.TestCase): class TestAssetRepair(IntegrationTestCase):
@classmethod @classmethod
def setUpClass(cls): def setUpClass(cls):
set_depreciation_settings_in_company() set_depreciation_settings_in_company()

View File

@@ -1,9 +1,9 @@
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
import frappe import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import add_days, cstr, get_last_day, getdate, nowdate from frappe.utils import add_days, cstr, get_last_day, getdate, nowdate
from erpnext.assets.doctype.asset.asset import get_asset_value_after_depreciation from erpnext.assets.doctype.asset.asset import get_asset_value_after_depreciation
@@ -16,7 +16,7 @@ from erpnext.assets.doctype.asset_repair.test_asset_repair import create_asset_r
from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import make_purchase_receipt from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import make_purchase_receipt
class TestAssetValueAdjustment(unittest.TestCase): class TestAssetValueAdjustment(IntegrationTestCase):
def setUp(self): def setUp(self):
create_asset_data() create_asset_data()
frappe.db.set_value( frappe.db.set_value(

View File

@@ -1,15 +1,15 @@
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import json import json
import unittest import unittest
import frappe import frappe
from frappe.tests import IntegrationTestCase
test_records = frappe.get_test_records("Location") test_records = frappe.get_test_records("Location")
class TestLocation(unittest.TestCase): class TestLocation(IntegrationTestCase):
def runTest(self): def runTest(self):
locations = ["Basil Farm", "Division 1", "Field 1", "Block 1"] locations = ["Basil Farm", "Division 1", "Field 1", "Block 1"]
area = 0 area = 0

View File

@@ -1,8 +1,9 @@
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
from frappe.tests import IntegrationTestCase
class TestMaintenanceTeamMember(unittest.TestCase):
class TestMaintenanceTeamMember(IntegrationTestCase):
pass pass

View File

@@ -1,9 +1,10 @@
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
# import frappe # import frappe
import unittest import unittest
from frappe.tests import IntegrationTestCase
class TestBuyingSettings(unittest.TestCase):
class TestBuyingSettings(IntegrationTestCase):
pass pass

View File

@@ -1,8 +1,9 @@
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
from frappe.tests import IntegrationTestCase
class TestSupplierScorecardPeriod(unittest.TestCase):
class TestSupplierScorecardPeriod(IntegrationTestCase):
pass pass

View File

@@ -1,8 +1,9 @@
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
from frappe.tests import IntegrationTestCase
class TestSupplierScorecardStanding(unittest.TestCase):
class TestSupplierScorecardStanding(IntegrationTestCase):
pass pass

View File

@@ -2,6 +2,7 @@ import json
import unittest import unittest
import frappe import frappe
from frappe.tests import IntegrationTestCase
from erpnext.controllers.item_variant import copy_attributes_to_variant, make_variant_item_code from erpnext.controllers.item_variant import copy_attributes_to_variant, make_variant_item_code
from erpnext.stock.doctype.item.test_item import set_item_variant_settings from erpnext.stock.doctype.item.test_item import set_item_variant_settings
@@ -10,7 +11,7 @@ from erpnext.stock.doctype.quality_inspection.test_quality_inspection import (
) )
class TestItemVariant(unittest.TestCase): class TestItemVariant(IntegrationTestCase):
def test_tables_in_template_copied_to_variant(self): def test_tables_in_template_copied_to_variant(self):
fields = [{"field_name": "quality_inspection_template"}] fields = [{"field_name": "quality_inspection_template"}]
set_item_variant_settings(fields) set_item_variant_settings(fields)

View File

@@ -4,11 +4,12 @@ import unittest
import frappe import frappe
import frappe.utils import frappe.utils
from frappe.model import mapper from frappe.model import mapper
from frappe.tests import IntegrationTestCase
from frappe.tests.utils import make_test_records from frappe.tests.utils import make_test_records
from frappe.utils import add_months, nowdate from frappe.utils import add_months, nowdate
class TestMapper(unittest.TestCase): class TestMapper(IntegrationTestCase):
def test_map_docs(self): def test_map_docs(self):
"""Test mapping of multiple source docs on a single target doc""" """Test mapping of multiple source docs on a single target doc"""

View File

@@ -2,13 +2,14 @@ import unittest
from uuid import uuid4 as _uuid4 from uuid import uuid4 as _uuid4
import frappe import frappe
from frappe.tests import IntegrationTestCase
def uuid4(): def uuid4():
return str(_uuid4()) return str(_uuid4())
class TestTaxes(unittest.TestCase): class TestTaxes(IntegrationTestCase):
def setUp(self): def setUp(self):
self.company = frappe.get_doc( self.company = frappe.get_doc(
{ {

View File

@@ -2,6 +2,7 @@ import unittest
from functools import partial from functools import partial
import frappe import frappe
from frappe.tests import IntegrationTestCase
from erpnext.controllers import queries from erpnext.controllers import queries
@@ -10,7 +11,7 @@ def add_default_params(func, doctype):
return partial(func, doctype=doctype, txt="", searchfield="name", start=0, page_len=20, filters=None) return partial(func, doctype=doctype, txt="", searchfield="name", start=0, page_len=20, filters=None)
class TestQueries(unittest.TestCase): class TestQueries(IntegrationTestCase):
# All tests are based on doctype/test_records.json # All tests are based on doctype/test_records.json
def assert_nested_in(self, item, container): def assert_nested_in(self, item, container):

View File

@@ -1,9 +1,10 @@
import unittest import unittest
import frappe import frappe
from frappe.tests import IntegrationTestCase
class TestUtils(unittest.TestCase): class TestUtils(IntegrationTestCase):
def test_reset_default_field_value(self): def test_reset_default_field_value(self):
doc = frappe.get_doc( doc = frappe.get_doc(
{ {

View File

@@ -1,10 +1,10 @@
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import datetime import datetime
import unittest import unittest
import frappe import frappe
from frappe.tests import IntegrationTestCase
LEAD_EMAIL = "test_appointment_lead@example.com" LEAD_EMAIL = "test_appointment_lead@example.com"
@@ -26,7 +26,7 @@ def create_test_appointment():
return test_appointment return test_appointment
class TestAppointment(unittest.TestCase): class TestAppointment(IntegrationTestCase):
def setUpClass(): def setUpClass():
frappe.db.delete("Lead", {"email_id": LEAD_EMAIL}) frappe.db.delete("Lead", {"email_id": LEAD_EMAIL})

View File

@@ -1,9 +1,10 @@
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
# import frappe # import frappe
import unittest import unittest
from frappe.tests import IntegrationTestCase
class TestAppointmentBookingSettings(unittest.TestCase):
class TestAppointmentBookingSettings(IntegrationTestCase):
pass pass

View File

@@ -1,9 +1,10 @@
# Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
# import frappe # import frappe
import unittest import unittest
from frappe.tests import IntegrationTestCase
class TestCampaign(unittest.TestCase):
class TestCampaign(IntegrationTestCase):
pass pass

View File

@@ -1,9 +1,10 @@
# Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
# import frappe # import frappe
import unittest import unittest
from frappe.tests import IntegrationTestCase
class TestCompetitor(unittest.TestCase):
class TestCompetitor(IntegrationTestCase):
pass pass

View File

@@ -1,13 +1,13 @@
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
import frappe import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import add_days, nowdate from frappe.utils import add_days, nowdate
class TestContract(unittest.TestCase): class TestContract(IntegrationTestCase):
def setUp(self): def setUp(self):
frappe.db.sql("delete from `tabContract`") frappe.db.sql("delete from `tabContract`")
self.contract_doc = get_contract() self.contract_doc = get_contract()

View File

@@ -1,8 +1,9 @@
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
from frappe.tests import IntegrationTestCase
class TestContractFulfilmentChecklist(unittest.TestCase):
class TestContractFulfilmentChecklist(IntegrationTestCase):
pass pass

View File

@@ -1,8 +1,9 @@
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
from frappe.tests import IntegrationTestCase
class TestContractTemplate(unittest.TestCase):
class TestContractTemplate(IntegrationTestCase):
pass pass

View File

@@ -1,9 +1,10 @@
# Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
# import frappe # import frappe
import unittest import unittest
from frappe.tests import IntegrationTestCase
class TestCRMSettings(unittest.TestCase):
class TestCRMSettings(IntegrationTestCase):
pass pass

View File

@@ -1,9 +1,10 @@
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
# import frappe # import frappe
import unittest import unittest
from frappe.tests import IntegrationTestCase
class TestEmailCampaign(unittest.TestCase):
class TestEmailCampaign(IntegrationTestCase):
pass pass

View File

@@ -1,10 +1,9 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt # License: GNU General Public License v3. See license.txt
import unittest import unittest
import frappe import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import random_string, today from frappe.utils import random_string, today
from erpnext.crm.doctype.lead.lead import make_opportunity from erpnext.crm.doctype.lead.lead import make_opportunity
@@ -13,7 +12,7 @@ from erpnext.crm.utils import get_linked_prospect
test_records = frappe.get_test_records("Lead") test_records = frappe.get_test_records("Lead")
class TestLead(unittest.TestCase): class TestLead(IntegrationTestCase):
def test_make_customer(self): def test_make_customer(self):
from erpnext.crm.doctype.lead.lead import make_customer from erpnext.crm.doctype.lead.lead import make_customer

View File

@@ -1,8 +1,9 @@
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
from frappe.tests import IntegrationTestCase
class TestMarketSegment(unittest.TestCase):
class TestMarketSegment(IntegrationTestCase):
pass pass

View File

@@ -1,9 +1,9 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors
# See license.txt # See license.txt
import unittest import unittest
import frappe import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import now_datetime, random_string, today from frappe.utils import now_datetime, random_string, today
from erpnext.crm.doctype.lead.lead import make_customer from erpnext.crm.doctype.lead.lead import make_customer
@@ -14,7 +14,7 @@ from erpnext.crm.utils import get_linked_communication_list
test_records = frappe.get_test_records("Opportunity") test_records = frappe.get_test_records("Opportunity")
class TestOpportunity(unittest.TestCase): class TestOpportunity(IntegrationTestCase):
def test_opportunity_status(self): def test_opportunity_status(self):
doc = make_opportunity(with_items=0) doc = make_opportunity(with_items=0)
quotation = make_quotation(doc.name) quotation = make_quotation(doc.name)

View File

@@ -1,8 +1,9 @@
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
from frappe.tests import IntegrationTestCase
class TestOpportunityType(unittest.TestCase):
class TestOpportunityType(IntegrationTestCase):
pass pass

View File

@@ -1,16 +1,16 @@
# Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
import frappe import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import random_string from frappe.utils import random_string
from erpnext.crm.doctype.lead.lead import add_lead_to_prospect from erpnext.crm.doctype.lead.lead import add_lead_to_prospect
from erpnext.crm.doctype.lead.test_lead import make_lead from erpnext.crm.doctype.lead.test_lead import make_lead
class TestProspect(unittest.TestCase): class TestProspect(IntegrationTestCase):
def test_add_lead_to_prospect_and_address_linking(self): def test_add_lead_to_prospect_and_address_linking(self):
lead_doc = make_lead() lead_doc = make_lead()
address_doc = make_address(address_title=lead_doc.name) address_doc = make_address(address_title=lead_doc.name)

View File

@@ -1,8 +1,9 @@
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt # See license.txt
import unittest import unittest
from frappe.tests import IntegrationTestCase
class TestSalesStage(unittest.TestCase):
class TestSalesStage(IntegrationTestCase):
pass pass

View File

@@ -1,6 +1,7 @@
import unittest import unittest
import frappe import frappe
from frappe.tests import IntegrationTestCase
from erpnext.crm.report.opportunity_summary_by_sales_stage.opportunity_summary_by_sales_stage import ( from erpnext.crm.report.opportunity_summary_by_sales_stage.opportunity_summary_by_sales_stage import (
execute, execute,
@@ -12,7 +13,7 @@ from erpnext.crm.report.sales_pipeline_analytics.test_sales_pipeline_analytics i
) )
class TestOpportunitySummaryBySalesStage(unittest.TestCase): class TestOpportunitySummaryBySalesStage(IntegrationTestCase):
@classmethod @classmethod
def setUpClass(self): def setUpClass(self):
frappe.db.delete("Opportunity") frappe.db.delete("Opportunity")