From b28281be5a0e850c0bbcea1701727d7f1a178c6f Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Fri, 14 Dec 2018 02:24:56 -0400 Subject: [PATCH] Tests: Turn on parsing and OCR The base test file now turns off OCR, parsing and file metadata processing. Apps that rely on those must now turn them on explicitly. Signed-off-by: Roberto Rosario --- mayan/apps/document_parsing/tests/test_api.py | 1 + mayan/apps/ocr/tests/test_models.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/mayan/apps/document_parsing/tests/test_api.py b/mayan/apps/document_parsing/tests/test_api.py index d1d1e155c7..66a109e261 100644 --- a/mayan/apps/document_parsing/tests/test_api.py +++ b/mayan/apps/document_parsing/tests/test_api.py @@ -13,6 +13,7 @@ TEST_DOCUMENT_CONTENT = 'Sample text' @override_settings(OCR_AUTO_OCR=False) +@override_settings(DOCUMENT_PARSING_AUTO_PARSING=True) class DocumentParsingAPITestCase(DocumentTestMixin, BaseAPITestCase): test_document_filename = TEST_HYBRID_DOCUMENT diff --git a/mayan/apps/ocr/tests/test_models.py b/mayan/apps/ocr/tests/test_models.py index 324ce44d61..4bc8add466 100644 --- a/mayan/apps/ocr/tests/test_models.py +++ b/mayan/apps/ocr/tests/test_models.py @@ -2,6 +2,8 @@ from __future__ import unicode_literals +from django.test import override_settings + from mayan.apps.common.tests import BaseTestCase from mayan.apps.documents.models import DocumentType from mayan.apps.documents.runtime import language_choices @@ -14,6 +16,7 @@ TEST_DOCUMENT_CONTENT_DEU_1 = 'Repository für elektronische Dokumente.' TEST_DOCUMENT_CONTENT_DEU_2 = 'Es bietet einen' +@override_settings(OCR_AUTO_OCR=True) class DocumentOCRTestCase(DocumentTestMixin, BaseTestCase): # PyOCR's leak descriptor in get_available_languages and image_to_string # Disable descriptor leak test until fixed in upstream @@ -24,6 +27,7 @@ class DocumentOCRTestCase(DocumentTestMixin, BaseTestCase): self.assertTrue(TEST_DOCUMENT_CONTENT in content) +@override_settings(OCR_AUTO_OCR=True) class GermanOCRSupportTestCase(BaseTestCase): # PyOCR's leak descriptor in get_available_languages and image_to_string # Disable descriptor leak test until fixed in upstream