mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-02 19:50:59 +00:00
Fixes for stock api unit tests
- Remove old unit tests - Require quantity when creating a new stock item
This commit is contained in:
@ -364,24 +364,22 @@ class StockItemTest(StockAPITestCase):
|
||||
'part': 1,
|
||||
'location': 1,
|
||||
},
|
||||
expected_code=201,
|
||||
expected_code=400
|
||||
)
|
||||
|
||||
# Item should have been created with default quantity
|
||||
self.assertEqual(response.data['quantity'], 1)
|
||||
self.assertIn('Quantity is required', str(response.data))
|
||||
|
||||
# POST with quantity and part and location
|
||||
response = self.client.post(
|
||||
response = self.post(
|
||||
self.list_url,
|
||||
data={
|
||||
'part': 1,
|
||||
'location': 1,
|
||||
'quantity': 10,
|
||||
}
|
||||
},
|
||||
expected_code=201
|
||||
)
|
||||
|
||||
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
|
||||
|
||||
def test_default_expiry(self):
|
||||
"""
|
||||
Test that the "default_expiry" functionality works via the API.
|
||||
|
Reference in New Issue
Block a user