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,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 (
add_days,
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
class AssetSetup(unittest.TestCase):
class AssetSetup(IntegrationTestCase):
@classmethod
def setUpClass(cls):
set_depreciation_settings_in_company()

View File

@@ -1,9 +1,9 @@
# Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import cint, flt, getdate, now_datetime
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):
set_depreciation_settings_in_company()
create_asset_data()

View File

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

View File

@@ -1,16 +1,16 @@
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import unittest
import frappe
from frappe.tests import IntegrationTestCase
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.stock.doctype.purchase_receipt.test_purchase_receipt import make_purchase_receipt
class TestAssetMaintenance(unittest.TestCase):
class TestAssetMaintenance(IntegrationTestCase):
def setUp(self):
set_depreciation_settings_in_company()
self.pr = make_purchase_receipt(

View File

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

View File

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

View File

@@ -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 now
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
class TestAssetMovement(unittest.TestCase):
class TestAssetMovement(IntegrationTestCase):
def setUp(self):
frappe.db.set_value(
"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
# See license.txt
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import flt, nowdate, nowtime, today
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
def setUpClass(cls):
set_depreciation_settings_in_company()

View File

@@ -1,9 +1,9 @@
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import unittest
import frappe
from frappe.tests import IntegrationTestCase
from frappe.utils import add_days, cstr, get_last_day, getdate, nowdate
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
class TestAssetValueAdjustment(unittest.TestCase):
class TestAssetValueAdjustment(IntegrationTestCase):
def setUp(self):
create_asset_data()
frappe.db.set_value(

View File

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

View File

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