refactor(test): make stock entry deterministic

This commit is contained in:
ruthra kumar
2026-03-23 16:14:11 +05:30
parent 2c53cf3902
commit 8fd65d7afa
2 changed files with 10 additions and 3 deletions

View File

@@ -205,6 +205,14 @@
"doctype": "Company", "doctype": "Company",
"chart_of_accounts": "Standard", "chart_of_accounts": "Standard",
"create_chart_of_accounts_based_on": "Standard Template" "create_chart_of_accounts_based_on": "Standard Template"
},
{
"abbr": "TQC",
"company_name": "Test Quality Company",
"country": "India",
"default_currency": "INR",
"doctype": "Company",
"chart_of_accounts": "Standard",
"create_chart_of_accounts_based_on": "Standard Template"
} }
] ]

View File

@@ -2421,12 +2421,11 @@ class TestStockEntry(ERPNextTestSuite):
Unit test case to check the document naming rule with company condition Unit test case to check the document naming rule with company condition
For Quality Inspection, when created from Stock Entry. For Quality Inspection, when created from Stock Entry.
""" """
from erpnext.accounts.report.trial_balance.test_trial_balance import create_company
from erpnext.controllers.stock_controller import make_quality_inspections from erpnext.controllers.stock_controller import make_quality_inspections
from erpnext.stock.doctype.warehouse.test_warehouse import create_warehouse from erpnext.stock.doctype.warehouse.test_warehouse import create_warehouse
# create a separate company to handle document naming rule with company condition # create a separate company to handle document naming rule with company condition
qc_company = create_company(company_name="Test Quality Company") qc_company = "Test Quality Company"
# create document naming rule based on that for Quality Inspection Doctype # create document naming rule based on that for Quality Inspection Doctype
qc_naming_rule = frappe.new_doc( qc_naming_rule = frappe.new_doc(