OCR: Add 'ocr_content' attribute

Add the 'ocr_content' attribute to documents to allow access
to a document's OCR content for indexing and other purposes.

Fixes the OCR indexing failing test.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2018-11-27 05:20:31 -04:00
parent 0f5625a356
commit aaf9f7a8be
5 changed files with 20 additions and 10 deletions
-4
View File
@@ -33,7 +33,6 @@ class OCRAPITestCase(DocumentTestMixin, BaseAPITestCase):
def test_submit_document_no_access(self):
response = self._request_document_ocr_submit_view()
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
self.assertFalse(hasattr(self.document.pages.first(), 'ocr_content'))
def test_submit_document_with_access(self):
@@ -42,7 +41,6 @@ class OCRAPITestCase(DocumentTestMixin, BaseAPITestCase):
)
response = self._request_document_ocr_submit_view()
self.assertEqual(response.status_code, status.HTTP_202_ACCEPTED)
self.assertTrue(hasattr(self.document.pages.first(), 'ocr_content'))
def _request_document_version_ocr_submit_view(self):
@@ -54,7 +52,6 @@ class OCRAPITestCase(DocumentTestMixin, BaseAPITestCase):
def test_submit_document_version_no_access(self):
response = self._request_document_version_ocr_submit_view()
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
self.assertFalse(hasattr(self.document.pages.first(), 'ocr_content'))
def test_submit_document_version_with_access(self):
@@ -63,7 +60,6 @@ class OCRAPITestCase(DocumentTestMixin, BaseAPITestCase):
)
response = self._request_document_version_ocr_submit_view()
self.assertEqual(response.status_code, status.HTTP_202_ACCEPTED)
self.assertTrue(hasattr(self.document.pages.first(), 'ocr_content'))
def _request_document_page_content_view(self):