From 3d4f145b16c17da75cc6c8cba2fd8357d48473a9 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Mon, 1 Dec 2025 16:00:06 +0530 Subject: [PATCH] refactor(test): make quotation deterministic --- .../doctype/quotation/test_quotation.py | 6 +++ .../doctype/quotation/test_records.json | 37 +++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 erpnext/selling/doctype/quotation/test_records.json diff --git a/erpnext/selling/doctype/quotation/test_quotation.py b/erpnext/selling/doctype/quotation/test_quotation.py index 238b5144933..2a8d582f8fb 100644 --- a/erpnext/selling/doctype/quotation/test_quotation.py +++ b/erpnext/selling/doctype/quotation/test_quotation.py @@ -13,6 +13,11 @@ from erpnext.tests.utils import ERPNextTestSuite class TestQuotation(ERPNextTestSuite): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.load_test_records("Quotation") + def test_update_child_quotation_add_item(self): from erpnext.stock.doctype.item.test_item import make_item @@ -975,6 +980,7 @@ class TestQuotation(ERPNextTestSuite): quotation.reload() self.assertEqual(quotation.status, "Ordered") + @ERPNextTestSuite.change_settings("Selling Settings", {"allow_multiple_items": 1}) def test_duplicate_items_in_quotation(self): from erpnext.selling.doctype.quotation.quotation import make_sales_order from erpnext.stock.doctype.item.test_item import make_item diff --git a/erpnext/selling/doctype/quotation/test_records.json b/erpnext/selling/doctype/quotation/test_records.json new file mode 100644 index 00000000000..8bab707ad70 --- /dev/null +++ b/erpnext/selling/doctype/quotation/test_records.json @@ -0,0 +1,37 @@ +[ + { + "company": "_Test Company", + "conversion_rate": 1.0, + "currency": "INR", + "party_name": "_Test Customer", + "customer_group": "_Test Customer Group", + "customer_name": "_Test Customer", + "doctype": "Quotation", + "base_grand_total": 1000.0, + "grand_total": 1000.0, + "order_type": "Sales", + "plc_conversion_rate": 1.0, + "price_list_currency": "INR", + "items": [ + { + "base_amount": 1000.0, + "base_rate": 100.0, + "description": "CPU", + "doctype": "Quotation Item", + "item_code": "_Test Item Home Desktop 100", + "item_name": "CPU", + "parentfield": "items", + "qty": 10.0, + "rate": 100.0, + "uom": "_Test UOM 1", + "stock_uom": "_Test UOM 1", + "conversion_factor": 1.0 + } + ], + "quotation_to": "Customer", + "selling_price_list": "_Test Price List", + "territory": "_Test Territory", + "transaction_date": "2013-02-21", + "valid_till": "2013-03-21" + } +]