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

@@ -2,6 +2,7 @@ import json
import unittest
import frappe
from frappe.tests import IntegrationTestCase
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
@@ -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):
fields = [{"field_name": "quality_inspection_template"}]
set_item_variant_settings(fields)

View File

@@ -4,11 +4,12 @@ import unittest
import frappe
import frappe.utils
from frappe.model import mapper
from frappe.tests import IntegrationTestCase
from frappe.tests.utils import make_test_records
from frappe.utils import add_months, nowdate
class TestMapper(unittest.TestCase):
class TestMapper(IntegrationTestCase):
def test_map_docs(self):
"""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
import frappe
from frappe.tests import IntegrationTestCase
def uuid4():
return str(_uuid4())
class TestTaxes(unittest.TestCase):
class TestTaxes(IntegrationTestCase):
def setUp(self):
self.company = frappe.get_doc(
{

View File

@@ -2,6 +2,7 @@ import unittest
from functools import partial
import frappe
from frappe.tests import IntegrationTestCase
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)
class TestQueries(unittest.TestCase):
class TestQueries(IntegrationTestCase):
# All tests are based on doctype/test_records.json
def assert_nested_in(self, item, container):

View File

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