mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-31 10:49:09 +00:00
refactor(test): move tax category custom field creation to bootstrap
This commit is contained in:
@@ -18,7 +18,6 @@ class TestTaxWithholdingCategory(ERPNextTestSuite):
|
|||||||
# create relevant supplier, etc
|
# create relevant supplier, etc
|
||||||
create_records()
|
create_records()
|
||||||
create_tax_withholding_category_records()
|
create_tax_withholding_category_records()
|
||||||
make_pan_no_field()
|
|
||||||
|
|
||||||
def validate_tax_withholding_entries(self, doctype, docname, expected_entries):
|
def validate_tax_withholding_entries(self, doctype, docname, expected_entries):
|
||||||
"""Validate tax withholding entries for a document"""
|
"""Validate tax withholding entries for a document"""
|
||||||
@@ -3998,18 +3997,3 @@ def create_lower_deduction_certificate(
|
|||||||
"certificate_limit": limit,
|
"certificate_limit": limit,
|
||||||
}
|
}
|
||||||
).insert()
|
).insert()
|
||||||
|
|
||||||
|
|
||||||
def make_pan_no_field():
|
|
||||||
pan_field = {
|
|
||||||
"Supplier": [
|
|
||||||
{
|
|
||||||
"fieldname": "pan",
|
|
||||||
"label": "PAN",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"translatable": 0,
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
create_custom_fields(pan_field, update=1)
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ from typing import Any, NewType
|
|||||||
import frappe
|
import frappe
|
||||||
from frappe import _
|
from frappe import _
|
||||||
from frappe.core.doctype.report.report import get_report_module_dotted_path
|
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.tests.utils import load_test_records_for
|
||||||
from frappe.utils import now_datetime, today
|
from frappe.utils import now_datetime, today
|
||||||
|
|
||||||
@@ -246,14 +247,16 @@ class BootStrapTestData:
|
|||||||
|
|
||||||
frappe.db.commit() # nosemgrep
|
frappe.db.commit() # nosemgrep
|
||||||
|
|
||||||
# Dimensions
|
|
||||||
# DDL commands have implicit commit
|
# DDL commands have implicit commit
|
||||||
|
# Dimensions
|
||||||
self.make_dimensions()
|
self.make_dimensions()
|
||||||
|
|
||||||
# custom doctype
|
# custom doctype
|
||||||
# DDL commands have implicit commit
|
|
||||||
self.make_custom_doctype()
|
self.make_custom_doctype()
|
||||||
|
|
||||||
|
# custom field
|
||||||
|
self.make_custom_field()
|
||||||
|
|
||||||
def update_system_settings(self):
|
def update_system_settings(self):
|
||||||
system_settings = frappe.get_doc("System Settings")
|
system_settings = frappe.get_doc("System Settings")
|
||||||
system_settings.time_zone = "Asia/Kolkata"
|
system_settings.time_zone = "Asia/Kolkata"
|
||||||
@@ -2829,6 +2832,20 @@ class BootStrapTestData:
|
|||||||
]
|
]
|
||||||
self.make_records(["document_type"], records)
|
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()
|
BootStrapTestData()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user