Skip to content

Commit

Permalink
test: get_item_details contains bin details
Browse files Browse the repository at this point in the history
  • Loading branch information
dj12djdjs committed Dec 31, 2022
1 parent 8d62cdf commit 239a5f8
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion erpnext/stock/doctype/item/test_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ def get_item(self, idx):
def test_get_item_details(self):
# delete modified item price record and make as per test_records
frappe.db.sql("""delete from `tabItem Price`""")
frappe.db.sql("""delete from `tabBin`""")

to_check = {
"item_code": "_Test Item",
Expand All @@ -103,9 +104,26 @@ def test_get_item_details(self):
"batch_no": None,
"uom": "_Test UOM",
"conversion_factor": 1.0,
"reserved_qty": 1,
"actual_qty": 5,
"ordered_qty": 10,
"projected_qty": 14,
}

make_test_objects("Item Price")
make_test_objects(
"Bin",
[
{
"item_code": "_Test Item",
"warehouse": "_Test Warehouse - _TC",
"reserved_qty": 1,
"actual_qty": 5,
"ordered_qty": 10,
"projected_qty": 14,
}
],
)

company = "_Test Company"
currency = frappe.get_cached_value("Company", company, "default_currency")
Expand All @@ -129,7 +147,7 @@ def test_get_item_details(self):
)

for key, value in to_check.items():
self.assertEqual(value, details.get(key))
self.assertEqual(value, details.get(key), key)

def test_item_tax_template(self):
expected_item_tax_template = [
Expand Down

0 comments on commit 239a5f8

Please sign in to comment.