add coverage to barcode api

This commit is contained in:
Matthias 2022-03-13 19:38:57 +01:00
parent 925ae73eaa
commit bd2b279390
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076
2 changed files with 10 additions and 0 deletions

View File

@ -259,3 +259,12 @@ class TestInvenTreeBarcode(APITestCase):
# test with hash
test_assert_error('{"blbla": 10004}')
def test_scan(self):
"""
Test that a barcode can be scanned
"""
response = self.client.post(reverse('api-barcode-scan'), format='json', data={'barcode': 'blbla=10004',})
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertIn('success', response.data)

View File

@ -222,6 +222,7 @@
lft: 0
rght: 0
expiry_date: "1990-10-10"
uid: 9e5ae7fc20568ed4814c10967bba8b65
- model: stock.stockitem
pk: 521