Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: Use IntegrationTestCase in multiple files #43544

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt

import json
import unittest

import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils.response import json_handler

from erpnext.erpnext_integrations.doctype.plaid_settings.plaid_settings import (
Expand All @@ -16,7 +16,7 @@
)


class TestPlaidSettings(unittest.TestCase):
class TestPlaidSettings(IntegrationTestCase):
def setUp(self):
pass

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt

import unittest

from frappe.tests import IntegrationTestCase


class TestQuickBooksMigrator(unittest.TestCase):
class TestQuickBooksMigrator(IntegrationTestCase):
pass
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt

import unittest

from frappe.tests import IntegrationTestCase


class TestTallyMigration(unittest.TestCase):
class TestTallyMigration(IntegrationTestCase):
pass
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# 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 format_date
from frappe.utils.data import add_days, formatdate, today

Expand All @@ -17,7 +17,7 @@
# test_records = frappe.get_test_records('Maintenance Schedule')


class TestMaintenanceSchedule(unittest.TestCase):
class TestMaintenanceSchedule(IntegrationTestCase):
def test_events_should_be_created_and_deleted(self):
ms = make_maintenance_schedule()
ms.generate_schedule()
Expand Down
Original file line number Diff line number Diff line change
@@ -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.data import today

# test_records = frappe.get_test_records('Maintenance Visit')


class TestMaintenanceVisit(unittest.TestCase):
class TestMaintenanceVisit(IntegrationTestCase):
pass


Expand Down
Original file line number Diff line number Diff line change
@@ -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 TestDowntimeEntry(unittest.TestCase):
class TestDowntimeEntry(IntegrationTestCase):
pass
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt

import unittest

from frappe.tests import IntegrationTestCase


class TestManufacturingSettings(unittest.TestCase):
class TestManufacturingSettings(IntegrationTestCase):
pass
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt

import unittest

from frappe.tests import IntegrationTestCase


class TestMaterialRequestPlanItem(unittest.TestCase):
class TestMaterialRequestPlanItem(IntegrationTestCase):
pass
4 changes: 2 additions & 2 deletions erpnext/manufacturing/doctype/operation/test_operation.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt

import unittest

import frappe
from frappe.tests import IntegrationTestCase

test_records = frappe.get_test_records("Operation")


class TestOperation(unittest.TestCase):
class TestOperation(IntegrationTestCase):
pass


Expand Down
Original file line number Diff line number Diff line change
@@ -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 TestProductionPlanMaterialRequestWarehouse(unittest.TestCase):
class TestProductionPlanMaterialRequestWarehouse(IntegrationTestCase):
pass
Original file line number Diff line number Diff line change
@@ -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 TestSubOperation(unittest.TestCase):
class TestSubOperation(IntegrationTestCase):
pass
3 changes: 2 additions & 1 deletion erpnext/manufacturing/report/test_reports.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import unittest

import frappe
from frappe.tests import IntegrationTestCase

from erpnext.tests.utils import ReportFilters, ReportName, execute_script_report

Expand Down Expand Up @@ -50,7 +51,7 @@
}


class TestManufacturingReports(unittest.TestCase):
class TestManufacturingReports(IntegrationTestCase):
def test_execute_all_manufacturing_reports(self):
"""Test that all script report in manufacturing modules are executable with supported filters"""
for report, filter in REPORT_FILTER_TEST_CASES:
Expand Down
4 changes: 2 additions & 2 deletions erpnext/projects/doctype/activity_cost/test_activity_cost.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors
# See license.txt

import unittest

import frappe
from frappe.tests import IntegrationTestCase

from erpnext.projects.doctype.activity_cost.activity_cost import DuplicationError


class TestActivityCost(unittest.TestCase):
class TestActivityCost(IntegrationTestCase):
def test_duplication(self):
frappe.db.sql("delete from `tabActivity Cost`")
activity_cost1 = frappe.new_doc("Activity Cost")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt

import unittest

import frappe
from frappe.tests import IntegrationTestCase

from erpnext.projects.doctype.task.test_task import create_task


class TestProjectTemplate(unittest.TestCase):
class TestProjectTemplate(IntegrationTestCase):
pass


Expand Down
5 changes: 3 additions & 2 deletions erpnext/projects/doctype/project_type/test_project_type.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt

import unittest

from frappe.tests import IntegrationTestCase


class TestProjectType(unittest.TestCase):
class TestProjectType(IntegrationTestCase):
pass
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt

import unittest

import frappe
from frappe.tests import IntegrationTestCase


class TestProjectUpdate(unittest.TestCase):
class TestProjectUpdate(IntegrationTestCase):
pass


Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt

import unittest

from frappe.tests import IntegrationTestCase


class TestProjectsSettings(unittest.TestCase):
class TestProjectsSettings(IntegrationTestCase):
pass
3 changes: 2 additions & 1 deletion erpnext/projects/doctype/task/test_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
import unittest

import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import add_days, getdate, nowdate

from erpnext.projects.doctype.task.task import CircularReferenceError


class TestTask(unittest.TestCase):
class TestTask(IntegrationTestCase):
def test_circular_reference(self):
task1 = create_task("_Test Task 1", add_days(nowdate(), -15), add_days(nowdate(), -10))
task2 = create_task("_Test Task 2", add_days(nowdate(), 11), add_days(nowdate(), 15), task1.name)
Expand Down
5 changes: 3 additions & 2 deletions erpnext/projects/doctype/task_type/test_task_type.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt

import unittest

from frappe.tests import IntegrationTestCase


class TestTaskType(unittest.TestCase):
class TestTaskType(IntegrationTestCase):
pass
4 changes: 2 additions & 2 deletions erpnext/projects/doctype/timesheet/test_timesheet.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt

import datetime
import unittest

import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import add_to_date, now_datetime, nowdate

from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
from erpnext.projects.doctype.timesheet.timesheet import OverlapError, make_sales_invoice
from erpnext.setup.doctype.employee.test_employee import make_employee


class TestTimesheet(unittest.TestCase):
class TestTimesheet(IntegrationTestCase):
def setUp(self):
frappe.db.delete("Timesheet")

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import unittest

import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import add_days, add_months, nowdate

from erpnext.projects.doctype.task.test_task import create_task
from erpnext.projects.report.delayed_tasks_summary.delayed_tasks_summary import execute


class TestDelayedTasksSummary(unittest.TestCase):
class TestDelayedTasksSummary(IntegrationTestCase):
@classmethod
def setUp(self):
task1 = create_task("_Test Task 98", add_days(nowdate(), -10), nowdate())
Expand Down
Original file line number Diff line number Diff line change
@@ -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 TestNonConformance(unittest.TestCase):
class TestNonConformance(IntegrationTestCase):
pass
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Copyright (c) 2018, Frappe and Contributors
# See license.txt

import unittest

from frappe.tests import IntegrationTestCase


class TestQualityAction(unittest.TestCase):
class TestQualityAction(IntegrationTestCase):
# quality action has no code
pass
Original file line number Diff line number Diff line change
@@ -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 TestQualityFeedback(unittest.TestCase):
class TestQualityFeedback(IntegrationTestCase):
def test_quality_feedback(self):
template = frappe.get_doc(
dict(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt

import unittest

from frappe.tests import IntegrationTestCase


class TestQualityFeedbackTemplate(unittest.TestCase):
class TestQualityFeedbackTemplate(IntegrationTestCase):
pass
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Copyright (c) 2018, Frappe and Contributors
# See license.txt

import unittest

import frappe
from frappe.tests import IntegrationTestCase


class TestQualityGoal(unittest.TestCase):
class TestQualityGoal(IntegrationTestCase):
def test_quality_goal(self):
# no code, just a basic sanity check
goal = get_quality_goal()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Copyright (c) 2018, Frappe and Contributors
# See license.txt

import unittest

from frappe.tests import IntegrationTestCase


class TestQualityMeeting(unittest.TestCase):
class TestQualityMeeting(IntegrationTestCase):
# nothing to test
pass
Loading
Loading