mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add some unit tests
This commit is contained in:
parent
a7e5a79f4c
commit
cfc0145180
@ -31,7 +31,7 @@ class OrderTest(APITestCase):
|
|||||||
|
|
||||||
return self.client.get(url + "?" + options, format='json')
|
return self.client.get(url + "?" + options, format='json')
|
||||||
|
|
||||||
def test_po_list(self,):
|
def test_po_list(self):
|
||||||
|
|
||||||
url = reverse('api-po-list')
|
url = reverse('api-po-list')
|
||||||
|
|
||||||
@ -42,3 +42,19 @@ class OrderTest(APITestCase):
|
|||||||
# Filter by stuff
|
# Filter by stuff
|
||||||
response = self.doGet(url, 'status=10&part=1&supplier_part=1')
|
response = self.doGet(url, 'status=10&part=1&supplier_part=1')
|
||||||
self.assertEqual(response.status_code, status.HTTP_200_OK)
|
self.assertEqual(response.status_code, status.HTTP_200_OK)
|
||||||
|
|
||||||
|
def test_po_attachments(self):
|
||||||
|
|
||||||
|
url = reverse('api-po-attachment-list')
|
||||||
|
|
||||||
|
response = self.doGet(url)
|
||||||
|
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_200_OK)
|
||||||
|
|
||||||
|
def test_so_attachments(self):
|
||||||
|
|
||||||
|
url = reverse('api-so-attachment-list')
|
||||||
|
|
||||||
|
response = self.doGet(url)
|
||||||
|
|
||||||
|
self.assertEqual(response.status_code, status.HTTP_200_OK)
|
@ -646,18 +646,18 @@ part_api_urls = [
|
|||||||
# Base URL for PartCategory API endpoints
|
# Base URL for PartCategory API endpoints
|
||||||
url(r'^category/', include([
|
url(r'^category/', include([
|
||||||
url(r'^(?P<pk>\d+)/?', CategoryDetail.as_view(), name='api-part-category-detail'),
|
url(r'^(?P<pk>\d+)/?', CategoryDetail.as_view(), name='api-part-category-detail'),
|
||||||
url(r'.*^$', CategoryList.as_view(), name='api-part-category-list'),
|
url(r'^$', CategoryList.as_view(), name='api-part-category-list'),
|
||||||
])),
|
])),
|
||||||
|
|
||||||
# Base URL for PartAttachment API endpoints
|
# Base URL for PartAttachment API endpoints
|
||||||
url(r'attachment/', include([
|
url(r'attachment/', include([
|
||||||
url(r'^.*$', PartAttachmentList.as_view(), name='api-part-attachment-list'),
|
url(r'^$', PartAttachmentList.as_view(), name='api-part-attachment-list'),
|
||||||
])),
|
])),
|
||||||
|
|
||||||
# Base URL for PartStar API endpoints
|
# Base URL for PartStar API endpoints
|
||||||
url(r'^star/', include([
|
url(r'^star/', include([
|
||||||
url(r'^(?P<pk>\d+)/?', PartStarDetail.as_view(), name='api-part-star-detail'),
|
url(r'^(?P<pk>\d+)/?', PartStarDetail.as_view(), name='api-part-star-detail'),
|
||||||
url(r'^.*$', PartStarList.as_view(), name='api-part-star-list'),
|
url(r'^$', PartStarList.as_view(), name='api-part-star-list'),
|
||||||
])),
|
])),
|
||||||
|
|
||||||
# Base URL for PartParameter API endpoints
|
# Base URL for PartParameter API endpoints
|
||||||
|
Loading…
Reference in New Issue
Block a user