API updates
- Move all generic API classes definitions to the rest_api.generics module. - Update API status code on insufficient access for the apps: indexes, parsing, documents, metadata, ocr, permission, user management. - Update API tests. Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
This commit is contained in:
@@ -69,7 +69,7 @@ class DocumentIndexingAPITestCase(
|
||||
self._create_test_index()
|
||||
|
||||
response = self._request_test_index_delete_api_view()
|
||||
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
|
||||
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
|
||||
|
||||
self.assertTrue(self.test_index in Index.objects.all())
|
||||
|
||||
@@ -90,7 +90,7 @@ class DocumentIndexingAPITestCase(
|
||||
|
||||
response = self._request_test_index_detail_api_view()
|
||||
|
||||
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
|
||||
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
|
||||
self.assertTrue('id' not in response.data)
|
||||
|
||||
def test_index_detail_api_view_with_access(self):
|
||||
|
||||
Reference in New Issue
Block a user