'Test automatic batch selection for outgoing items'

def test_delivery_note(self):

    batch_qty = 15
    receipt = self.test_purchase_receipt(batch_qty)
    delivery_note = frappe.get_doc(dict(doctype=u'Delivery    Note', customer=u'_Test    Customer', company=receipt.company, items=[dict(item_code=u'ITEM-BATCH-1', qty=batch_qty, rate=10, warehouse=receipt.items[0].warehouse)])).insert()
    delivery_note.submit()
    self.assertEquals(delivery_note.items[0].batch_no, receipt.items[0].batch_no)
    self.assertEquals(get_batch_qty(receipt.items[0].batch_no, receipt.items[0].warehouse), 0)
