diff --git a/InvenTree/barcodes/tests.py b/InvenTree/barcodes/tests.py index 4df62fe4f8..1f43d4aca3 100644 --- a/InvenTree/barcodes/tests.py +++ b/InvenTree/barcodes/tests.py @@ -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) diff --git a/InvenTree/stock/fixtures/stock.yaml b/InvenTree/stock/fixtures/stock.yaml index f1926be478..0f44828d8e 100644 --- a/InvenTree/stock/fixtures/stock.yaml +++ b/InvenTree/stock/fixtures/stock.yaml @@ -222,6 +222,7 @@ lft: 0 rght: 0 expiry_date: "1990-10-10" + uid: 9e5ae7fc20568ed4814c10967bba8b65 - model: stock.stockitem pk: 521