mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add some more unit tests
This commit is contained in:
parent
41e59e5311
commit
b60296e494
@ -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
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user