mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-14 18:51:21 +00:00
refactor(test): move dimension setup to test data bootstrap
and remove create_dimension() and disable_dimension()
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user