diff --git a/src/backend/InvenTree/plugin/base/barcodes/test_barcode.py b/src/backend/InvenTree/plugin/base/barcodes/test_barcode.py index cec6fc68ad..2a73564dd1 100644 --- a/src/backend/InvenTree/plugin/base/barcodes/test_barcode.py +++ b/src/backend/InvenTree/plugin/base/barcodes/test_barcode.py @@ -15,6 +15,7 @@ class BarcodeAPITest(InvenTreeAPITestCase): """Tests for barcode api.""" fixtures = ['category', 'part', 'location', 'stock'] + roles = ['stock.view', 'stock_location.view', 'part.view'] def setUp(self): """Setup for all tests.""" @@ -259,6 +260,7 @@ class SOAllocateTest(InvenTreeAPITestCase): """Unit tests for the barcode endpoint for allocating items to a sales order.""" fixtures = ['category', 'company', 'part', 'location', 'stock'] + roles = ['stock.view'] @classmethod def setUpTestData(cls): diff --git a/src/backend/InvenTree/plugin/builtin/barcodes/test_inventree_barcode.py b/src/backend/InvenTree/plugin/builtin/barcodes/test_inventree_barcode.py index 1dc1eb90b2..4ae09064af 100644 --- a/src/backend/InvenTree/plugin/builtin/barcodes/test_inventree_barcode.py +++ b/src/backend/InvenTree/plugin/builtin/barcodes/test_inventree_barcode.py @@ -11,6 +11,7 @@ class TestInvenTreeBarcode(InvenTreeAPITestCase): """Tests for the integrated InvenTreeBarcode barcode plugin.""" fixtures = ['category', 'part', 'location', 'stock', 'company', 'supplier_part'] + roles = ['stock.view', 'stock_location.view', 'part.view'] def setUp(self): """Set up the test case.""" diff --git a/src/backend/InvenTree/plugin/builtin/suppliers/test_supplier_barcodes.py b/src/backend/InvenTree/plugin/builtin/suppliers/test_supplier_barcodes.py index d194102581..d04993bef6 100644 --- a/src/backend/InvenTree/plugin/builtin/suppliers/test_supplier_barcodes.py +++ b/src/backend/InvenTree/plugin/builtin/suppliers/test_supplier_barcodes.py @@ -14,6 +14,13 @@ class SupplierBarcodeTests(InvenTreeAPITestCase): """Tests barcode parsing for all suppliers.""" SCAN_URL = reverse('api-barcode-scan') + roles = [ + 'stock.view', + 'stock_location.view', + 'part.view', + 'company.view', + 'order.view', + ] @classmethod def setUpTestData(cls): @@ -176,6 +183,8 @@ class SupplierBarcodeTests(InvenTreeAPITestCase): class SupplierBarcodePOReceiveTests(InvenTreeAPITestCase): """Tests barcode scanning to receive a purchase order item.""" + roles = ['stock.view', 'stock_location.view'] + def setUp(self): """Create supplier part and purchase_order.""" super().setUp()