mirror of
https://github.com/inventree/InvenTree.git
synced 2025-05-03 22:08:49 +00:00
Add unit test for invalid item
This commit is contained in:
parent
6766343f8f
commit
235954af18
@ -106,6 +106,23 @@ class BarcodeAPITest(APITestCase):
|
|||||||
self.assertIn('barcode_data', response.data)
|
self.assertIn('barcode_data', response.data)
|
||||||
self.assertEqual(response.data['stockitem']['pk'], 1)
|
self.assertEqual(response.data['stockitem']['pk'], 1)
|
||||||
|
|
||||||
|
def test_invalid_item(self):
|
||||||
|
"""Test response for invalid stock item"""
|
||||||
|
|
||||||
|
response = self.client.post(
|
||||||
|
self.scan_url,
|
||||||
|
{
|
||||||
|
'barcode': {
|
||||||
|
'stockitem': 999999999,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
format='json'
|
||||||
|
)
|
||||||
|
|
||||||
|
self.assertEqual(response.status_code, 400)
|
||||||
|
|
||||||
|
self.assertEqual(response.data['stockitem'], 'Stock item does not exist')
|
||||||
|
|
||||||
def test_find_location(self):
|
def test_find_location(self):
|
||||||
"""
|
"""
|
||||||
Test that we can lookup a stock location based on ID
|
Test that we can lookup a stock location based on ID
|
||||||
|
Loading…
x
Reference in New Issue
Block a user