2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-05-01 13:06:45 +00:00

Fixes for unit tests

This commit is contained in:
Oliver 2021-12-09 10:04:33 +11:00
parent c1163b9f6b
commit fefe39b88d

View File

@ -817,7 +817,7 @@ class StockAssignTest(StockAPITestCase):
for i in range(5): for i in range(5):
stock_item = StockItem.objects.create( stock_item = StockItem.objects.create(
part=part.models.Part.objects.get(pk=1), part=part.models.Part.objects.get(pk=25),
quantity=i + 5, quantity=i + 5,
) )
@ -829,7 +829,7 @@ class StockAssignTest(StockAPITestCase):
self.assertEqual(customer.assigned_stock.count(), 0) self.assertEqual(customer.assigned_stock.count(), 0)
self.post( response = self.post(
self.URL, self.URL,
data={ data={
'items': stock_items, 'items': stock_items,
@ -838,5 +838,7 @@ class StockAssignTest(StockAPITestCase):
expected_code=201, expected_code=201,
) )
self.assertEqual(response.data['customer'], 4)
# 5 stock items should now have been assigned to this customer # 5 stock items should now have been assigned to this customer
self.assertEqual(customer.assigned_stock.count(), 5) self.assertEqual(customer.assigned_stock.count(), 5)