From 8a9d41a92edae41aacc959a4799f4dd8d74ff5a1 Mon Sep 17 00:00:00 2001 From: Neil Trini Lasrado Date: Fri, 24 Jul 2015 13:18:45 +0530 Subject: [PATCH] Modified Test Cases for Production Order --- .../production_order/test_production_order.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/erpnext/manufacturing/doctype/production_order/test_production_order.py b/erpnext/manufacturing/doctype/production_order/test_production_order.py index c62be8260a4..b91b2e12c83 100644 --- a/erpnext/manufacturing/doctype/production_order/test_production_order.py +++ b/erpnext/manufacturing/doctype/production_order/test_production_order.py @@ -137,21 +137,17 @@ class TestProductionOrder(unittest.TestCase): self.assertEqual(prod_order.planned_operating_cost, cost*2) def test_production_item(self): - item = frappe.get_doc("Item", "_Test FG Item") - item.is_pro_applicable= "No" - item.save() - + frappe.db.set_value("Item", "_Test FG Item", "is_pro_applicable", "No") + prod_order = make_prod_order_test_record(item="_Test FG Item", qty=1, do_not_save=True) self.assertRaises(ProductionNotApplicableError, prod_order.save) - item.is_pro_applicable= "Yes" - item.end_of_life = "2000-1-1" - item.save() + frappe.db.set_value("Item", "_Test FG Item", "is_pro_applicable", "Yes") + frappe.db.set_value("Item", "_Test FG Item", "end_of_life", "2000-1-1") self.assertRaises(frappe.ValidationError, prod_order.save) - item.end_of_life=None - item.save() + frappe.db.set_value("Item", "_Test FG Item", "end_of_life", None) prod_order = make_prod_order_test_record(item="_Test Variant Item", qty=1, do_not_save=True) self.assertRaises(ItemHasVariantError, prod_order.save)