From 7505d7b3c57bd92738be6c0f0eadb0087c48072c Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Sun, 27 Jun 2021 00:47:12 +1000 Subject: [PATCH] Unit test fixes --- InvenTree/stock/test_api.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/InvenTree/stock/test_api.py b/InvenTree/stock/test_api.py index e1fb616335..729bf25a9b 100644 --- a/InvenTree/stock/test_api.py +++ b/InvenTree/stock/test_api.py @@ -354,16 +354,18 @@ class StockItemTest(StockAPITestCase): self.assertContains(response, 'does not exist', status_code=status.HTTP_400_BAD_REQUEST) # POST without quantity - response = self.client.post( + response = self.post( self.list_url, - data={ + { 'part': 1, 'location': 1, - } + }, + expected_code=201, ) - self.assertContains(response, 'This field is required', status_code=status.HTTP_400_BAD_REQUEST) - + # Item should have been created with default quantity + self.assertEqual(response.data['quantity'], 1) + # POST with quantity and part and location response = self.client.post( self.list_url,