Skip to content

Commit 313652c

Browse files
Merge pull request #277 from inventree/po-test-fix
Tweak unit tests
2 parents 125e0da + 1687db7 commit 313652c

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

test/test_order.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -269,11 +269,15 @@ def test_order_complete_with_receive(self):
269269
result = po.receiveAll(location=use_location.pk)
270270

271271
# Check the result returned
272-
self.assertIsInstance(result, dict)
273-
self.assertIn('items', result)
274-
self.assertIn('location', result)
275-
# Check that all except one line were marked
276-
self.assertEqual(len(result['items']), len(po.getLineItems()) - 1)
272+
if self.api.api_version < 385: # Ref: https://github.com/inventree/InvenTree/pull/10174/
273+
self.assertIsInstance(result, dict)
274+
self.assertIn('items', result)
275+
self.assertIn('location', result)
276+
# Check that all except one line were marked
277+
self.assertEqual(len(result['items']), len(po.getLineItems()) - 1)
278+
else:
279+
self.assertIsInstance(result, list)
280+
self.assertEqual(len(result), len(po.getLineItems()) - 1)
277281

278282
# Receive all line items again - make sure answer is None
279283
# use the StockLocation item here

0 commit comments

Comments
 (0)