mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
CI unit test fixes (#3244)
* CI unit test fixes * Validate expected response depending on status of DEBUG mode * Remove tests for browsable API endpoints
This commit is contained in:
parent
782ba5693a
commit
daf019c13a
@ -28,10 +28,6 @@ class HTMLAPITests(InvenTreeTestCase):
|
||||
response = self.client.get(url, HTTP_ACCEPT='application/json')
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
# Check HTTP response
|
||||
response = self.client.get(url, HTTP_ACCEPT='text/html')
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
def test_build_api(self):
|
||||
"""Test that build list is working."""
|
||||
url = reverse('api-build-list')
|
||||
@ -40,10 +36,6 @@ class HTMLAPITests(InvenTreeTestCase):
|
||||
response = self.client.get(url, HTTP_ACCEPT='application/json')
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
# Check HTTP response
|
||||
response = self.client.get(url, HTTP_ACCEPT='text/html')
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
def test_stock_api(self):
|
||||
"""Test that stock list is working."""
|
||||
url = reverse('api-stock-list')
|
||||
@ -52,10 +44,6 @@ class HTMLAPITests(InvenTreeTestCase):
|
||||
response = self.client.get(url, HTTP_ACCEPT='application/json')
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
# Check HTTP response
|
||||
response = self.client.get(url, HTTP_ACCEPT='text/html')
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
def test_company_list(self):
|
||||
"""Test that company list is working."""
|
||||
url = reverse('api-company-list')
|
||||
@ -64,10 +52,6 @@ class HTMLAPITests(InvenTreeTestCase):
|
||||
response = self.client.get(url, HTTP_ACCEPT='application/json')
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
# Check HTTP response
|
||||
response = self.client.get(url, HTTP_ACCEPT='text/html')
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
def test_not_found(self):
|
||||
"""Test that the NotFoundView is working."""
|
||||
response = self.client.get('/api/anc')
|
||||
|
Loading…
Reference in New Issue
Block a user