Skip to content

Commit

Permalink
refactor(test): don't set po_no by default
Browse files Browse the repository at this point in the history
  • Loading branch information
ruthra-kumar committed Aug 11, 2023
1 parent dbd3fdb commit 64614cd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion erpnext/selling/doctype/sales_order/test_sales_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -2055,7 +2055,7 @@ def make_sales_order(**args):
so.company = args.company or "_Test Company"
so.customer = args.customer or "_Test Customer"
so.currency = args.currency or "INR"
so.po_no = args.po_no or "12345"
so.po_no = args.po_no or ""
if args.selling_price_list:
so.selling_price_list = args.selling_price_list

Expand Down
9 changes: 5 additions & 4 deletions erpnext/stock/doctype/delivery_note/test_delivery_note.py
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ def test_closed_delivery_note(self):

def test_dn_billing_status_case1(self):
# SO -> DN -> SI
so = make_sales_order()
so = make_sales_order(po_no="12345")
dn = create_dn_against_so(so.name, delivered_qty=2)

self.assertEqual(dn.status, "To Bill")
Expand All @@ -730,7 +730,7 @@ def test_dn_billing_status_case2(self):
make_sales_invoice,
)

so = make_sales_order()
so = make_sales_order(po_no="12345")

si = make_sales_invoice(so.name)
si.get("items")[0].qty = 5
Expand Down Expand Up @@ -774,7 +774,7 @@ def test_dn_billing_status_case3(self):

frappe.db.set_single_value("Stock Settings", "allow_negative_stock", 1)

so = make_sales_order()
so = make_sales_order(po_no="12345")

dn1 = make_delivery_note(so.name)
dn1.get("items")[0].qty = 2
Expand Down Expand Up @@ -820,7 +820,7 @@ def test_dn_billing_status_case4(self):
from erpnext.accounts.doctype.sales_invoice.sales_invoice import make_delivery_note
from erpnext.selling.doctype.sales_order.sales_order import make_sales_invoice

so = make_sales_order()
so = make_sales_order(po_no="12345")

si = make_sales_invoice(so.name)
si.submit()
Expand Down Expand Up @@ -1227,6 +1227,7 @@ def reserved_qty_check(self):
self.assertEqual(get_reserved_qty(item, warehouse), 0 if dont_reserve_qty else qty_to_reserve)

def tearDown(self):
frappe.db.rollback()
frappe.db.set_single_value("Selling Settings", "dont_reserve_sales_order_qty_on_sales_return", 0)


Expand Down

0 comments on commit 64614cd

Please sign in to comment.