mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Unit test fixes
This commit is contained in:
parent
d3e9803fd4
commit
7505d7b3c5
@ -354,15 +354,17 @@ class StockItemTest(StockAPITestCase):
|
|||||||
self.assertContains(response, 'does not exist', status_code=status.HTTP_400_BAD_REQUEST)
|
self.assertContains(response, 'does not exist', status_code=status.HTTP_400_BAD_REQUEST)
|
||||||
|
|
||||||
# POST without quantity
|
# POST without quantity
|
||||||
response = self.client.post(
|
response = self.post(
|
||||||
self.list_url,
|
self.list_url,
|
||||||
data={
|
{
|
||||||
'part': 1,
|
'part': 1,
|
||||||
'location': 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
|
# POST with quantity and part and location
|
||||||
response = self.client.post(
|
response = self.client.post(
|
||||||
|
Loading…
Reference in New Issue
Block a user