'Test automatic batch selection for outgoing stock entry'

def test_stock_entry_outgoing(self):

    batch_qty = 16
    receipt = self.test_purchase_receipt(batch_qty)
    stock_entry = frappe.get_doc(dict(doctype=u'Stock    Entry', purpose=u'Material    Issue', company=receipt.company, items=[dict(item_code=u'ITEM-BATCH-1', qty=batch_qty, s_warehouse=receipt.items[0].warehouse)])).insert()
    stock_entry.submit()
    self.assertEqual(stock_entry.items[0].batch_no, receipt.items[0].batch_no)
    self.assertEquals(get_batch_qty(receipt.items[0].batch_no, receipt.items[0].warehouse), 0)
