Skip to content

Commit

Permalink
chore: debugging test case
Browse files Browse the repository at this point in the history
  • Loading branch information
ruthra-kumar committed Oct 23, 2023
1 parent 514d543 commit a098090
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -2544,13 +2544,22 @@ def test_inter_company_transaction_without_default_warehouse(self):
frappe.db.set_single_value("Stock Settings", "allow_negative_stock", old_negative_stock)

def test_sle_for_target_warehouse(self):
print(frappe.db.get_all("Item", filters={"item_code": "138-CMS Shoe"}))
se = make_stock_entry(
item_code="138-CMS Shoe",
target="Finished Goods - _TC",
company="_Test Company",
qty=1,
basic_rate=500,
)
print(se.as_dict())

sles = frappe.get_all(
"Stock Ledger Entry",
filters={"voucher_no": se.name},
fields=["name", "voucher_no", "actual_qty"],
)
print(sles)

si = frappe.copy_doc(test_records[0])
si.update_stock = 1
Expand All @@ -2561,10 +2570,14 @@ def test_sle_for_target_warehouse(self):
si.insert()
si.submit()

print(si.as_dict())
sles = frappe.get_all(
"Stock Ledger Entry", filters={"voucher_no": si.name}, fields=["name", "actual_qty"]
"Stock Ledger Entry",
filters={"voucher_no": si.name},
fields=["name", "voucher_no", "actual_qty"],
)

print(sles)
# check if both SLEs are created
self.assertEqual(len(sles), 2)
self.assertEqual(sum(d.actual_qty for d in sles), 0.0)
Expand Down

0 comments on commit a098090

Please sign in to comment.