test: validate on save instead of on creation

(cherry picked from commit 0efd5577bd9bdc0bb900d4d23d85aa86fd09929a)
This commit is contained in:
Ankush Menat 2022-02-08 11:40:40 +05:30 committed by Ankush Menat
parent 3969840ee8
commit bb105a33b2

View File

@ -703,7 +703,8 @@ class TestWorkOrder(ERPNextTestCase):
wo = make_wo_order_test_record(item=item_name, qty=1, source_warehouse=source_warehouse,
company=company)
self.assertRaises(frappe.ValidationError, make_stock_entry, wo.name, 'Material Transfer for Manufacture')
stock_entry = frappe.get_doc(make_stock_entry(wo.name, 'Material Transfer for Manufacture'))
self.assertRaises(frappe.ValidationError, stock_entry.save)
def test_wo_completion_with_pl_bom(self):
from erpnext.manufacturing.doctype.bom.test_bom import (