From fefe39b88d28c9af501a5b139fbf9e1dc31cbd53 Mon Sep 17 00:00:00 2001 From: Oliver Date: Thu, 9 Dec 2021 10:04:33 +1100 Subject: [PATCH] Fixes for unit tests --- InvenTree/stock/test_api.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/InvenTree/stock/test_api.py b/InvenTree/stock/test_api.py index ec5064f08b..fe76e6c1c0 100644 --- a/InvenTree/stock/test_api.py +++ b/InvenTree/stock/test_api.py @@ -817,7 +817,7 @@ class StockAssignTest(StockAPITestCase): for i in range(5): stock_item = StockItem.objects.create( - part=part.models.Part.objects.get(pk=1), + part=part.models.Part.objects.get(pk=25), quantity=i + 5, ) @@ -829,7 +829,7 @@ class StockAssignTest(StockAPITestCase): self.assertEqual(customer.assigned_stock.count(), 0) - self.post( + response = self.post( self.URL, data={ 'items': stock_items, @@ -838,5 +838,7 @@ class StockAssignTest(StockAPITestCase): expected_code=201, ) + self.assertEqual(response.data['customer'], 4) + # 5 stock items should now have been assigned to this customer self.assertEqual(customer.assigned_stock.count(), 5)