Skip to content

Commit

Permalink
Merge pull request #139 from inventree/order-complete-update
Browse files Browse the repository at this point in the history
Accept incomplete lines in PO complete unit test
  • Loading branch information
SchrodingersGat authored Aug 28, 2022
2 parents 54da628 + 707d490 commit 0903ee8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/test_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ def status_check_helper(
orderlist,
applymethod,
target_status,
target_status_text
target_status_text,
**kwargs
):
"""Apply function to order list, check for status and
status_text until one is confirmed - then quit
Expand All @@ -31,7 +32,7 @@ def status_check_helper(
# Use try-else so that only successful calls lead
# to next step - errors can occur due to orders
# which are not ready for completion yet
response = getattr(o, applymethod)()
response = getattr(o, applymethod)(**kwargs)

except HTTPError:
continue
Expand Down Expand Up @@ -212,7 +213,8 @@ def test_order_cancel_complete(self):
order.PurchaseOrder.list(self.api),
'complete',
30,
'Complete'
'Complete',
accept_incomplete=True,
))
# Go through purchase orders, try to cancel one
self.assertTrue(status_check_helper(
Expand Down

0 comments on commit 0903ee8

Please sign in to comment.