diff --git a/erpnext/setup/doctype/employee/test_employee.py b/erpnext/setup/doctype/employee/test_employee.py index 9b706836269..064f6a20b19 100644 --- a/erpnext/setup/doctype/employee/test_employee.py +++ b/erpnext/setup/doctype/employee/test_employee.py @@ -1,10 +1,10 @@ # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt - import unittest import frappe import frappe.utils +from frappe.tests import IntegrationTestCase import erpnext from erpnext.setup.doctype.employee.employee import InactiveEmployeeStatusError @@ -12,7 +12,7 @@ from erpnext.setup.doctype.employee.employee import InactiveEmployeeStatusError test_records = frappe.get_test_records("Employee") -class TestEmployee(unittest.TestCase): +class TestEmployee(IntegrationTestCase): def test_employee_status_left(self): employee1 = make_employee("test_employee_1@company.com") employee2 = make_employee("test_employee_2@company.com") diff --git a/erpnext/setup/doctype/employee_group/test_employee_group.py b/erpnext/setup/doctype/employee_group/test_employee_group.py index 4a1979232f7..9003d72bbe4 100644 --- a/erpnext/setup/doctype/employee_group/test_employee_group.py +++ b/erpnext/setup/doctype/employee_group/test_employee_group.py @@ -1,14 +1,14 @@ # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt - import unittest import frappe +from frappe.tests import IntegrationTestCase from erpnext.setup.doctype.employee.test_employee import make_employee -class TestEmployeeGroup(unittest.TestCase): +class TestEmployeeGroup(IntegrationTestCase): pass diff --git a/erpnext/setup/doctype/global_defaults/test_global_defaults.py b/erpnext/setup/doctype/global_defaults/test_global_defaults.py index a9d62ad30fa..3a301ba4232 100644 --- a/erpnext/setup/doctype/global_defaults/test_global_defaults.py +++ b/erpnext/setup/doctype/global_defaults/test_global_defaults.py @@ -1,8 +1,9 @@ # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt - import unittest +from frappe.tests import IntegrationTestCase -class TestGlobalDefaults(unittest.TestCase): + +class TestGlobalDefaults(IntegrationTestCase): pass diff --git a/erpnext/setup/doctype/holiday_list/test_holiday_list.py b/erpnext/setup/doctype/holiday_list/test_holiday_list.py index 0d3c35fb2cf..c5dbf0258df 100644 --- a/erpnext/setup/doctype/holiday_list/test_holiday_list.py +++ b/erpnext/setup/doctype/holiday_list/test_holiday_list.py @@ -1,17 +1,17 @@ # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt - import unittest from contextlib import contextmanager from datetime import date, timedelta import frappe +from frappe.tests import IntegrationTestCase from frappe.utils import getdate from erpnext.setup.doctype.holiday_list.holiday_list import local_country_name -class TestHolidayList(unittest.TestCase): +class TestHolidayList(IntegrationTestCase): def test_holiday_list(self): today_date = getdate() test_holiday_dates = [today_date - timedelta(days=5), today_date - timedelta(days=4)] diff --git a/erpnext/setup/doctype/item_group/test_item_group.py b/erpnext/setup/doctype/item_group/test_item_group.py index 34d7a68a257..13bcf74e3d0 100644 --- a/erpnext/setup/doctype/item_group/test_item_group.py +++ b/erpnext/setup/doctype/item_group/test_item_group.py @@ -1,10 +1,9 @@ # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt - - import unittest import frappe +from frappe.tests import IntegrationTestCase from frappe.utils.nestedset import ( NestedSetChildExistsError, NestedSetInvalidMergeError, @@ -17,7 +16,7 @@ from frappe.utils.nestedset import ( test_records = frappe.get_test_records("Item Group") -class TestItem(unittest.TestCase): +class TestItem(IntegrationTestCase): def test_basic_tree(self, records=None): min_lft = 1 max_rgt = frappe.db.sql("select max(rgt) from `tabItem Group`")[0][0] diff --git a/erpnext/setup/doctype/party_type/test_party_type.py b/erpnext/setup/doctype/party_type/test_party_type.py index ab92ee15fcb..a57cb3ce666 100644 --- a/erpnext/setup/doctype/party_type/test_party_type.py +++ b/erpnext/setup/doctype/party_type/test_party_type.py @@ -1,10 +1,11 @@ # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt - import unittest +from frappe.tests import IntegrationTestCase + # test_records = frappe.get_test_records('Party Type') -class TestPartyType(unittest.TestCase): +class TestPartyType(IntegrationTestCase): pass diff --git a/erpnext/setup/doctype/uom_conversion_factor/test_uom_conversion_factor.py b/erpnext/setup/doctype/uom_conversion_factor/test_uom_conversion_factor.py index 5683b5bc30d..dd9346dd8ac 100644 --- a/erpnext/setup/doctype/uom_conversion_factor/test_uom_conversion_factor.py +++ b/erpnext/setup/doctype/uom_conversion_factor/test_uom_conversion_factor.py @@ -1,8 +1,9 @@ # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt - import unittest +from frappe.tests import IntegrationTestCase -class TestUOMConversionFactor(unittest.TestCase): + +class TestUOMConversionFactor(IntegrationTestCase): pass diff --git a/erpnext/setup/doctype/vehicle/test_vehicle.py b/erpnext/setup/doctype/vehicle/test_vehicle.py index 3cd52386284..4d420082103 100644 --- a/erpnext/setup/doctype/vehicle/test_vehicle.py +++ b/erpnext/setup/doctype/vehicle/test_vehicle.py @@ -1,15 +1,15 @@ # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt - import unittest import frappe +from frappe.tests import IntegrationTestCase from frappe.utils import random_string # test_records = frappe.get_test_records('Vehicle') -class TestVehicle(unittest.TestCase): +class TestVehicle(IntegrationTestCase): def test_make_vehicle(self): vehicle = frappe.get_doc( { diff --git a/erpnext/stock/doctype/customs_tariff_number/test_customs_tariff_number.py b/erpnext/stock/doctype/customs_tariff_number/test_customs_tariff_number.py index b3aa1f48245..9496e3ed5a0 100644 --- a/erpnext/stock/doctype/customs_tariff_number/test_customs_tariff_number.py +++ b/erpnext/stock/doctype/customs_tariff_number/test_customs_tariff_number.py @@ -1,8 +1,9 @@ # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt - import unittest +from frappe.tests import IntegrationTestCase -class TestCustomsTariffNumber(unittest.TestCase): + +class TestCustomsTariffNumber(IntegrationTestCase): pass diff --git a/erpnext/stock/doctype/delivery_settings/test_delivery_settings.py b/erpnext/stock/doctype/delivery_settings/test_delivery_settings.py index 37745dc4088..2ecbb9e8861 100644 --- a/erpnext/stock/doctype/delivery_settings/test_delivery_settings.py +++ b/erpnext/stock/doctype/delivery_settings/test_delivery_settings.py @@ -1,8 +1,9 @@ # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt - import unittest +from frappe.tests import IntegrationTestCase -class TestDeliverySettings(unittest.TestCase): + +class TestDeliverySettings(IntegrationTestCase): pass diff --git a/erpnext/stock/doctype/item_manufacturer/test_item_manufacturer.py b/erpnext/stock/doctype/item_manufacturer/test_item_manufacturer.py index de043569399..bf82f3611ed 100644 --- a/erpnext/stock/doctype/item_manufacturer/test_item_manufacturer.py +++ b/erpnext/stock/doctype/item_manufacturer/test_item_manufacturer.py @@ -1,9 +1,10 @@ # Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt - # import frappe import unittest +from frappe.tests import IntegrationTestCase -class TestItemManufacturer(unittest.TestCase): + +class TestItemManufacturer(IntegrationTestCase): pass diff --git a/erpnext/stock/doctype/item_variant_settings/test_item_variant_settings.py b/erpnext/stock/doctype/item_variant_settings/test_item_variant_settings.py index 5f33d674074..b526eadd8e8 100644 --- a/erpnext/stock/doctype/item_variant_settings/test_item_variant_settings.py +++ b/erpnext/stock/doctype/item_variant_settings/test_item_variant_settings.py @@ -1,8 +1,9 @@ # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt - import unittest +from frappe.tests import IntegrationTestCase -class TestItemVariantSettings(unittest.TestCase): + +class TestItemVariantSettings(IntegrationTestCase): pass diff --git a/erpnext/stock/doctype/manufacturer/test_manufacturer.py b/erpnext/stock/doctype/manufacturer/test_manufacturer.py index e176b28b85a..af93d6c702f 100644 --- a/erpnext/stock/doctype/manufacturer/test_manufacturer.py +++ b/erpnext/stock/doctype/manufacturer/test_manufacturer.py @@ -1,10 +1,11 @@ # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt - import unittest +from frappe.tests import IntegrationTestCase + # test_records = frappe.get_test_records('Manufacturer') -class TestManufacturer(unittest.TestCase): +class TestManufacturer(IntegrationTestCase): pass diff --git a/erpnext/stock/doctype/quality_inspection_parameter/test_quality_inspection_parameter.py b/erpnext/stock/doctype/quality_inspection_parameter/test_quality_inspection_parameter.py index 3cc1fdeff82..8b85e5681c7 100644 --- a/erpnext/stock/doctype/quality_inspection_parameter/test_quality_inspection_parameter.py +++ b/erpnext/stock/doctype/quality_inspection_parameter/test_quality_inspection_parameter.py @@ -1,9 +1,10 @@ # Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt - # import frappe import unittest +from frappe.tests import IntegrationTestCase -class TestQualityInspectionParameter(unittest.TestCase): + +class TestQualityInspectionParameter(IntegrationTestCase): pass diff --git a/erpnext/stock/doctype/quality_inspection_parameter_group/test_quality_inspection_parameter_group.py b/erpnext/stock/doctype/quality_inspection_parameter_group/test_quality_inspection_parameter_group.py index 1630ad0a3f4..d3c158676a5 100644 --- a/erpnext/stock/doctype/quality_inspection_parameter_group/test_quality_inspection_parameter_group.py +++ b/erpnext/stock/doctype/quality_inspection_parameter_group/test_quality_inspection_parameter_group.py @@ -1,9 +1,10 @@ # Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt - # import frappe import unittest +from frappe.tests import IntegrationTestCase -class TestQualityInspectionParameterGroup(unittest.TestCase): + +class TestQualityInspectionParameterGroup(IntegrationTestCase): pass diff --git a/erpnext/stock/doctype/quality_inspection_template/test_quality_inspection_template.py b/erpnext/stock/doctype/quality_inspection_template/test_quality_inspection_template.py index 9523bbaa378..9094ac1d8a0 100644 --- a/erpnext/stock/doctype/quality_inspection_template/test_quality_inspection_template.py +++ b/erpnext/stock/doctype/quality_inspection_template/test_quality_inspection_template.py @@ -1,8 +1,9 @@ # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt - import unittest +from frappe.tests import IntegrationTestCase -class TestQualityInspectionTemplate(unittest.TestCase): + +class TestQualityInspectionTemplate(IntegrationTestCase): pass diff --git a/erpnext/stock/doctype/shipment_parcel_template/test_shipment_parcel_template.py b/erpnext/stock/doctype/shipment_parcel_template/test_shipment_parcel_template.py index b6b7ca633de..81f8f4393bc 100644 --- a/erpnext/stock/doctype/shipment_parcel_template/test_shipment_parcel_template.py +++ b/erpnext/stock/doctype/shipment_parcel_template/test_shipment_parcel_template.py @@ -1,9 +1,10 @@ # Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt - # import frappe import unittest +from frappe.tests import IntegrationTestCase -class TestShipmentParcelTemplate(unittest.TestCase): + +class TestShipmentParcelTemplate(IntegrationTestCase): pass diff --git a/erpnext/stock/doctype/stock_entry_type/test_stock_entry_type.py b/erpnext/stock/doctype/stock_entry_type/test_stock_entry_type.py index 61156545e34..2ffeaed47f5 100644 --- a/erpnext/stock/doctype/stock_entry_type/test_stock_entry_type.py +++ b/erpnext/stock/doctype/stock_entry_type/test_stock_entry_type.py @@ -1,12 +1,12 @@ # Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt - import unittest import frappe +from frappe.tests import IntegrationTestCase -class TestStockEntryType(unittest.TestCase): +class TestStockEntryType(IntegrationTestCase): def test_stock_entry_type_non_standard(self): stock_entry_type = "Test Manufacturing" diff --git a/erpnext/stock/doctype/stock_reposting_settings/test_stock_reposting_settings.py b/erpnext/stock/doctype/stock_reposting_settings/test_stock_reposting_settings.py index e53659c1735..854914c2775 100644 --- a/erpnext/stock/doctype/stock_reposting_settings/test_stock_reposting_settings.py +++ b/erpnext/stock/doctype/stock_reposting_settings/test_stock_reposting_settings.py @@ -1,14 +1,14 @@ # Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt - import unittest import frappe +from frappe.tests import IntegrationTestCase from erpnext.stock.doctype.repost_item_valuation.repost_item_valuation import get_recipients -class TestStockRepostingSettings(unittest.TestCase): +class TestStockRepostingSettings(IntegrationTestCase): def test_notify_reposting_error_to_role(self): role = "Notify Reposting Role" diff --git a/erpnext/stock/doctype/uom_category/test_uom_category.py b/erpnext/stock/doctype/uom_category/test_uom_category.py index b33084aa870..ebd2b5644c0 100644 --- a/erpnext/stock/doctype/uom_category/test_uom_category.py +++ b/erpnext/stock/doctype/uom_category/test_uom_category.py @@ -1,8 +1,9 @@ # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt - import unittest +from frappe.tests import IntegrationTestCase -class TestUOMCategory(unittest.TestCase): + +class TestUOMCategory(IntegrationTestCase): pass diff --git a/erpnext/stock/doctype/variant_field/test_variant_field.py b/erpnext/stock/doctype/variant_field/test_variant_field.py index 2c6b5f63903..ab35caf96b8 100644 --- a/erpnext/stock/doctype/variant_field/test_variant_field.py +++ b/erpnext/stock/doctype/variant_field/test_variant_field.py @@ -1,8 +1,9 @@ # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt - import unittest +from frappe.tests import IntegrationTestCase -class TestVariantField(unittest.TestCase): + +class TestVariantField(IntegrationTestCase): pass diff --git a/erpnext/stock/doctype/warehouse_type/test_warehouse_type.py b/erpnext/stock/doctype/warehouse_type/test_warehouse_type.py index 273e7954f87..4afa82219cb 100644 --- a/erpnext/stock/doctype/warehouse_type/test_warehouse_type.py +++ b/erpnext/stock/doctype/warehouse_type/test_warehouse_type.py @@ -1,9 +1,10 @@ # Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt - # import frappe import unittest +from frappe.tests import IntegrationTestCase -class TestWarehouseType(unittest.TestCase): + +class TestWarehouseType(IntegrationTestCase): pass diff --git a/erpnext/stock/report/test_reports.py b/erpnext/stock/report/test_reports.py index 85337a3bf54..af94fbc486e 100644 --- a/erpnext/stock/report/test_reports.py +++ b/erpnext/stock/report/test_reports.py @@ -1,6 +1,7 @@ import unittest import frappe +from frappe.tests import IntegrationTestCase from erpnext.tests.utils import ReportFilters, ReportName, execute_script_report @@ -75,7 +76,7 @@ OPTIONAL_FILTERS = { } -class TestReports(unittest.TestCase): +class TestReports(IntegrationTestCase): def test_execute_all_stock_reports(self): """Test that all script report in stock modules are executable with supported filters""" for report, filter in REPORT_FILTER_TEST_CASES: diff --git a/erpnext/stock/tests/test_valuation.py b/erpnext/stock/tests/test_valuation.py index df7c954918d..c5931c7b990 100644 --- a/erpnext/stock/tests/test_valuation.py +++ b/erpnext/stock/tests/test_valuation.py @@ -15,7 +15,7 @@ value_gen = st.floats(min_value=1, max_value=1e6) stock_queue_generator = st.lists(st.tuples(qty_gen, value_gen), min_size=10) -class TestFIFOValuation(unittest.TestCase): +class TestFIFOValuation(IntegrationTestCase): def setUp(self): self.queue = FIFOValuation([]) @@ -195,7 +195,7 @@ class TestFIFOValuation(unittest.TestCase): self.assertTotalValue(total_value) -class TestLIFOValuation(unittest.TestCase): +class TestLIFOValuation(IntegrationTestCase): def setUp(self): self.stack = LIFOValuation([]) diff --git a/erpnext/support/doctype/issue/test_issue.py b/erpnext/support/doctype/issue/test_issue.py index acad115f626..5da2c470a27 100644 --- a/erpnext/support/doctype/issue/test_issue.py +++ b/erpnext/support/doctype/issue/test_issue.py @@ -1,11 +1,11 @@ # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors # See license.txt - import unittest import frappe from frappe import _ from frappe.core.doctype.user_permission.test_user_permission import create_user +from frappe.tests import IntegrationTestCase from frappe.utils import flt, get_datetime from erpnext.support.doctype.service_level_agreement.test_service_level_agreement import ( @@ -13,7 +13,7 @@ from erpnext.support.doctype.service_level_agreement.test_service_level_agreemen ) -class TestSetUp(unittest.TestCase): +class TestSetUp(IntegrationTestCase): def setUp(self): frappe.db.sql("delete from `tabService Level Agreement`") frappe.db.sql("delete from `tabService Level Priority`") diff --git a/erpnext/support/doctype/issue_priority/test_issue_priority.py b/erpnext/support/doctype/issue_priority/test_issue_priority.py index c30540b9271..8a7140ff3cb 100644 --- a/erpnext/support/doctype/issue_priority/test_issue_priority.py +++ b/erpnext/support/doctype/issue_priority/test_issue_priority.py @@ -1,12 +1,12 @@ # Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt - import unittest import frappe +from frappe.tests import IntegrationTestCase -class TestIssuePriority(unittest.TestCase): +class TestIssuePriority(IntegrationTestCase): def test_priorities(self): make_priorities() priorities = frappe.get_list("Issue Priority") diff --git a/erpnext/support/doctype/issue_type/test_issue_type.py b/erpnext/support/doctype/issue_type/test_issue_type.py index a3620347222..6bdc647aa3a 100644 --- a/erpnext/support/doctype/issue_type/test_issue_type.py +++ b/erpnext/support/doctype/issue_type/test_issue_type.py @@ -1,8 +1,9 @@ # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt - import unittest +from frappe.tests import IntegrationTestCase -class TestIssueType(unittest.TestCase): + +class TestIssueType(IntegrationTestCase): pass diff --git a/erpnext/support/doctype/service_level_agreement/test_service_level_agreement.py b/erpnext/support/doctype/service_level_agreement/test_service_level_agreement.py index 2f9df8970c4..7e2aa888553 100644 --- a/erpnext/support/doctype/service_level_agreement/test_service_level_agreement.py +++ b/erpnext/support/doctype/service_level_agreement/test_service_level_agreement.py @@ -1,10 +1,10 @@ # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt - import datetime import unittest import frappe +from frappe.tests import IntegrationTestCase from frappe.utils import flt from erpnext.support.doctype.issue_priority.test_issue_priority import make_priorities @@ -13,7 +13,7 @@ from erpnext.support.doctype.service_level_agreement.service_level_agreement imp ) -class TestServiceLevelAgreement(unittest.TestCase): +class TestServiceLevelAgreement(IntegrationTestCase): def setUp(self): self.create_company() frappe.db.set_single_value("Support Settings", "track_service_level_agreement", 1) diff --git a/erpnext/support/doctype/support_settings/test_support_settings.py b/erpnext/support/doctype/support_settings/test_support_settings.py index 4eaf5322e26..751c8d907cd 100644 --- a/erpnext/support/doctype/support_settings/test_support_settings.py +++ b/erpnext/support/doctype/support_settings/test_support_settings.py @@ -1,8 +1,9 @@ # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt - import unittest +from frappe.tests import IntegrationTestCase -class TestSupportSettings(unittest.TestCase): + +class TestSupportSettings(IntegrationTestCase): pass diff --git a/erpnext/support/doctype/warranty_claim/test_warranty_claim.py b/erpnext/support/doctype/warranty_claim/test_warranty_claim.py index 19e23493fe5..1c5b0e88618 100644 --- a/erpnext/support/doctype/warranty_claim/test_warranty_claim.py +++ b/erpnext/support/doctype/warranty_claim/test_warranty_claim.py @@ -1,12 +1,12 @@ # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors # See license.txt - import unittest import frappe +from frappe.tests import IntegrationTestCase test_records = frappe.get_test_records("Warranty Claim") -class TestWarrantyClaim(unittest.TestCase): +class TestWarrantyClaim(IntegrationTestCase): pass diff --git a/erpnext/support/report/issue_analytics/test_issue_analytics.py b/erpnext/support/report/issue_analytics/test_issue_analytics.py index e30b31beef6..05ff98f5cd6 100644 --- a/erpnext/support/report/issue_analytics/test_issue_analytics.py +++ b/erpnext/support/report/issue_analytics/test_issue_analytics.py @@ -2,6 +2,7 @@ import unittest import frappe from frappe.desk.form.assign_to import add as add_assignment +from frappe.tests import IntegrationTestCase from frappe.utils import add_months, getdate from erpnext.support.doctype.issue.test_issue import create_customer, make_issue @@ -13,7 +14,7 @@ from erpnext.support.report.issue_analytics.issue_analytics import execute months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] -class TestIssueAnalytics(unittest.TestCase): +class TestIssueAnalytics(IntegrationTestCase): @classmethod def setUpClass(self): frappe.db.sql("delete from `tabIssue` where company='_Test Company'") diff --git a/erpnext/telephony/doctype/call_log/test_call_log.py b/erpnext/telephony/doctype/call_log/test_call_log.py index 111c7a744b7..e50a13d9f9e 100644 --- a/erpnext/telephony/doctype/call_log/test_call_log.py +++ b/erpnext/telephony/doctype/call_log/test_call_log.py @@ -1,9 +1,10 @@ # Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt - # import frappe import unittest +from frappe.tests import IntegrationTestCase -class TestCallLog(unittest.TestCase): + +class TestCallLog(IntegrationTestCase): pass diff --git a/erpnext/telephony/doctype/incoming_call_settings/test_incoming_call_settings.py b/erpnext/telephony/doctype/incoming_call_settings/test_incoming_call_settings.py index 28f7f43dabf..594e17e0f32 100644 --- a/erpnext/telephony/doctype/incoming_call_settings/test_incoming_call_settings.py +++ b/erpnext/telephony/doctype/incoming_call_settings/test_incoming_call_settings.py @@ -1,9 +1,10 @@ # Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt - # import frappe import unittest +from frappe.tests import IntegrationTestCase -class TestIncomingCallSettings(unittest.TestCase): + +class TestIncomingCallSettings(IntegrationTestCase): pass diff --git a/erpnext/telephony/doctype/telephony_call_type/test_telephony_call_type.py b/erpnext/telephony/doctype/telephony_call_type/test_telephony_call_type.py index b3c19c39102..3c8e4952401 100644 --- a/erpnext/telephony/doctype/telephony_call_type/test_telephony_call_type.py +++ b/erpnext/telephony/doctype/telephony_call_type/test_telephony_call_type.py @@ -1,9 +1,10 @@ # Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt - # import frappe import unittest +from frappe.tests import IntegrationTestCase -class TestTelephonyCallType(unittest.TestCase): + +class TestTelephonyCallType(IntegrationTestCase): pass diff --git a/erpnext/telephony/doctype/voice_call_settings/test_voice_call_settings.py b/erpnext/telephony/doctype/voice_call_settings/test_voice_call_settings.py index 97aa56feb62..c1c6d68d964 100644 --- a/erpnext/telephony/doctype/voice_call_settings/test_voice_call_settings.py +++ b/erpnext/telephony/doctype/voice_call_settings/test_voice_call_settings.py @@ -1,9 +1,10 @@ # Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt - # import frappe import unittest +from frappe.tests import IntegrationTestCase -class TestVoiceCallSettings(unittest.TestCase): + +class TestVoiceCallSettings(IntegrationTestCase): pass diff --git a/erpnext/tests/test_init.py b/erpnext/tests/test_init.py index 2b4ea9fa8dc..1b68491c582 100644 --- a/erpnext/tests/test_init.py +++ b/erpnext/tests/test_init.py @@ -1,13 +1,14 @@ import unittest import frappe +from frappe.tests import IntegrationTestCase from erpnext import encode_company_abbr test_records = frappe.get_test_records("Company") -class TestInit(unittest.TestCase): +class TestInit(IntegrationTestCase): def test_encode_company_abbr(self): abbr = "NFECT" diff --git a/erpnext/tests/test_notifications.py b/erpnext/tests/test_notifications.py index 0f391956309..9c27229d335 100644 --- a/erpnext/tests/test_notifications.py +++ b/erpnext/tests/test_notifications.py @@ -1,14 +1,13 @@ # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt - - import unittest import frappe from frappe.desk import notifications +from frappe.tests import IntegrationTestCase -class TestNotifications(unittest.TestCase): +class TestNotifications(IntegrationTestCase): def test_get_notifications_for_targets(self): """ Test notification config entries for targets as percentages diff --git a/erpnext/tests/test_point_of_sale.py b/erpnext/tests/test_point_of_sale.py index 7267d4a1d5e..014a0ac53aa 100644 --- a/erpnext/tests/test_point_of_sale.py +++ b/erpnext/tests/test_point_of_sale.py @@ -1,9 +1,9 @@ # Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt - import unittest import frappe +from frappe.tests import IntegrationTestCase from erpnext.accounts.doctype.pos_profile.test_pos_profile import make_pos_profile from erpnext.selling.page.point_of_sale.point_of_sale import get_items @@ -11,7 +11,7 @@ from erpnext.stock.doctype.item.test_item import make_item from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry -class TestPointOfSale(unittest.TestCase): +class TestPointOfSale(IntegrationTestCase): @classmethod def setUpClass(cls) -> None: frappe.db.savepoint("before_test_point_of_sale") diff --git a/erpnext/tests/test_regional.py b/erpnext/tests/test_regional.py index 55c8bb7d47d..83f551aae8e 100644 --- a/erpnext/tests/test_regional.py +++ b/erpnext/tests/test_regional.py @@ -1,6 +1,7 @@ import unittest import frappe +from frappe.tests import IntegrationTestCase import erpnext @@ -10,7 +11,7 @@ def test_method(): return "original" -class TestInit(unittest.TestCase): +class TestInit(IntegrationTestCase): def test_regional_overrides(self): frappe.flags.country = "Maldives" self.assertEqual(test_method(), "original") diff --git a/erpnext/tests/test_webform.py b/erpnext/tests/test_webform.py index 8de0ca60787..aa6083c0ff8 100644 --- a/erpnext/tests/test_webform.py +++ b/erpnext/tests/test_webform.py @@ -1,12 +1,13 @@ import unittest import frappe +from frappe.tests import IntegrationTestCase from erpnext.buying.doctype.purchase_order.test_purchase_order import create_purchase_order from erpnext.buying.doctype.supplier.test_supplier import create_supplier -class TestWebsite(unittest.TestCase): +class TestWebsite(IntegrationTestCase): def test_permission_for_custom_doctype(self): create_user("Supplier 1", "supplier1@gmail.com") create_user("Supplier 2", "supplier2@gmail.com") diff --git a/erpnext/utilities/doctype/video/test_video.py b/erpnext/utilities/doctype/video/test_video.py index dc500530e7f..4d37c575f84 100644 --- a/erpnext/utilities/doctype/video/test_video.py +++ b/erpnext/utilities/doctype/video/test_video.py @@ -1,9 +1,10 @@ # Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt - # import frappe import unittest +from frappe.tests import IntegrationTestCase -class TestVideo(unittest.TestCase): + +class TestVideo(IntegrationTestCase): pass diff --git a/erpnext/utilities/doctype/video_settings/test_video_settings.py b/erpnext/utilities/doctype/video_settings/test_video_settings.py index 25cac6c5432..fea375e5128 100644 --- a/erpnext/utilities/doctype/video_settings/test_video_settings.py +++ b/erpnext/utilities/doctype/video_settings/test_video_settings.py @@ -1,9 +1,10 @@ # Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt - # import frappe import unittest +from frappe.tests import IntegrationTestCase -class TestVideoSettings(unittest.TestCase): + +class TestVideoSettings(IntegrationTestCase): pass