diff --git a/erpnext/accounts/doctype/tax_withholding_category/test_tax_withholding_category.py b/erpnext/accounts/doctype/tax_withholding_category/test_tax_withholding_category.py index 66dc090f7c7..bd633c94dc9 100644 --- a/erpnext/accounts/doctype/tax_withholding_category/test_tax_withholding_category.py +++ b/erpnext/accounts/doctype/tax_withholding_category/test_tax_withholding_category.py @@ -18,7 +18,6 @@ class TestTaxWithholdingCategory(ERPNextTestSuite): # create relevant supplier, etc create_records() create_tax_withholding_category_records() - make_pan_no_field() def validate_tax_withholding_entries(self, doctype, docname, expected_entries): """Validate tax withholding entries for a document""" @@ -3998,18 +3997,3 @@ def create_lower_deduction_certificate( "certificate_limit": limit, } ).insert() - - -def make_pan_no_field(): - pan_field = { - "Supplier": [ - { - "fieldname": "pan", - "label": "PAN", - "fieldtype": "Data", - "translatable": 0, - } - ] - } - - create_custom_fields(pan_field, update=1) diff --git a/erpnext/tests/utils.py b/erpnext/tests/utils.py index bfc0d5d89f6..b5c8e19f648 100644 --- a/erpnext/tests/utils.py +++ b/erpnext/tests/utils.py @@ -8,6 +8,7 @@ from typing import Any, NewType import frappe from frappe import _ from frappe.core.doctype.report.report import get_report_module_dotted_path +from frappe.custom.doctype.custom_field.custom_field import create_custom_fields from frappe.tests.utils import load_test_records_for from frappe.utils import now_datetime, today @@ -246,14 +247,16 @@ class BootStrapTestData: frappe.db.commit() # nosemgrep - # Dimensions # DDL commands have implicit commit + # Dimensions self.make_dimensions() # custom doctype - # DDL commands have implicit commit self.make_custom_doctype() + # custom field + self.make_custom_field() + def update_system_settings(self): system_settings = frappe.get_doc("System Settings") system_settings.time_zone = "Asia/Kolkata" @@ -2829,6 +2832,20 @@ class BootStrapTestData: ] self.make_records(["document_type"], records) + def make_custom_field(self): + pan_field = { + "Supplier": [ + { + "fieldname": "pan", + "label": "PAN", + "fieldtype": "Data", + "translatable": 0, + } + ] + } + + create_custom_fields(pan_field, update=1) + BootStrapTestData()