Skip to content

Commit

Permalink
test: bundles in picklist
Browse files Browse the repository at this point in the history
  • Loading branch information
ankush committed Apr 27, 2022
1 parent 5c3f901 commit 7d56820
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions erpnext/stock/doctype/pick_list/test_pick_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@

import frappe
from frappe import _dict

test_dependencies = ["Item", "Sales Invoice", "Stock Entry", "Batch"]

from frappe.tests.utils import FrappeTestCase

from erpnext.selling.doctype.sales_order.sales_order import create_pick_list
from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order
from erpnext.stock.doctype.item.test_item import create_item, make_item
from erpnext.stock.doctype.pick_list.pick_list import create_delivery_note
from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import make_purchase_receipt
from erpnext.stock.doctype.stock_reconciliation.stock_reconciliation import (
EmptyStockReconciliationItemsError,
)

test_dependencies = ["Item", "Sales Invoice", "Stock Entry", "Batch"]


class TestPickList(FrappeTestCase):
def test_pick_list_picks_warehouse_for_each_item(self):
Expand Down Expand Up @@ -579,6 +580,19 @@ def test_multiple_dn_creation(self):
if dn_item.item_code == "_Test Item 2":
self.assertEqual(dn_item.qty, 2)

def test_picklist_with_bundles(self):
# from test_records.json
bundle = "_Test Product Bundle Item"
bundle_items = {"_Test Item": 5, "_Test Item Home Desktop 100": 2}

so = make_sales_order(item_code=bundle, qty=1)

pl = create_pick_list(so.name)
pl.save()
self.assertEqual(len(pl.locations), 2)
for item in pl.locations:
self.assertEqual(item.stock_qty, bundle_items[item.item_code])

# def test_pick_list_skips_items_in_expired_batch(self):
# pass

Expand Down

0 comments on commit 7d56820

Please sign in to comment.