This commit is contained in:
Neil Trini Lasrado 2015-01-07 16:24:52 +05:30
parent a17d7cea34
commit 1ff3a6cdb8

View File

@ -10,7 +10,7 @@ from erpnext.manufacturing.doctype.production_order.production_order import make
from erpnext.stock.doctype.stock_entry import test_stock_entry
class TestProductionOrder(unittest.TestCase):
def test_planned_qty(self):
def check_planned_qty(self):
set_perpetual_inventory(0)
planned0 = frappe.db.get_value("Bin", {"item_code": "_Test FG Item", "warehouse": "_Test Warehouse 1 - _TC"}, "planned_qty") or 0
@ -28,14 +28,14 @@ class TestProductionOrder(unittest.TestCase):
for d in s.get("mtn_details"):
d.s_warehouse = "Stores - _TC"
s.fiscal_year = "_Test Fiscal Year 2013"
s.posting_date = "2013-01-01"
s.posting_date = "2013-01-02"
s.insert()
s.submit()
# from wip to fg
s = frappe.get_doc(make_stock_entry(pro_doc.name, "Manufacture", 4))
s.fiscal_year = "_Test Fiscal Year 2013"
s.posting_date = "2013-01-01"
s.posting_date = "2013-01-03"
s.insert()
s.submit()
@ -48,14 +48,14 @@ class TestProductionOrder(unittest.TestCase):
def test_over_production(self):
from erpnext.manufacturing.doctype.production_order.production_order import StockOverProductionError
pro_doc = self.test_planned_qty()
pro_doc = self.check_planned_qty()
test_stock_entry.make_stock_entry("_Test Item", None, "_Test Warehouse - _TC", 100, 100)
test_stock_entry.make_stock_entry("_Test Item Home Desktop 100", None, "_Test Warehouse - _TC", 100, 100)
s = frappe.get_doc(make_stock_entry(pro_doc.name, "Manufacture", 7))
s.fiscal_year = "_Test Fiscal Year 2013"
s.posting_date = "2013-01-01"
s.posting_date = "2013-01-04"
s.insert()
self.assertRaises(StockOverProductionError, s.submit)