diff --git a/mayan/apps/document_parsing/tests/test_models.py b/mayan/apps/document_parsing/tests/test_models.py index 906ba9c9c7..7c1d8c68d9 100644 --- a/mayan/apps/document_parsing/tests/test_models.py +++ b/mayan/apps/document_parsing/tests/test_models.py @@ -15,6 +15,7 @@ class DocumentAutoParsingTestCase(GenericDocumentTestCase): def test_disable_auto_parsing(self): self._create_document_type() self.document = self.upload_document() + with self.assertRaises(StopIteration): next(self.document.latest_version.content()) @@ -23,5 +24,5 @@ class DocumentAutoParsingTestCase(GenericDocumentTestCase): self._create_document_type() self.document = self.upload_document() self.assertTrue( - TEST_DOCUMENT_CONTENT in next(self.document.content()) + TEST_DOCUMENT_CONTENT in self.document.content ) diff --git a/mayan/apps/ocr/tests/test_views.py b/mayan/apps/ocr/tests/test_views.py index 7777f1e245..026ad158bd 100644 --- a/mayan/apps/ocr/tests/test_views.py +++ b/mayan/apps/ocr/tests/test_views.py @@ -75,9 +75,7 @@ class OCRViewsTestCase(GenericDocumentViewTestCase): def test_document_submit_view_no_permission(self): self._request_document_submit_view() - self.assertEqual( - ''.join(self.document.latest_version.ocr_content()), '' - ) + self.assertEqual(self.document.ocr_content, '') def test_document_submit_view_with_access(self): self.grant_access( @@ -85,9 +83,7 @@ class OCRViewsTestCase(GenericDocumentViewTestCase): ) self._request_document_submit_view() self.assertTrue( - TEST_DOCUMENT_CONTENT in ''.join( - self.document.latest_version.ocr_content() - ) + TEST_DOCUMENT_CONTENT in self.document.ocr_content ) def _request_multiple_document_submit_view(self): @@ -100,9 +96,7 @@ class OCRViewsTestCase(GenericDocumentViewTestCase): def test_multiple_document_submit_view_no_permission(self): self._request_multiple_document_submit_view() - self.assertEqual( - ''.join(self.document.latest_version.ocr_content()), '' - ) + self.assertEqual(self.document.ocr_content, '') def test_multiple_document_submit_view_with_access(self): self.grant_access( @@ -110,9 +104,7 @@ class OCRViewsTestCase(GenericDocumentViewTestCase): ) self._request_multiple_document_submit_view() self.assertTrue( - TEST_DOCUMENT_CONTENT in ''.join( - self.document.latest_version.ocr_content() - ) + TEST_DOCUMENT_CONTENT in self.document.ocr_content ) def _request_document_ocr_download_view(self): @@ -135,9 +127,7 @@ class OCRViewsTestCase(GenericDocumentViewTestCase): self.assertEqual(response.status_code, 200) self.assert_download_response( - response=response, content=( - ''.join(get_document_ocr_content(document=self.document)) - ), + response=response, content=self.document.ocr_content ) def _request_document_type_ocr_settings_view(self):