mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-15 11:09:17 +00:00
Merge pull request #43548 from blaggacao/test-refactoring/batch-1728345166
Refactor: Use IntegrationTestCase in multiple files
This commit is contained in:
@@ -1,9 +1,10 @@
|
|||||||
# Copyright (c) 2018, Frappe and Contributors
|
# Copyright (c) 2018, Frappe and Contributors
|
||||||
# See license.txt
|
# See license.txt
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
|
from frappe.tests import IntegrationTestCase
|
||||||
|
|
||||||
class TestQualityAction(unittest.TestCase):
|
|
||||||
|
class TestQualityAction(IntegrationTestCase):
|
||||||
# quality action has no code
|
# quality action has no code
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
# 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
|
||||||
|
|
||||||
|
|
||||||
class TestQualityFeedback(unittest.TestCase):
|
class TestQualityFeedback(IntegrationTestCase):
|
||||||
def test_quality_feedback(self):
|
def test_quality_feedback(self):
|
||||||
template = frappe.get_doc(
|
template = frappe.get_doc(
|
||||||
dict(
|
dict(
|
||||||
|
|||||||
@@ -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 TestQualityFeedbackTemplate(unittest.TestCase):
|
|
||||||
|
class TestQualityFeedbackTemplate(IntegrationTestCase):
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
# Copyright (c) 2018, Frappe and Contributors
|
# Copyright (c) 2018, Frappe and Contributors
|
||||||
# See license.txt
|
# See license.txt
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
import frappe
|
import frappe
|
||||||
|
from frappe.tests import IntegrationTestCase
|
||||||
|
|
||||||
|
|
||||||
class TestQualityGoal(unittest.TestCase):
|
class TestQualityGoal(IntegrationTestCase):
|
||||||
def test_quality_goal(self):
|
def test_quality_goal(self):
|
||||||
# no code, just a basic sanity check
|
# no code, just a basic sanity check
|
||||||
goal = get_quality_goal()
|
goal = get_quality_goal()
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
# Copyright (c) 2018, Frappe and Contributors
|
# Copyright (c) 2018, Frappe and Contributors
|
||||||
# See license.txt
|
# See license.txt
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
|
from frappe.tests import IntegrationTestCase
|
||||||
|
|
||||||
class TestQualityMeeting(unittest.TestCase):
|
|
||||||
|
class TestQualityMeeting(IntegrationTestCase):
|
||||||
# nothing to test
|
# nothing to test
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -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 TestQualityMeetingAgenda(unittest.TestCase):
|
|
||||||
|
class TestQualityMeetingAgenda(IntegrationTestCase):
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
# Copyright (c) 2018, Frappe and Contributors
|
# Copyright (c) 2018, Frappe and Contributors
|
||||||
# See license.txt
|
# See license.txt
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
import frappe
|
import frappe
|
||||||
|
from frappe.tests import IntegrationTestCase
|
||||||
|
|
||||||
from ..quality_goal.test_quality_goal import get_quality_goal
|
from ..quality_goal.test_quality_goal import get_quality_goal
|
||||||
from .quality_review import review
|
from .quality_review import review
|
||||||
|
|
||||||
|
|
||||||
class TestQualityReview(unittest.TestCase):
|
class TestQualityReview(IntegrationTestCase):
|
||||||
def test_review_creation(self):
|
def test_review_creation(self):
|
||||||
quality_goal = get_quality_goal()
|
quality_goal = get_quality_goal()
|
||||||
review()
|
review()
|
||||||
|
|||||||
@@ -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 TestImportSupplierInvoice(unittest.TestCase):
|
|
||||||
|
class TestImportSupplierInvoice(IntegrationTestCase):
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -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 TestLowerDeductionCertificate(unittest.TestCase):
|
|
||||||
|
class TestLowerDeductionCertificate(IntegrationTestCase):
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -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 TestSouthAfricaVATSettings(unittest.TestCase):
|
|
||||||
|
class TestSouthAfricaVATSettings(IntegrationTestCase):
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -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 TestUAEVATSettings(unittest.TestCase):
|
|
||||||
|
class TestUAEVATSettings(IntegrationTestCase):
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
from erpnext.regional.report.irs_1099.irs_1099 import execute as execute_1099_report
|
from erpnext.regional.report.irs_1099.irs_1099 import execute as execute_1099_report
|
||||||
|
|
||||||
|
|
||||||
class TestUnitedStates(unittest.TestCase):
|
class TestUnitedStates(IntegrationTestCase):
|
||||||
def test_irs_1099_custom_field(self):
|
def test_irs_1099_custom_field(self):
|
||||||
if not frappe.db.exists("Supplier", "_US 1099 Test Supplier"):
|
if not frappe.db.exists("Supplier", "_US 1099 Test Supplier"):
|
||||||
doc = frappe.new_doc("Supplier")
|
doc = frappe.new_doc("Supplier")
|
||||||
|
|||||||
@@ -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('Installation Note')
|
# test_records = frappe.get_test_records('Installation Note')
|
||||||
|
|
||||||
|
|
||||||
class TestInstallationNote(unittest.TestCase):
|
class TestInstallationNote(IntegrationTestCase):
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -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 TestSalesPartnerType(unittest.TestCase):
|
|
||||||
|
class TestSalesPartnerType(IntegrationTestCase):
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
# 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
|
||||||
|
|
||||||
|
|
||||||
class TestSellingSettings(unittest.TestCase):
|
class TestSellingSettings(IntegrationTestCase):
|
||||||
def test_defaults_populated(self):
|
def test_defaults_populated(self):
|
||||||
# Setup default values are not populated on migrate, this test checks
|
# Setup default values are not populated on migrate, this test checks
|
||||||
# if setup was completed correctly
|
# if setup was completed correctly
|
||||||
|
|||||||
@@ -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('Authorization Rule')
|
# test_records = frappe.get_test_records('Authorization Rule')
|
||||||
|
|
||||||
|
|
||||||
class TestAuthorizationRule(unittest.TestCase):
|
class TestAuthorizationRule(IntegrationTestCase):
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
# 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 json
|
import json
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
import frappe
|
import frappe
|
||||||
from frappe import _
|
from frappe import _
|
||||||
|
from frappe.tests import IntegrationTestCase
|
||||||
from frappe.utils import random_string
|
from frappe.utils import random_string
|
||||||
|
|
||||||
from erpnext.accounts.doctype.account.chart_of_accounts.chart_of_accounts import (
|
from erpnext.accounts.doctype.account.chart_of_accounts.chart_of_accounts import (
|
||||||
@@ -18,7 +18,7 @@ test_dependencies = ["Fiscal Year"]
|
|||||||
test_records = frappe.get_test_records("Company")
|
test_records = frappe.get_test_records("Company")
|
||||||
|
|
||||||
|
|
||||||
class TestCompany(unittest.TestCase):
|
class TestCompany(IntegrationTestCase):
|
||||||
def test_coa_based_on_existing_company(self):
|
def test_coa_based_on_existing_company(self):
|
||||||
company = frappe.new_doc("Company")
|
company = frappe.new_doc("Company")
|
||||||
company.company_name = "COA from Existing Company"
|
company.company_name = "COA from Existing Company"
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
# 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
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
import frappe
|
import frappe
|
||||||
|
from frappe.tests import IntegrationTestCase
|
||||||
from frappe.utils import cint, flt
|
from frappe.utils import cint, flt
|
||||||
|
|
||||||
from erpnext.setup.utils import get_exchange_rate
|
from erpnext.setup.utils import get_exchange_rate
|
||||||
@@ -80,7 +80,7 @@ def patched_requests_get(*args, **kwargs):
|
|||||||
|
|
||||||
|
|
||||||
@mock.patch("requests.get", side_effect=patched_requests_get)
|
@mock.patch("requests.get", side_effect=patched_requests_get)
|
||||||
class TestCurrencyExchange(unittest.TestCase):
|
class TestCurrencyExchange(IntegrationTestCase):
|
||||||
def clear_cache(self):
|
def clear_cache(self):
|
||||||
cache = frappe.cache()
|
cache = frappe.cache()
|
||||||
for date in test_exchange_values.keys():
|
for date in test_exchange_values.keys():
|
||||||
|
|||||||
@@ -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_ignore = ["Leave Block List"]
|
test_ignore = ["Leave Block List"]
|
||||||
|
|
||||||
|
|
||||||
class TestDepartment(unittest.TestCase):
|
class TestDepartment(IntegrationTestCase):
|
||||||
def test_remove_department_data(self):
|
def test_remove_department_data(self):
|
||||||
doc = create_department("Test Department")
|
doc = create_department("Test Department")
|
||||||
frappe.delete_doc("Department", doc.name)
|
frappe.delete_doc("Department", doc.name)
|
||||||
|
|||||||
@@ -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 TestDriver(unittest.TestCase):
|
|
||||||
|
class TestDriver(IntegrationTestCase):
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -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('Email Digest')
|
# test_records = frappe.get_test_records('Email Digest')
|
||||||
|
|
||||||
|
|
||||||
class TestEmailDigest(unittest.TestCase):
|
class TestEmailDigest(IntegrationTestCase):
|
||||||
pass
|
pass
|
||||||
|
|||||||
Reference in New Issue
Block a user