refactor(test): move dimension setup to test data bootstrap

and remove create_dimension() and disable_dimension()
This commit is contained in:
ruthra kumar
2026-03-20 11:50:01 +05:30
parent ed76d6699a
commit 342ce65401
7 changed files with 32 additions and 102 deletions

View File

@@ -246,6 +246,10 @@ class BootStrapTestData:
frappe.db.commit() # nosemgrep
# Dimensions
# DDL commands have implicit commit
self.make_dimensions()
# custom doctype
# DDL commands have implicit commit
self.make_custom_doctype()
@@ -2794,6 +2798,33 @@ class BootStrapTestData:
]
self.make_records(["address_title", "address_type"], records)
def make_dimensions(self):
records = [
{
"doctype": "Accounting Dimension",
"document_type": "Department",
"dimension_defaults": [
{
"company": "_Test Company",
"reference_document": "Department",
"default_dimension": "_Test Department - _TC",
}
],
},
{
"doctype": "Accounting Dimension",
"document_type": "Location",
"dimension_defaults": [
{
"company": "_Test Company",
"reference_document": "Location",
"default_dimension": "Block 1",
}
],
},
]
self.make_records(["document_type"], records)
BootStrapTestData()