From 46bcb4642241ba757388cb2ba1e712163ee9d097 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Sat, 11 Jul 2020 18:36:32 +0530 Subject: [PATCH] fix: Do not use random customers --- erpnext/controllers/tests/test_mapper.py | 8 +++----- erpnext/stock/doctype/item/test_records.json | 1 + 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/erpnext/controllers/tests/test_mapper.py b/erpnext/controllers/tests/test_mapper.py index 8839e002a4c..5ebf8cfa7f1 100644 --- a/erpnext/controllers/tests/test_mapper.py +++ b/erpnext/controllers/tests/test_mapper.py @@ -14,12 +14,10 @@ class TestMapper(unittest.TestCase): make_test_records("Item") items = frappe.get_all("Item", fields = ["name", "item_code"], filters = {'is_sales_item': 1, 'has_variants': 0, 'disabled': 0}) - customers = frappe.get_all("Customer") - if items and customers: + if items: # Make source docs (quotations) and a target doc (sales order) - customer = random.choice(customers).name - qtn1, item_list_1 = self.make_quotation(items, customer) - qtn2, item_list_2 = self.make_quotation(items, customer) + qtn1, item_list_1 = self.make_quotation(items, '_Test Customer') + qtn2, item_list_2 = self.make_quotation(items, '_Test Customer') so, item_list_3 = self.make_sales_order() # Map source docs to target with corresponding mapper method diff --git a/erpnext/stock/doctype/item/test_records.json b/erpnext/stock/doctype/item/test_records.json index ce77988579a..9ca887c77e3 100644 --- a/erpnext/stock/doctype/item/test_records.json +++ b/erpnext/stock/doctype/item/test_records.json @@ -454,6 +454,7 @@ { "doctype": "Item Tax", "parentfield": "taxes", + "tax_category": "_Test Tax Category 1", "item_tax_template": "_Test Item Tax Template 1" } ]