mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-30 04:26:44 +00:00
barcode add error coverage
This commit is contained in:
parent
92279b2f8f
commit
3a2b52ae53
@ -38,8 +38,18 @@ class BarcodeAPITest(APITestCase):
|
|||||||
|
|
||||||
def test_invalid(self):
|
def test_invalid(self):
|
||||||
|
|
||||||
|
# test scan url
|
||||||
response = self.client.post(self.scan_url, format='json', data={})
|
response = self.client.post(self.scan_url, format='json', data={})
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
|
||||||
|
|
||||||
|
# test wrong assign urls
|
||||||
|
response = self.client.post(self.assign_url, format='json', data={})
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
|
||||||
|
|
||||||
|
response = self.client.post(self.assign_url, format='json', data={'barcode': '123'})
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
|
||||||
|
|
||||||
|
response = self.client.post(self.assign_url, format='json', data={'barcode': '123', 'stockitem': '123'})
|
||||||
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
|
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
|
||||||
|
|
||||||
def test_empty(self):
|
def test_empty(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user