From df1c1a573fa38c550c7985cebae2aef65cc89e13 Mon Sep 17 00:00:00 2001 From: Saurabh Date: Thu, 22 Oct 2015 12:44:23 +0530 Subject: [PATCH] [fixes] test case for per_ordered --- erpnext/selling/doctype/sales_order/test_sales_order.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/erpnext/selling/doctype/sales_order/test_sales_order.py b/erpnext/selling/doctype/sales_order/test_sales_order.py index 459b35fb1b..43e08946c6 100644 --- a/erpnext/selling/doctype/sales_order/test_sales_order.py +++ b/erpnext/selling/doctype/sales_order/test_sales_order.py @@ -328,7 +328,9 @@ class TestSalesOrder(unittest.TestCase): existing_ordered_qty, existing_reserved_qty = frappe.db.get_value("Bin", {"item_code": po_item.item_code, "Warehouse": "_Test Warehouse - _TC"}, ["ordered_qty", "reserved_qty"]) - so = make_sales_order(item_list=so_items) + so = make_sales_order(item_list=so_items, do_not_submit=True) + so.submit() + po = make_purchase_order_for_drop_shipment(so.name, '_Test Supplier') po.submit() @@ -351,6 +353,10 @@ class TestSalesOrder(unittest.TestCase): #test po_item length self.assertEquals(len(po.items), 1) + #test per_ordered status + per_ordered = frappe.db.get_value("Sales Order", so.name, "per_ordered") + self.assertEquals(per_ordered, 100.0) + def test_reserved_qty_for_closing_so(self): from erpnext.stock.doctype.item.test_item import make_item