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:
Roberto Rosario
2019-10-28 00:01:11 -04:00
parent c79a974746
commit deb363ee16
31 changed files with 232 additions and 244 deletions

View File

@@ -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):