diff --git a/InvenTree/order/test_api.py b/InvenTree/order/test_api.py index 1f7905d1e3..899fa9a6fc 100644 --- a/InvenTree/order/test_api.py +++ b/InvenTree/order/test_api.py @@ -203,6 +203,23 @@ class PurchaseOrderTest(OrderTest): # And if we try to access the detail view again, it has gone response = self.get(url, expected_code=404) + def test_po_create(self): + """ + Test that we can create a new PurchaseOrder via the API + """ + + self.assignRole('purchase_order.add') + + self.post( + reverse('api-po-list'), + { + 'reference': '12345678', + 'supplier': 1, + 'description': 'A test purchase order', + }, + expected_code=201 + ) + class PurchaseOrderReceiveTest(OrderTest): """ @@ -607,3 +624,20 @@ class SalesOrderTest(OrderTest): # And the resource should no longer be available response = self.get(url, expected_code=404) + + def test_so_create(self): + """ + Test that we can create a new SalesOrder via the API + """ + + self.assignRole('sales_order.add') + + self.post( + reverse('api-so-list'), + { + 'reference': '1234566778', + 'customer': 4, + 'description': 'A test sales order', + }, + expected_code=201 + )