fix: Test cases
diff --git a/erpnext/manufacturing/doctype/blanket_order/test_blanket_order.py b/erpnext/manufacturing/doctype/blanket_order/test_blanket_order.py
index 455ea06..3171def 100644
--- a/erpnext/manufacturing/doctype/blanket_order/test_blanket_order.py
+++ b/erpnext/manufacturing/doctype/blanket_order/test_blanket_order.py
@@ -7,13 +7,17 @@
import unittest
from frappe.utils import add_months, today
from erpnext import get_company_currency
-from .blanket_order import make_sales_order, make_purchase_order
+from .blanket_order import make_order
class TestBlanketOrder(unittest.TestCase):
+ def setUp(self):
+ frappe.flags.args = frappe._dict()
+
def test_sales_order_creation(self):
bo = make_blanket_order(blanket_order_type="Selling")
- so = make_sales_order(bo.name)
+ frappe.flags.args.doctype = 'Sales Order'
+ so = make_order(bo.name)
so.currency = get_company_currency(so.company)
so.delivery_date = today()
so.items[0].qty = 10
@@ -29,7 +33,8 @@
self.assertEqual(so.items[0].qty, bo.items[0].ordered_qty)
# test the quantity
- so1 = make_sales_order(bo.name)
+ frappe.flags.args.doctype = 'Sales Order'
+ so1 = make_order(bo.name)
so1.currency = get_company_currency(so1.company)
self.assertEqual(so1.items[0].qty, (bo.items[0].qty-bo.items[0].ordered_qty))
@@ -37,7 +42,8 @@
def test_purchase_order_creation(self):
bo = make_blanket_order(blanket_order_type="Purchasing")
- po = make_purchase_order(bo.name)
+ frappe.flags.args.doctype = 'Purchase Order'
+ po = make_order(bo.name)
po.currency = get_company_currency(po.company)
po.schedule_date = today()
po.items[0].qty = 10
@@ -53,7 +59,8 @@
self.assertEqual(po.items[0].qty, bo.items[0].ordered_qty)
# test the quantity
- po1 = make_sales_order(bo.name)
+ frappe.flags.args.doctype = 'Purchase Order'
+ po1 = make_order(bo.name)
po1.currency = get_company_currency(po1.company)
self.assertEqual(po1.items[0].qty, (bo.items[0].qty-bo.items[0].ordered_qty))
@@ -78,7 +85,7 @@
"qty": args.quantity or 1000,
"rate": args.rate or 100
})
-
+
bo.insert()
bo.submit()
return bo
\ No newline at end of file