'Test batch creation via Stock Entry (Production Order)'

def test_stock_entry_incoming(self):

    self.make_batch_item(u'ITEM-BATCH-1')
    stock_entry = frappe.get_doc(dict(doctype=u'Stock    Entry', purpose=u'Material    Receipt', company=u'_Test    Company', items=[dict(item_code=u'ITEM-BATCH-1', qty=90, t_warehouse=u'_Test    Warehouse    -    _TC', cost_center=u'Main    -    _TC', rate=10)])).insert()
    stock_entry.submit()
    self.assertTrue(stock_entry.items[0].batch_no)
    self.assertEquals(get_batch_qty(stock_entry.items[0].batch_no, stock_entry.items[0].t_warehouse), 90)
