Tests: Remove unused override_settings
Now that the automatic OCR, parsing and file metadata processing are turned off by the test setting file, these overrides in the tests are not needed anymore. Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
from __future__ import absolute_import, unicode_literals
|
from __future__ import absolute_import, unicode_literals
|
||||||
|
|
||||||
from django.contrib.contenttypes.models import ContentType
|
from django.contrib.contenttypes.models import ContentType
|
||||||
from django.test import override_settings
|
|
||||||
|
|
||||||
from rest_framework import status
|
from rest_framework import status
|
||||||
|
|
||||||
@@ -14,7 +13,6 @@ from ..models import AccessControlList
|
|||||||
from ..permissions import permission_acl_view
|
from ..permissions import permission_acl_view
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class ACLAPITestCase(DocumentTestMixin, BaseAPITestCase):
|
class ACLAPITestCase(DocumentTestMixin, BaseAPITestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(ACLAPITestCase, self).setUp()
|
super(ACLAPITestCase, self).setUp()
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
from __future__ import absolute_import, unicode_literals
|
from __future__ import absolute_import, unicode_literals
|
||||||
|
|
||||||
from django.core.exceptions import PermissionDenied
|
from django.core.exceptions import PermissionDenied
|
||||||
from django.test import override_settings
|
|
||||||
|
|
||||||
from mayan.apps.common.tests import BaseTestCase
|
from mayan.apps.common.tests import BaseTestCase
|
||||||
from mayan.apps.documents.models import Document, DocumentType
|
from mayan.apps.documents.models import Document, DocumentType
|
||||||
@@ -14,7 +13,6 @@ from mayan.apps.documents.tests import (
|
|||||||
from ..models import AccessControlList
|
from ..models import AccessControlList
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class PermissionTestCase(BaseTestCase):
|
class PermissionTestCase(BaseTestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(PermissionTestCase, self).setUp()
|
super(PermissionTestCase, self).setUp()
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.contrib.auth import get_user_model
|
from django.contrib.auth import get_user_model
|
||||||
from django.test import override_settings
|
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
from django.utils.encoding import force_text
|
from django.utils.encoding import force_text
|
||||||
|
|
||||||
@@ -18,7 +17,6 @@ from ..models import Cabinet
|
|||||||
from .literals import TEST_CABINET_EDITED_LABEL, TEST_CABINET_LABEL
|
from .literals import TEST_CABINET_EDITED_LABEL, TEST_CABINET_LABEL
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class CabinetAPITestCase(DocumentTestMixin, APITestCase):
|
class CabinetAPITestCase(DocumentTestMixin, APITestCase):
|
||||||
"""
|
"""
|
||||||
Test the cabinet API endpoints
|
Test the cabinet API endpoints
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.core.exceptions import ValidationError
|
from django.core.exceptions import ValidationError
|
||||||
from django.test import override_settings
|
|
||||||
|
|
||||||
from mayan.apps.common.tests import BaseTestCase
|
from mayan.apps.common.tests import BaseTestCase
|
||||||
from mayan.apps.documents.tests import DocumentTestMixin
|
from mayan.apps.documents.tests import DocumentTestMixin
|
||||||
@@ -11,7 +10,6 @@ from ..models import Cabinet
|
|||||||
from .literals import TEST_CABINET_LABEL
|
from .literals import TEST_CABINET_LABEL
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class CabinetTestCase(DocumentTestMixin, BaseTestCase):
|
class CabinetTestCase(DocumentTestMixin, BaseTestCase):
|
||||||
def test_cabinet_creation(self):
|
def test_cabinet_creation(self):
|
||||||
cabinet = Cabinet.objects.create(label=TEST_CABINET_LABEL)
|
cabinet = Cabinet.objects.create(label=TEST_CABINET_LABEL)
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ from __future__ import unicode_literals
|
|||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
from django.test import override_settings
|
|
||||||
from django.utils.encoding import force_text
|
from django.utils.encoding import force_text
|
||||||
from django.utils.timezone import now
|
from django.utils.timezone import now
|
||||||
|
|
||||||
@@ -18,7 +17,6 @@ from ..permissions import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class CheckoutsAPITestCase(DocumentTestMixin, BaseAPITestCase):
|
class CheckoutsAPITestCase(DocumentTestMixin, BaseAPITestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(CheckoutsAPITestCase, self).setUp()
|
super(CheckoutsAPITestCase, self).setUp()
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import datetime
|
|||||||
import logging
|
import logging
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from django.test import override_settings
|
|
||||||
from django.utils.timezone import now
|
from django.utils.timezone import now
|
||||||
|
|
||||||
from mayan.apps.common.tests import BaseTestCase
|
from mayan.apps.common.tests import BaseTestCase
|
||||||
@@ -18,7 +17,6 @@ from ..exceptions import (
|
|||||||
from ..models import DocumentCheckout, NewVersionBlock
|
from ..models import DocumentCheckout, NewVersionBlock
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class DocumentCheckoutTestCase(DocumentTestMixin, BaseTestCase):
|
class DocumentCheckoutTestCase(DocumentTestMixin, BaseTestCase):
|
||||||
def test_document_checkout(self):
|
def test_document_checkout(self):
|
||||||
expiration_datetime = now() + datetime.timedelta(days=1)
|
expiration_datetime = now() + datetime.timedelta(days=1)
|
||||||
@@ -115,7 +113,6 @@ class DocumentCheckoutTestCase(DocumentTestMixin, BaseTestCase):
|
|||||||
self.document.new_version(file_object=file_object)
|
self.document.new_version(file_object=file_object)
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class NewVersionBlockTestCase(DocumentTestMixin, BaseTestCase):
|
class NewVersionBlockTestCase(DocumentTestMixin, BaseTestCase):
|
||||||
def test_blocking(self):
|
def test_blocking(self):
|
||||||
NewVersionBlock.objects.block(document=self.document)
|
NewVersionBlock.objects.block(document=self.document)
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.test import override_settings
|
|
||||||
|
|
||||||
from rest_framework import status
|
from rest_framework import status
|
||||||
|
|
||||||
from mayan.apps.rest_api.tests import BaseAPITestCase
|
from mayan.apps.rest_api.tests import BaseAPITestCase
|
||||||
@@ -14,7 +12,6 @@ from ..permissions import (
|
|||||||
from .literals import TEST_KEY_DATA, TEST_KEY_FINGERPRINT
|
from .literals import TEST_KEY_DATA, TEST_KEY_FINGERPRINT
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class KeyAPITestCase(BaseAPITestCase):
|
class KeyAPITestCase(BaseAPITestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(KeyAPITestCase, self).setUp()
|
super(KeyAPITestCase, self).setUp()
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.test import override_settings
|
|
||||||
|
|
||||||
from rest_framework import status
|
from rest_framework import status
|
||||||
|
|
||||||
from mayan.apps.documents.tests import DocumentTestMixin
|
from mayan.apps.documents.tests import DocumentTestMixin
|
||||||
@@ -16,7 +14,6 @@ from ..permissions import (
|
|||||||
from .literals import TEST_COMMENT_TEXT
|
from .literals import TEST_COMMENT_TEXT
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class CommentAPITestCase(DocumentTestMixin, BaseAPITestCase):
|
class CommentAPITestCase(DocumentTestMixin, BaseAPITestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(CommentAPITestCase, self).setUp()
|
super(CommentAPITestCase, self).setUp()
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.test import override_settings
|
|
||||||
from django.utils.encoding import force_text
|
from django.utils.encoding import force_text
|
||||||
|
|
||||||
from mayan.apps.common.tests import BaseTestCase
|
from mayan.apps.common.tests import BaseTestCase
|
||||||
@@ -24,7 +23,6 @@ from .literals import (
|
|||||||
from .mixins import DocumentIndexingTestMixin
|
from .mixins import DocumentIndexingTestMixin
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class IndexTestCase(DocumentIndexingTestMixin, DocumentTestMixin, BaseTestCase):
|
class IndexTestCase(DocumentIndexingTestMixin, DocumentTestMixin, BaseTestCase):
|
||||||
def test_document_description_index(self):
|
def test_document_description_index(self):
|
||||||
self._create_index()
|
self._create_index()
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ from ..permissions import permission_content_view
|
|||||||
TEST_DOCUMENT_CONTENT = 'Sample text'
|
TEST_DOCUMENT_CONTENT = 'Sample text'
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
@override_settings(DOCUMENT_PARSING_AUTO_PARSING=True)
|
@override_settings(DOCUMENT_PARSING_AUTO_PARSING=True)
|
||||||
class DocumentParsingAPITestCase(DocumentTestMixin, BaseAPITestCase):
|
class DocumentParsingAPITestCase(DocumentTestMixin, BaseAPITestCase):
|
||||||
test_document_filename = TEST_HYBRID_DOCUMENT
|
test_document_filename = TEST_HYBRID_DOCUMENT
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.test import override_settings
|
|
||||||
|
|
||||||
from mayan.apps.common.tests import BaseTestCase
|
from mayan.apps.common.tests import BaseTestCase
|
||||||
from mayan.apps.document_indexing.models import Index, IndexInstanceNode
|
from mayan.apps.document_indexing.models import Index, IndexInstanceNode
|
||||||
from mayan.apps.document_indexing.tests.literals import TEST_INDEX_LABEL
|
from mayan.apps.document_indexing.tests.literals import TEST_INDEX_LABEL
|
||||||
@@ -10,8 +8,6 @@ from mayan.apps.documents.tests import TEST_HYBRID_DOCUMENT, DocumentTestMixin
|
|||||||
from .literals import TEST_PARSING_INDEX_NODE_TEMPLATE
|
from .literals import TEST_PARSING_INDEX_NODE_TEMPLATE
|
||||||
|
|
||||||
|
|
||||||
@override_settings(DOCUMENT_PARSING_AUTO_PARSING=False)
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class ParsingIndexingTestCase(DocumentTestMixin, BaseTestCase):
|
class ParsingIndexingTestCase(DocumentTestMixin, BaseTestCase):
|
||||||
auto_upload_document = False
|
auto_upload_document = False
|
||||||
test_document_filename = TEST_HYBRID_DOCUMENT
|
test_document_filename = TEST_HYBRID_DOCUMENT
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ class DocumentAutoParsingTestCase(GenericDocumentTestCase):
|
|||||||
test_document_filename = TEST_HYBRID_DOCUMENT
|
test_document_filename = TEST_HYBRID_DOCUMENT
|
||||||
auto_create_document_type = False
|
auto_create_document_type = False
|
||||||
|
|
||||||
@override_settings(DOCUMENT_PARSING_AUTO_PARSING=False)
|
|
||||||
def test_disable_auto_parsing(self):
|
def test_disable_auto_parsing(self):
|
||||||
self._create_document_type()
|
self._create_document_type()
|
||||||
self.document = self.upload_document()
|
self.document = self.upload_document()
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.test import override_settings
|
|
||||||
|
|
||||||
from mayan.apps.common.tests import BaseTestCase
|
from mayan.apps.common.tests import BaseTestCase
|
||||||
from mayan.apps.documents.tests import TEST_HYBRID_DOCUMENT, DocumentTestMixin
|
from mayan.apps.documents.tests import TEST_HYBRID_DOCUMENT, DocumentTestMixin
|
||||||
|
|
||||||
@@ -10,7 +8,6 @@ from ..parsers import PopplerParser
|
|||||||
from .literals import TEST_DOCUMENT_CONTENT
|
from .literals import TEST_DOCUMENT_CONTENT
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class ParserTestCase(DocumentTestMixin, BaseTestCase):
|
class ParserTestCase(DocumentTestMixin, BaseTestCase):
|
||||||
test_document_filename = TEST_HYBRID_DOCUMENT
|
test_document_filename = TEST_HYBRID_DOCUMENT
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import logging
|
|||||||
import time
|
import time
|
||||||
|
|
||||||
from django.core.files import File
|
from django.core.files import File
|
||||||
from django.test import override_settings
|
|
||||||
|
|
||||||
from mayan.apps.common.tests import BaseTestCase
|
from mayan.apps.common.tests import BaseTestCase
|
||||||
from mayan.apps.django_gpg.models import Key
|
from mayan.apps.django_gpg.models import Key
|
||||||
@@ -26,7 +25,6 @@ from .literals import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class DocumentSignaturesTestCase(BaseTestCase):
|
class DocumentSignaturesTestCase(BaseTestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(DocumentSignaturesTestCase, self).setUp()
|
super(DocumentSignaturesTestCase, self).setUp()
|
||||||
@@ -254,7 +252,6 @@ class DocumentSignaturesTestCase(BaseTestCase):
|
|||||||
self.assertEqual(signature.key_id, TEST_KEY_ID)
|
self.assertEqual(signature.key_id, TEST_KEY_ID)
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class EmbeddedSignaturesTestCase(BaseTestCase):
|
class EmbeddedSignaturesTestCase(BaseTestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(EmbeddedSignaturesTestCase, self).setUp()
|
super(EmbeddedSignaturesTestCase, self).setUp()
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
from __future__ import absolute_import, unicode_literals
|
from __future__ import absolute_import, unicode_literals
|
||||||
|
|
||||||
from django.test import override_settings
|
|
||||||
|
|
||||||
from rest_framework import status
|
from rest_framework import status
|
||||||
|
|
||||||
from mayan.apps.documents.models import DocumentType
|
from mayan.apps.documents.models import DocumentType
|
||||||
@@ -28,7 +26,6 @@ from .literals import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class WorkflowAPITestCase(BaseAPITestCase):
|
class WorkflowAPITestCase(BaseAPITestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(WorkflowAPITestCase, self).setUp()
|
super(WorkflowAPITestCase, self).setUp()
|
||||||
@@ -362,7 +359,6 @@ class WorkflowAPITestCase(BaseAPITestCase):
|
|||||||
self.assertEqual(response.data['results'][0]['label'], self.workflow.label)
|
self.assertEqual(response.data['results'][0]['label'], self.workflow.label)
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class WorkflowStatesAPITestCase(BaseAPITestCase):
|
class WorkflowStatesAPITestCase(BaseAPITestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(WorkflowStatesAPITestCase, self).setUp()
|
super(WorkflowStatesAPITestCase, self).setUp()
|
||||||
@@ -538,7 +534,6 @@ class WorkflowStatesAPITestCase(BaseAPITestCase):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class WorkflowTransitionsAPITestCase(BaseAPITestCase):
|
class WorkflowTransitionsAPITestCase(BaseAPITestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(WorkflowTransitionsAPITestCase, self).setUp()
|
super(WorkflowTransitionsAPITestCase, self).setUp()
|
||||||
@@ -774,7 +769,6 @@ class WorkflowTransitionsAPITestCase(BaseAPITestCase):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class DocumentWorkflowsAPITestCase(BaseAPITestCase):
|
class DocumentWorkflowsAPITestCase(BaseAPITestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(DocumentWorkflowsAPITestCase, self).setUp()
|
super(DocumentWorkflowsAPITestCase, self).setUp()
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.test import override_settings
|
|
||||||
|
|
||||||
from mayan.apps.common.tests import BaseTestCase
|
from mayan.apps.common.tests import BaseTestCase
|
||||||
from mayan.apps.document_indexing.models import Index, IndexInstanceNode
|
from mayan.apps.document_indexing.models import Index, IndexInstanceNode
|
||||||
from mayan.apps.documents.models import DocumentType
|
from mayan.apps.documents.models import DocumentType
|
||||||
@@ -20,7 +18,6 @@ from .literals import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class DocumentStateIndexingTestCase(BaseTestCase):
|
class DocumentStateIndexingTestCase(BaseTestCase):
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
self.document_type.delete()
|
self.document_type.delete()
|
||||||
|
|||||||
@@ -1,19 +1,13 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.test import override_settings
|
|
||||||
|
|
||||||
from mayan.apps.common.tests import BaseTestCase, GenericViewTestCase
|
from mayan.apps.common.tests import BaseTestCase, GenericViewTestCase
|
||||||
|
|
||||||
from .mixins import DocumentTestMixin
|
from .mixins import DocumentTestMixin
|
||||||
|
|
||||||
|
|
||||||
@override_settings(DOCUMENT_PARSING_AUTO_PARSING=False)
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class GenericDocumentTestCase(DocumentTestMixin, BaseTestCase):
|
class GenericDocumentTestCase(DocumentTestMixin, BaseTestCase):
|
||||||
"""Base test case when testing models or classes"""
|
"""Base test case when testing models or classes"""
|
||||||
|
|
||||||
|
|
||||||
@override_settings(DOCUMENT_PARSING_AUTO_PARSING=False)
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class GenericDocumentViewTestCase(DocumentTestMixin, GenericViewTestCase):
|
class GenericDocumentViewTestCase(DocumentTestMixin, GenericViewTestCase):
|
||||||
"""Base test case when testing views"""
|
"""Base test case when testing views"""
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ from __future__ import unicode_literals
|
|||||||
|
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from django.test import override_settings
|
|
||||||
from django.utils.encoding import force_text
|
from django.utils.encoding import force_text
|
||||||
|
|
||||||
from django_downloadview import assert_download_response
|
from django_downloadview import assert_download_response
|
||||||
@@ -144,7 +143,6 @@ class DocumentTypeAPITestCase(BaseAPITestCase):
|
|||||||
self.assertEqual(DocumentType.objects.all().count(), 0)
|
self.assertEqual(DocumentType.objects.all().count(), 0)
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class DocumentAPITestCase(DocumentTestMixin, BaseAPITestCase):
|
class DocumentAPITestCase(DocumentTestMixin, BaseAPITestCase):
|
||||||
auto_upload_document = False
|
auto_upload_document = False
|
||||||
|
|
||||||
@@ -475,7 +473,6 @@ class DocumentAPITestCase(DocumentTestMixin, BaseAPITestCase):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class DocumentPageAPITestCase(DocumentTestMixin, BaseAPITestCase):
|
class DocumentPageAPITestCase(DocumentTestMixin, BaseAPITestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(DocumentPageAPITestCase, self).setUp()
|
super(DocumentPageAPITestCase, self).setUp()
|
||||||
@@ -501,7 +498,6 @@ class DocumentPageAPITestCase(DocumentTestMixin, BaseAPITestCase):
|
|||||||
self.assertEqual(response.status_code, status.HTTP_200_OK)
|
self.assertEqual(response.status_code, status.HTTP_200_OK)
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class TrashedDocumentAPITestCase(DocumentTestMixin, BaseAPITestCase):
|
class TrashedDocumentAPITestCase(DocumentTestMixin, BaseAPITestCase):
|
||||||
auto_upload_document = False
|
auto_upload_document = False
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,6 @@ from __future__ import unicode_literals
|
|||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from django.test import override_settings
|
|
||||||
|
|
||||||
from mayan.apps.common.tests import BaseTestCase
|
from mayan.apps.common.tests import BaseTestCase
|
||||||
|
|
||||||
from ..literals import STUB_EXPIRATION_INTERVAL
|
from ..literals import STUB_EXPIRATION_INTERVAL
|
||||||
@@ -23,7 +21,6 @@ from .literals import (
|
|||||||
from .mixins import DocumentTestMixin
|
from .mixins import DocumentTestMixin
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class DocumentTestCase(DocumentTestMixin, BaseTestCase):
|
class DocumentTestCase(DocumentTestMixin, BaseTestCase):
|
||||||
def test_natural_keys(self):
|
def test_natural_keys(self):
|
||||||
self.document.pages.first().generate_image()
|
self.document.pages.first().generate_image()
|
||||||
@@ -132,7 +129,6 @@ class DocumentTestCase(DocumentTestMixin, BaseTestCase):
|
|||||||
self.assertEqual(DeletedDocument.objects.count(), 0)
|
self.assertEqual(DeletedDocument.objects.count(), 0)
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class PDFCompatibilityTestCase(BaseTestCase):
|
class PDFCompatibilityTestCase(BaseTestCase):
|
||||||
def test_indirect_rotate(self):
|
def test_indirect_rotate(self):
|
||||||
self.document_type = DocumentType.objects.create(
|
self.document_type = DocumentType.objects.create(
|
||||||
@@ -149,7 +145,6 @@ class PDFCompatibilityTestCase(BaseTestCase):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class OfficeDocumentTestCase(BaseTestCase):
|
class OfficeDocumentTestCase(BaseTestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(OfficeDocumentTestCase, self).setUp()
|
super(OfficeDocumentTestCase, self).setUp()
|
||||||
@@ -179,7 +174,6 @@ class OfficeDocumentTestCase(BaseTestCase):
|
|||||||
self.assertEqual(self.document.page_count, 2)
|
self.assertEqual(self.document.page_count, 2)
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class MultiPageTiffTestCase(BaseTestCase):
|
class MultiPageTiffTestCase(BaseTestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(MultiPageTiffTestCase, self).setUp()
|
super(MultiPageTiffTestCase, self).setUp()
|
||||||
@@ -241,7 +235,6 @@ class DocumentVersionTestCase(GenericDocumentTestCase):
|
|||||||
self.assertEqual(self.document.versions.count(), 1)
|
self.assertEqual(self.document.versions.count(), 1)
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class DocumentPassthroughManagerTestCase(BaseTestCase):
|
class DocumentPassthroughManagerTestCase(BaseTestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(DocumentPassthroughManagerTestCase, self).setUp()
|
super(DocumentPassthroughManagerTestCase, self).setUp()
|
||||||
|
|||||||
@@ -1,14 +1,11 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.test import override_settings
|
|
||||||
|
|
||||||
from mayan.apps.common.tests import BaseTestCase
|
from mayan.apps.common.tests import BaseTestCase
|
||||||
from mayan.apps.documents.permissions import permission_document_view
|
from mayan.apps.documents.permissions import permission_document_view
|
||||||
from mayan.apps.documents.search import document_page_search, document_search
|
from mayan.apps.documents.search import document_page_search, document_search
|
||||||
from mayan.apps.documents.tests import DocumentTestMixin
|
from mayan.apps.documents.tests import DocumentTestMixin
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class DocumentSearchTestCase(DocumentTestMixin, BaseTestCase):
|
class DocumentSearchTestCase(DocumentTestMixin, BaseTestCase):
|
||||||
def _perform_document_page_search(self):
|
def _perform_document_page_search(self):
|
||||||
return document_page_search.search(
|
return document_page_search.search(
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.test import override_settings
|
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
|
|
||||||
from rest_framework import status
|
from rest_framework import status
|
||||||
@@ -13,7 +12,6 @@ from mayan.apps.rest_api.tests import BaseAPITestCase
|
|||||||
from ..classes import SearchModel
|
from ..classes import SearchModel
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class SearchAPITestCase(DocumentTestMixin, BaseAPITestCase):
|
class SearchAPITestCase(DocumentTestMixin, BaseAPITestCase):
|
||||||
auto_upload_document = False
|
auto_upload_document = False
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.test import override_settings
|
|
||||||
|
|
||||||
from mayan.apps.common.tests import BaseTestCase
|
from mayan.apps.common.tests import BaseTestCase
|
||||||
from mayan.apps.documents.search import document_search
|
from mayan.apps.documents.search import document_search
|
||||||
from mayan.apps.documents.tests import (
|
from mayan.apps.documents.tests import (
|
||||||
@@ -9,7 +7,6 @@ from mayan.apps.documents.tests import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class DocumentSearchTestCase(DocumentTestMixin, BaseTestCase):
|
class DocumentSearchTestCase(DocumentTestMixin, BaseTestCase):
|
||||||
auto_upload_document = False
|
auto_upload_document = False
|
||||||
test_document_filename = TEST_DOCUMENT_FILENAME
|
test_document_filename = TEST_DOCUMENT_FILENAME
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.test import override_settings
|
|
||||||
|
|
||||||
from mayan.apps.common.tests import GenericViewTestCase
|
from mayan.apps.common.tests import GenericViewTestCase
|
||||||
from mayan.apps.documents.models import DocumentType
|
from mayan.apps.documents.models import DocumentType
|
||||||
from mayan.apps.documents.search import document_search
|
from mayan.apps.documents.search import document_search
|
||||||
@@ -10,7 +8,6 @@ from mayan.apps.documents.tests import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class Issue46TestCase(GenericViewTestCase):
|
class Issue46TestCase(GenericViewTestCase):
|
||||||
"""
|
"""
|
||||||
Functional tests to make sure issue 46 is fixed
|
Functional tests to make sure issue 46 is fixed
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.test import override_settings
|
|
||||||
|
|
||||||
from rest_framework import status
|
from rest_framework import status
|
||||||
|
|
||||||
from mayan.apps.documents.models import DocumentType
|
from mayan.apps.documents.models import DocumentType
|
||||||
@@ -27,7 +25,6 @@ from .literals import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class SmartLinkAPITestCase(DocumentTestMixin, BaseAPITestCase):
|
class SmartLinkAPITestCase(DocumentTestMixin, BaseAPITestCase):
|
||||||
auto_create_document_type = False
|
auto_create_document_type = False
|
||||||
auto_upload_document = False
|
auto_upload_document = False
|
||||||
@@ -190,7 +187,6 @@ class SmartLinkAPITestCase(DocumentTestMixin, BaseAPITestCase):
|
|||||||
self.assertEqual(self.smart_link.label, TEST_SMART_LINK_LABEL_EDITED)
|
self.assertEqual(self.smart_link.label, TEST_SMART_LINK_LABEL_EDITED)
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class SmartLinkConditionAPITestCase(BaseAPITestCase):
|
class SmartLinkConditionAPITestCase(BaseAPITestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(SmartLinkConditionAPITestCase, self).setUp()
|
super(SmartLinkConditionAPITestCase, self).setUp()
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.test import override_settings
|
|
||||||
|
|
||||||
from mayan.apps.documents.tests import GenericDocumentTestCase
|
from mayan.apps.documents.tests import GenericDocumentTestCase
|
||||||
|
|
||||||
from ..models import SmartLink
|
from ..models import SmartLink
|
||||||
@@ -9,7 +7,6 @@ from ..models import SmartLink
|
|||||||
from .literals import TEST_SMART_LINK_DYNAMIC_LABEL, TEST_SMART_LINK_LABEL
|
from .literals import TEST_SMART_LINK_DYNAMIC_LABEL, TEST_SMART_LINK_LABEL
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class SmartLinkTestCase(GenericDocumentTestCase):
|
class SmartLinkTestCase(GenericDocumentTestCase):
|
||||||
def test_dynamic_label(self):
|
def test_dynamic_label(self):
|
||||||
smart_link = SmartLink.objects.create(
|
smart_link = SmartLink.objects.create(
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.test import override_settings
|
|
||||||
|
|
||||||
from rest_framework import status
|
from rest_framework import status
|
||||||
|
|
||||||
from mayan.apps.documents.models import DocumentType
|
from mayan.apps.documents.models import DocumentType
|
||||||
@@ -337,7 +335,6 @@ class DocumentTypeMetadataTypeAPITestCase(BaseAPITestCase):
|
|||||||
|
|
||||||
|
|
||||||
class DocumentMetadataAPITestCase(BaseAPITestCase):
|
class DocumentMetadataAPITestCase(BaseAPITestCase):
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(DocumentMetadataAPITestCase, self).setUp()
|
super(DocumentMetadataAPITestCase, self).setUp()
|
||||||
self.login_user()
|
self.login_user()
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.core.exceptions import ValidationError
|
from django.core.exceptions import ValidationError
|
||||||
from django.test import override_settings
|
|
||||||
|
|
||||||
from mayan.apps.common.tests import BaseTestCase
|
from mayan.apps.common.tests import BaseTestCase
|
||||||
from mayan.apps.documents.models import DocumentType
|
from mayan.apps.documents.models import DocumentType
|
||||||
@@ -18,7 +17,6 @@ from .literals import (
|
|||||||
from .mixins import MetadataTypeTestMixin
|
from .mixins import MetadataTypeTestMixin
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class MetadataTestCase(DocumentTestMixin, MetadataTypeTestMixin, BaseTestCase):
|
class MetadataTestCase(DocumentTestMixin, MetadataTypeTestMixin, BaseTestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(MetadataTestCase, self).setUp()
|
super(MetadataTestCase, self).setUp()
|
||||||
|
|||||||
@@ -4,8 +4,6 @@ import hashlib
|
|||||||
|
|
||||||
from fuse import FuseOSError
|
from fuse import FuseOSError
|
||||||
|
|
||||||
from django.test import override_settings
|
|
||||||
|
|
||||||
from mayan.apps.common.tests import BaseTestCase
|
from mayan.apps.common.tests import BaseTestCase
|
||||||
from mayan.apps.documents.models import Document
|
from mayan.apps.documents.models import Document
|
||||||
from mayan.apps.documents.tests import DocumentTestMixin
|
from mayan.apps.documents.tests import DocumentTestMixin
|
||||||
@@ -20,7 +18,6 @@ from .literals import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class IndexFilesystemTestCase(DocumentIndexingTestMixin, DocumentTestMixin, BaseTestCase):
|
class IndexFilesystemTestCase(DocumentIndexingTestMixin, DocumentTestMixin, BaseTestCase):
|
||||||
auto_upload_document = False
|
auto_upload_document = False
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.test import override_settings
|
|
||||||
|
|
||||||
from rest_framework import status
|
from rest_framework import status
|
||||||
|
|
||||||
from mayan.apps.rest_api.tests import BaseAPITestCase
|
from mayan.apps.rest_api.tests import BaseAPITestCase
|
||||||
@@ -17,7 +15,6 @@ from .literals import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class MOTDAPITestCase(BaseAPITestCase):
|
class MOTDAPITestCase(BaseAPITestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(MOTDAPITestCase, self).setUp()
|
super(MOTDAPITestCase, self).setUp()
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.test import override_settings
|
|
||||||
|
|
||||||
from rest_framework import status
|
from rest_framework import status
|
||||||
|
|
||||||
from mayan.apps.documents.tests import DocumentTestMixin
|
from mayan.apps.documents.tests import DocumentTestMixin
|
||||||
@@ -14,8 +12,6 @@ from ..permissions import (
|
|||||||
TEST_DOCUMENT_CONTENT = 'Mayan EDMS Documentation'
|
TEST_DOCUMENT_CONTENT = 'Mayan EDMS Documentation'
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
@override_settings(DOCUMENT_PARSING_AUTO_PARSING=False)
|
|
||||||
class OCRAPITestCase(DocumentTestMixin, BaseAPITestCase):
|
class OCRAPITestCase(DocumentTestMixin, BaseAPITestCase):
|
||||||
"""
|
"""
|
||||||
Test the OCR app API endpoints
|
Test the OCR app API endpoints
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.test import override_settings
|
|
||||||
|
|
||||||
from mayan.apps.common.tests import BaseTestCase
|
from mayan.apps.common.tests import BaseTestCase
|
||||||
from mayan.apps.documents.tests import DocumentTestMixin
|
from mayan.apps.documents.tests import DocumentTestMixin
|
||||||
from mayan.apps.document_indexing.models import Index, IndexInstanceNode
|
from mayan.apps.document_indexing.models import Index, IndexInstanceNode
|
||||||
@@ -12,7 +10,6 @@ from .literals import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class OCRIndexingTestCase(DocumentTestMixin, BaseTestCase):
|
class OCRIndexingTestCase(DocumentTestMixin, BaseTestCase):
|
||||||
auto_upload_document = False
|
auto_upload_document = False
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import shutil
|
|||||||
import mock
|
import mock
|
||||||
from pathlib2 import Path
|
from pathlib2 import Path
|
||||||
|
|
||||||
from django.test import override_settings
|
|
||||||
from django.utils.encoding import force_text
|
from django.utils.encoding import force_text
|
||||||
|
|
||||||
from mayan.apps.common.tests import BaseTestCase
|
from mayan.apps.common.tests import BaseTestCase
|
||||||
@@ -32,7 +31,6 @@ from .literals import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class CompressedUploadsTestCase(BaseTestCase):
|
class CompressedUploadsTestCase(BaseTestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(CompressedUploadsTestCase, self).setUp()
|
super(CompressedUploadsTestCase, self).setUp()
|
||||||
@@ -69,7 +67,6 @@ class CompressedUploadsTestCase(BaseTestCase):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class EmailFilenameDecodingTestCase(BaseTestCase):
|
class EmailFilenameDecodingTestCase(BaseTestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(EmailFilenameDecodingTestCase, self).setUp()
|
super(EmailFilenameDecodingTestCase, self).setUp()
|
||||||
@@ -196,7 +193,6 @@ class EmailFilenameDecodingTestCase(BaseTestCase):
|
|||||||
self.assertEqual(3, Document.objects.count())
|
self.assertEqual(3, Document.objects.count())
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class POP3SourceTestCase(BaseTestCase):
|
class POP3SourceTestCase(BaseTestCase):
|
||||||
class MockMailbox(object):
|
class MockMailbox(object):
|
||||||
def dele(self, which):
|
def dele(self, which):
|
||||||
@@ -246,7 +242,6 @@ class POP3SourceTestCase(BaseTestCase):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class WatchFolderTestCase(DocumentTestMixin, BaseTestCase):
|
class WatchFolderTestCase(DocumentTestMixin, BaseTestCase):
|
||||||
auto_upload_document = False
|
auto_upload_document = False
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.test import override_settings
|
|
||||||
from django.utils.encoding import force_text
|
from django.utils.encoding import force_text
|
||||||
|
|
||||||
from rest_framework import status
|
from rest_framework import status
|
||||||
@@ -21,7 +20,6 @@ from .literals import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class TagAPITestCase(DocumentTestMixin, BaseAPITestCase):
|
class TagAPITestCase(DocumentTestMixin, BaseAPITestCase):
|
||||||
auto_upload_document = False
|
auto_upload_document = False
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.test import override_settings
|
|
||||||
|
|
||||||
from mayan.apps.common.tests import BaseTestCase
|
from mayan.apps.common.tests import BaseTestCase
|
||||||
from mayan.apps.documents.tests import DocumentTestMixin
|
from mayan.apps.documents.tests import DocumentTestMixin
|
||||||
from mayan.apps.document_indexing.models import Index, IndexInstanceNode
|
from mayan.apps.document_indexing.models import Index, IndexInstanceNode
|
||||||
@@ -15,7 +13,6 @@ from .literals import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class TagSignalIndexingTestCase(DocumentTestMixin, BaseTestCase):
|
class TagSignalIndexingTestCase(DocumentTestMixin, BaseTestCase):
|
||||||
auto_upload_document = False
|
auto_upload_document = False
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.test import override_settings
|
|
||||||
|
|
||||||
from mayan.apps.common.tests import BaseTestCase
|
from mayan.apps.common.tests import BaseTestCase
|
||||||
from mayan.apps.documents.tests import DocumentTestMixin
|
from mayan.apps.documents.tests import DocumentTestMixin
|
||||||
|
|
||||||
@@ -10,7 +8,6 @@ from ..models import Tag
|
|||||||
from .literals import TEST_TAG_COLOR, TEST_TAG_LABEL
|
from .literals import TEST_TAG_COLOR, TEST_TAG_LABEL
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
|
||||||
class TagTestCase(DocumentTestMixin, BaseTestCase):
|
class TagTestCase(DocumentTestMixin, BaseTestCase):
|
||||||
auto_upload_document = False
|
auto_upload_document = False
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user