diff --git a/mayan/apps/acls/tests/test_api.py b/mayan/apps/acls/tests/test_api.py index 5292414fd1..81dfe34c24 100644 --- a/mayan/apps/acls/tests/test_api.py +++ b/mayan/apps/acls/tests/test_api.py @@ -3,7 +3,7 @@ from __future__ import absolute_import, unicode_literals from rest_framework import status from mayan.apps.permissions.tests.literals import TEST_ROLE_LABEL -from mayan.apps.rest_api.tests import BaseAPITestCase +from mayan.apps.rest_api.tests.base import BaseAPITestCase from ..models import AccessControlList from ..permissions import permission_acl_edit, permission_acl_view diff --git a/mayan/apps/acls/tests/test_classes.py b/mayan/apps/acls/tests/test_classes.py index f1ab062709..5b75d2916b 100644 --- a/mayan/apps/acls/tests/test_classes.py +++ b/mayan/apps/acls/tests/test_classes.py @@ -1,6 +1,6 @@ from __future__ import absolute_import, unicode_literals -from mayan.apps.common.tests import BaseTestCase +from mayan.apps.common.tests.base import BaseTestCase from ..classes import ModelPermission diff --git a/mayan/apps/acls/tests/test_links.py b/mayan/apps/acls/tests/test_links.py index fd45f8f253..ae6926acff 100644 --- a/mayan/apps/acls/tests/test_links.py +++ b/mayan/apps/acls/tests/test_links.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals from django.urls import reverse -from mayan.apps.common.tests import GenericViewTestCase +from mayan.apps.common.tests.base import GenericViewTestCase from ..links import ( link_acl_delete, link_acl_list, link_acl_create, link_acl_permissions diff --git a/mayan/apps/acls/tests/test_models.py b/mayan/apps/acls/tests/test_models.py index 7b60c1bbdd..a420039045 100644 --- a/mayan/apps/acls/tests/test_models.py +++ b/mayan/apps/acls/tests/test_models.py @@ -3,7 +3,7 @@ from __future__ import absolute_import, unicode_literals from django.core.exceptions import PermissionDenied from django.db import models -from mayan.apps.common.tests import BaseTestCase +from mayan.apps.common.tests.base import BaseTestCase from ..classes import ModelPermission from ..models import AccessControlList diff --git a/mayan/apps/acls/tests/test_views.py b/mayan/apps/acls/tests/test_views.py index e338a99109..72b3a7d19c 100644 --- a/mayan/apps/acls/tests/test_views.py +++ b/mayan/apps/acls/tests/test_views.py @@ -1,6 +1,6 @@ from __future__ import absolute_import, unicode_literals -from mayan.apps.common.tests import GenericViewTestCase +from mayan.apps.common.tests.base import GenericViewTestCase from ..models import AccessControlList from ..permissions import permission_acl_edit, permission_acl_view diff --git a/mayan/apps/acls/workflow_actions.py b/mayan/apps/acls/workflow_actions.py index da916aa780..ee0e1638a7 100644 --- a/mayan/apps/acls/workflow_actions.py +++ b/mayan/apps/acls/workflow_actions.py @@ -16,7 +16,6 @@ from mayan.apps.permissions.models import Role from .classes import ModelPermission from .permissions import permission_acl_edit -__all__ = ('GrantAccessAction', 'RevokeAccessAction') logger = logging.getLogger(__name__) @@ -57,7 +56,7 @@ class GrantAccessAction(WorkflowAction): } } field_order = ('content_type', 'object_id', 'roles', 'permissions') - label = _('Grant access') + label = _('Grant object access') widgets = { 'content_type': { 'class': 'django.forms.widgets.Select', 'kwargs': { @@ -140,7 +139,7 @@ class GrantAccessAction(WorkflowAction): class RevokeAccessAction(GrantAccessAction): - label = _('Revoke access') + label = _('Revoke object access') def execute(self, context): self.get_execute_data() diff --git a/mayan/apps/authentication/tests/test_views.py b/mayan/apps/authentication/tests/test_views.py index f0c02e9c04..841bdee3ee 100644 --- a/mayan/apps/authentication/tests/test_views.py +++ b/mayan/apps/authentication/tests/test_views.py @@ -11,7 +11,7 @@ from django.test import override_settings from django.urls import reverse from django.utils.http import urlunquote_plus -from mayan.apps.common.tests import GenericViewTestCase +from mayan.apps.common.tests.base import GenericViewTestCase from mayan.apps.smart_settings.classes import Namespace from mayan.apps.user_management.permissions import permission_user_edit from mayan.apps.user_management.tests.literals import TEST_USER_PASSWORD_EDITED diff --git a/mayan/apps/autoadmin/tests/test_management_commands.py b/mayan/apps/autoadmin/tests/test_management_commands.py index 9de71acd1f..e746b20de5 100644 --- a/mayan/apps/autoadmin/tests/test_management_commands.py +++ b/mayan/apps/autoadmin/tests/test_management_commands.py @@ -2,20 +2,22 @@ from __future__ import unicode_literals from django.contrib.auth import get_user_model from django.core import management -from django.test import TestCase +from mayan.apps.common.tests.base import BaseTestCase from mayan.apps.common.tests.utils import mute_stdout from ..models import AutoAdminSingleton -class AutoAdminManagementCommandTestCase(TestCase): +class AutoAdminManagementCommandTestCase(BaseTestCase): def setUp(self): + super(AutoAdminManagementCommandTestCase, self).setUp() with mute_stdout(): management.call_command('createautoadmin') def tearDown(self): AutoAdminSingleton.objects.all().delete() + super(AutoAdminManagementCommandTestCase, self).tearDown() def test_autoadmin_creation(self): autoadmin = AutoAdminSingleton.objects.get() diff --git a/mayan/apps/autoadmin/tests/test_models.py b/mayan/apps/autoadmin/tests/test_models.py index f45f5ede31..b1f74ccef7 100644 --- a/mayan/apps/autoadmin/tests/test_models.py +++ b/mayan/apps/autoadmin/tests/test_models.py @@ -2,8 +2,7 @@ from __future__ import unicode_literals import logging -from django.test import TestCase - +from mayan.apps.common.tests.base import BaseTestCase from mayan.apps.common.tests.utils import mute_stdout from ..models import AutoAdminSingleton @@ -12,7 +11,7 @@ from ..settings import setting_username from .literals import TEST_ADMIN_USER_PASSWORD -class AutoAdminHandlerTestCase(TestCase): +class AutoAdminHandlerTestCase(BaseTestCase): def test_post_admin_creation(self): logging.disable(logging.INFO) diff --git a/mayan/apps/autoadmin/tests/test_views.py b/mayan/apps/autoadmin/tests/test_views.py index a5a90aa977..5d49ec3eef 100644 --- a/mayan/apps/autoadmin/tests/test_views.py +++ b/mayan/apps/autoadmin/tests/test_views.py @@ -1,7 +1,7 @@ from __future__ import unicode_literals from mayan.apps.common.settings import setting_home_view -from mayan.apps.common.tests import GenericViewTestCase +from mayan.apps.common.tests.base import GenericViewTestCase from mayan.apps.common.tests.utils import mute_stdout from ..models import AutoAdminSingleton diff --git a/mayan/apps/cabinets/tests/test_api.py b/mayan/apps/cabinets/tests/test_api.py index 4fe870c221..8e71ce2e0e 100644 --- a/mayan/apps/cabinets/tests/test_api.py +++ b/mayan/apps/cabinets/tests/test_api.py @@ -5,8 +5,8 @@ from django.utils.encoding import force_text from rest_framework import status from mayan.apps.documents.permissions import permission_document_view -from mayan.apps.documents.tests import DocumentTestMixin -from mayan.apps.rest_api.tests import BaseAPITestCase +from mayan.apps.documents.tests.mixins import DocumentTestMixin +from mayan.apps.rest_api.tests.base import BaseAPITestCase from ..models import Cabinet from ..permissions import ( diff --git a/mayan/apps/cabinets/tests/test_events.py b/mayan/apps/cabinets/tests/test_events.py index a0a7961deb..f29eaf511c 100644 --- a/mayan/apps/cabinets/tests/test_events.py +++ b/mayan/apps/cabinets/tests/test_events.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals from actstream.models import Action -from mayan.apps.common.tests import GenericViewTestCase +from mayan.apps.common.tests.base import GenericViewTestCase from mayan.apps.documents.tests.test_models import GenericDocumentTestCase from ..events import ( diff --git a/mayan/apps/cabinets/tests/test_models.py b/mayan/apps/cabinets/tests/test_models.py index 51305515ab..b18b3eb93f 100644 --- a/mayan/apps/cabinets/tests/test_models.py +++ b/mayan/apps/cabinets/tests/test_models.py @@ -2,8 +2,8 @@ from __future__ import unicode_literals from django.core.exceptions import ValidationError -from mayan.apps.common.tests import BaseTestCase -from mayan.apps.documents.tests import DocumentTestMixin +from mayan.apps.common.tests.base import BaseTestCase +from mayan.apps.documents.tests.mixins import DocumentTestMixin from ..models import Cabinet diff --git a/mayan/apps/cabinets/tests/test_views.py b/mayan/apps/cabinets/tests/test_views.py index 894a01d3eb..44bf735705 100644 --- a/mayan/apps/cabinets/tests/test_views.py +++ b/mayan/apps/cabinets/tests/test_views.py @@ -1,8 +1,8 @@ from __future__ import absolute_import, unicode_literals -from mayan.apps.common.tests import GenericViewTestCase +from mayan.apps.common.tests.base import GenericViewTestCase from mayan.apps.documents.permissions import permission_document_view -from mayan.apps.documents.tests import GenericDocumentViewTestCase +from mayan.apps.documents.tests.base import GenericDocumentViewTestCase from ..models import Cabinet from ..permissions import ( diff --git a/mayan/apps/cabinets/tests/test_wizard_steps.py b/mayan/apps/cabinets/tests/test_wizard_steps.py index bcdc7f30ce..84f7fabd82 100644 --- a/mayan/apps/cabinets/tests/test_wizard_steps.py +++ b/mayan/apps/cabinets/tests/test_wizard_steps.py @@ -2,9 +2,8 @@ from __future__ import unicode_literals from mayan.apps.documents.models import Document from mayan.apps.documents.permissions import permission_document_create -from mayan.apps.documents.tests import ( - GenericDocumentViewTestCase, TEST_SMALL_DOCUMENT_PATH, -) +from mayan.apps.documents.tests.base import GenericDocumentViewTestCase +from mayan.apps.documents.tests.literals import TEST_SMALL_DOCUMENT_PATH from mayan.apps.sources.models import WebFormSource from mayan.apps.sources.tests.literals import ( TEST_SOURCE_LABEL, TEST_SOURCE_UNCOMPRESS_N diff --git a/mayan/apps/checkouts/tests/mixins.py b/mayan/apps/checkouts/tests/mixins.py index 918c34e78a..5fca8e56a0 100644 --- a/mayan/apps/checkouts/tests/mixins.py +++ b/mayan/apps/checkouts/tests/mixins.py @@ -72,13 +72,6 @@ class DocumentCheckoutViewTestMixin(object): } ) - def _request_test_document_check_out_detail_view(self): - return self.get( - viewname='checkouts:check_out_info', kwargs={ - 'pk': self.test_document.pk - } - ) - def _request_test_document_check_out_view(self): return self.post( viewname='checkouts:check_out_document', kwargs={ @@ -109,6 +102,3 @@ class DocumentCheckoutViewTestMixin(object): def _request_test_document_check_out_list_view(self): return self.get(viewname='checkouts:check_out_list') - - def _request_test_document_check_out_list_view(self): - return self.get(viewname='checkouts:check_out_list') diff --git a/mayan/apps/checkouts/tests/test_api.py b/mayan/apps/checkouts/tests/test_api.py index ad475f5c4d..9266f6398e 100644 --- a/mayan/apps/checkouts/tests/test_api.py +++ b/mayan/apps/checkouts/tests/test_api.py @@ -4,9 +4,9 @@ from django.utils.encoding import force_text from rest_framework import status -from mayan.apps.documents.tests import DocumentTestMixin from mayan.apps.documents.permissions import permission_document_view -from mayan.apps.rest_api.tests import BaseAPITestCase +from mayan.apps.documents.tests.mixins import DocumentTestMixin +from mayan.apps.rest_api.tests.base import BaseAPITestCase from ..models import DocumentCheckout from ..permissions import ( diff --git a/mayan/apps/checkouts/tests/test_links.py b/mayan/apps/checkouts/tests/test_links.py index 1debe57e29..1fd88ad8aa 100644 --- a/mayan/apps/checkouts/tests/test_links.py +++ b/mayan/apps/checkouts/tests/test_links.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals -from mayan.apps.documents.tests import GenericDocumentViewTestCase +from mayan.apps.documents.tests.base import GenericDocumentViewTestCase from ..links import link_check_out_document, link_check_out_info from ..permissions import ( diff --git a/mayan/apps/checkouts/tests/test_models.py b/mayan/apps/checkouts/tests/test_models.py index c19dc74661..b449c654ac 100644 --- a/mayan/apps/checkouts/tests/test_models.py +++ b/mayan/apps/checkouts/tests/test_models.py @@ -2,11 +2,10 @@ from __future__ import unicode_literals import time -from mayan.apps.common.tests import BaseTestCase -from mayan.apps.documents.tests import ( - GenericDocumentTestCase, DocumentTestMixin -) +from mayan.apps.common.tests.base import BaseTestCase +from mayan.apps.documents.tests.base import GenericDocumentTestCase from mayan.apps.documents.tests.literals import TEST_SMALL_DOCUMENT_PATH +from mayan.apps.documents.tests.mixins import DocumentTestMixin from ..exceptions import ( DocumentAlreadyCheckedOut, DocumentNotCheckedOut, diff --git a/mayan/apps/checkouts/tests/test_views.py b/mayan/apps/checkouts/tests/test_views.py index 4c111616e0..128e1643e0 100644 --- a/mayan/apps/checkouts/tests/test_views.py +++ b/mayan/apps/checkouts/tests/test_views.py @@ -1,7 +1,7 @@ from __future__ import unicode_literals from mayan.apps.documents.permissions import permission_document_view -from mayan.apps.documents.tests import GenericDocumentViewTestCase +from mayan.apps.documents.tests.base import GenericDocumentViewTestCase from mayan.apps.sources.links import link_document_version_upload from ..literals import STATE_CHECKED_OUT, STATE_LABELS diff --git a/mayan/apps/common/tests/__init__.py b/mayan/apps/common/tests/__init__.py index 94b5479a25..e69de29bb2 100644 --- a/mayan/apps/common/tests/__init__.py +++ b/mayan/apps/common/tests/__init__.py @@ -1,2 +0,0 @@ -from .base import BaseTestCase, GenericViewTestCase # NOQA -from .decorators import skip_file_descriptor_check # NOQA diff --git a/mayan/apps/common/tests/test_api.py b/mayan/apps/common/tests/test_api.py index 8484f565b4..8c5ae7a0aa 100644 --- a/mayan/apps/common/tests/test_api.py +++ b/mayan/apps/common/tests/test_api.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals from django.test import override_settings -from mayan.apps.rest_api.tests import BaseAPITestCase +from mayan.apps.rest_api.tests.base import BaseAPITestCase from ..classes import Template diff --git a/mayan/apps/common/tests/test_compressed_files.py b/mayan/apps/common/tests/test_compressed_files.py index 30e1634d87..48c73c5b83 100644 --- a/mayan/apps/common/tests/test_compressed_files.py +++ b/mayan/apps/common/tests/test_compressed_files.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals -from mayan.apps.common.tests import BaseTestCase +from mayan.apps.common.tests.base import BaseTestCase from ..compressed_files import Archive, TarArchive, ZipArchive diff --git a/mayan/apps/common/tests/utils.py b/mayan/apps/common/tests/utils.py index ccbc577be5..e1bb72f4b8 100644 --- a/mayan/apps/common/tests/utils.py +++ b/mayan/apps/common/tests/utils.py @@ -23,9 +23,3 @@ def mute_stdout(): sys.stdout = NullFile() yield sys.stdout = stdout_old - - -def as_id_list(items): - return ','.join( - [force_text(item.pk) for item in items] - ) diff --git a/mayan/apps/converter/tests/test_transformations.py b/mayan/apps/converter/tests/test_transformations.py index 97e7e79f73..80c5b49509 100644 --- a/mayan/apps/converter/tests/test_transformations.py +++ b/mayan/apps/converter/tests/test_transformations.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals from django.test import TestCase -from mayan.apps.documents.tests import GenericDocumentTestCase +from mayan.apps.documents.tests.base import GenericDocumentTestCase from ..transformations import ( BaseTransformation, TransformationCrop, TransformationLineArt, diff --git a/mayan/apps/converter/tests/test_views.py b/mayan/apps/converter/tests/test_views.py index 745ca13669..c07152b47e 100644 --- a/mayan/apps/converter/tests/test_views.py +++ b/mayan/apps/converter/tests/test_views.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals -from mayan.apps.documents.tests import GenericDocumentViewTestCase +from mayan.apps.documents.tests.base import GenericDocumentViewTestCase from ..models import LayerTransformation diff --git a/mayan/apps/dependencies/tests/test_classes.py b/mayan/apps/dependencies/tests/test_classes.py index dbc9f6ff87..e786979f5d 100644 --- a/mayan/apps/dependencies/tests/test_classes.py +++ b/mayan/apps/dependencies/tests/test_classes.py @@ -3,7 +3,7 @@ from __future__ import print_function, unicode_literals from pathlib2 import Path import shutil -from mayan.apps.common.tests import BaseTestCase +from mayan.apps.common.tests.base import BaseTestCase from mayan.apps.storage.utils import mkdtemp from ..classes import Dependency, Provider diff --git a/mayan/apps/django_gpg/tests/test_api.py b/mayan/apps/django_gpg/tests/test_api.py index 199d8e6868..69bcfd2a82 100644 --- a/mayan/apps/django_gpg/tests/test_api.py +++ b/mayan/apps/django_gpg/tests/test_api.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals from rest_framework import status -from mayan.apps.rest_api.tests import BaseAPITestCase +from mayan.apps.rest_api.tests.base import BaseAPITestCase from ..models import Key from ..permissions import ( diff --git a/mayan/apps/django_gpg/tests/test_models.py b/mayan/apps/django_gpg/tests/test_models.py index 5b805e5468..3e03ab8ee8 100644 --- a/mayan/apps/django_gpg/tests/test_models.py +++ b/mayan/apps/django_gpg/tests/test_models.py @@ -7,7 +7,7 @@ import mock from django.utils.encoding import force_bytes -from mayan.apps.common.tests import BaseTestCase +from mayan.apps.common.tests.base import BaseTestCase from mayan.apps.storage.utils import TemporaryFile from ..exceptions import ( diff --git a/mayan/apps/django_gpg/tests/test_views.py b/mayan/apps/django_gpg/tests/test_views.py index c12eea22de..8916f302e5 100644 --- a/mayan/apps/django_gpg/tests/test_views.py +++ b/mayan/apps/django_gpg/tests/test_views.py @@ -2,7 +2,7 @@ from __future__ import absolute_import, unicode_literals from django_downloadview.test import assert_download_response -from mayan.apps.common.tests import GenericViewTestCase +from mayan.apps.common.tests.base import GenericViewTestCase from ..models import Key from ..permissions import permission_key_download, permission_key_upload diff --git a/mayan/apps/document_comments/tests/test_api.py b/mayan/apps/document_comments/tests/test_api.py index 1f2916314e..964e9b9b33 100644 --- a/mayan/apps/document_comments/tests/test_api.py +++ b/mayan/apps/document_comments/tests/test_api.py @@ -2,8 +2,8 @@ from __future__ import unicode_literals from rest_framework import status -from mayan.apps.documents.tests import DocumentTestMixin -from mayan.apps.rest_api.tests import BaseAPITestCase +from mayan.apps.documents.tests.mixins import DocumentTestMixin +from mayan.apps.rest_api.tests.base import BaseAPITestCase from ..models import Comment from ..permissions import ( diff --git a/mayan/apps/document_comments/tests/test_events.py b/mayan/apps/document_comments/tests/test_events.py index 5a4d4c942b..4d85152bfa 100644 --- a/mayan/apps/document_comments/tests/test_events.py +++ b/mayan/apps/document_comments/tests/test_events.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals from actstream.models import Action -from mayan.apps.documents.tests import GenericDocumentViewTestCase +from mayan.apps.documents.tests.base import GenericDocumentViewTestCase from ..events import ( event_document_comment_created, event_document_comment_deleted, diff --git a/mayan/apps/document_comments/tests/test_views.py b/mayan/apps/document_comments/tests/test_views.py index 3351af99c2..1714ad4d9b 100644 --- a/mayan/apps/document_comments/tests/test_views.py +++ b/mayan/apps/document_comments/tests/test_views.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals -from mayan.apps.documents.tests import GenericDocumentViewTestCase +from mayan.apps.documents.tests.base import GenericDocumentViewTestCase from ..models import Comment from ..permissions import ( diff --git a/mayan/apps/document_indexing/tests/__init__.py b/mayan/apps/document_indexing/tests/__init__.py index 82d60c8416..e69de29bb2 100644 --- a/mayan/apps/document_indexing/tests/__init__.py +++ b/mayan/apps/document_indexing/tests/__init__.py @@ -1 +0,0 @@ -from .mixins import * # NOQA diff --git a/mayan/apps/document_indexing/tests/test_api.py b/mayan/apps/document_indexing/tests/test_api.py index ebb468b37d..6d88313ded 100644 --- a/mayan/apps/document_indexing/tests/test_api.py +++ b/mayan/apps/document_indexing/tests/test_api.py @@ -2,8 +2,8 @@ from __future__ import unicode_literals from rest_framework import status -from mayan.apps.documents.tests import DocumentTestMixin -from mayan.apps.rest_api.tests import BaseAPITestCase +from mayan.apps.documents.tests.mixins import DocumentTestMixin +from mayan.apps.rest_api.tests.base import BaseAPITestCase from ..models import Index from ..permissions import ( diff --git a/mayan/apps/document_indexing/tests/test_events.py b/mayan/apps/document_indexing/tests/test_events.py index eb826100c4..c5374899cd 100644 --- a/mayan/apps/document_indexing/tests/test_events.py +++ b/mayan/apps/document_indexing/tests/test_events.py @@ -2,8 +2,8 @@ from __future__ import unicode_literals from actstream.models import Action -from mayan.apps.common.tests import GenericViewTestCase -from mayan.apps.documents.tests import DocumentTestMixin +from mayan.apps.common.tests.base import GenericViewTestCase +from mayan.apps.documents.tests.mixins import DocumentTestMixin from ..permissions import ( permission_document_indexing_create, permission_document_indexing_edit, diff --git a/mayan/apps/document_indexing/tests/test_models.py b/mayan/apps/document_indexing/tests/test_models.py index d458e69625..77281c007e 100644 --- a/mayan/apps/document_indexing/tests/test_models.py +++ b/mayan/apps/document_indexing/tests/test_models.py @@ -2,13 +2,11 @@ from __future__ import unicode_literals from django.utils.encoding import force_text -from mayan.apps.common.tests import BaseTestCase -from mayan.apps.documents.tests import ( - DocumentTestMixin, TEST_SMALL_DOCUMENT_PATH -) +from mayan.apps.common.tests.base import BaseTestCase +from mayan.apps.documents.tests.base import DocumentTestMixin from mayan.apps.documents.tests.literals import ( TEST_DOCUMENT_DESCRIPTION, TEST_DOCUMENT_DESCRIPTION_EDITED, - TEST_DOCUMENT_LABEL_EDITED + TEST_DOCUMENT_LABEL_EDITED, TEST_SMALL_DOCUMENT_PATH ) from mayan.apps.metadata.models import MetadataType, DocumentTypeMetadataType diff --git a/mayan/apps/document_indexing/tests/test_views.py b/mayan/apps/document_indexing/tests/test_views.py index e61559df52..4e87a83e37 100644 --- a/mayan/apps/document_indexing/tests/test_views.py +++ b/mayan/apps/document_indexing/tests/test_views.py @@ -1,6 +1,6 @@ from __future__ import absolute_import, unicode_literals -from mayan.apps.documents.tests import GenericDocumentViewTestCase +from mayan.apps.documents.tests.base import GenericDocumentViewTestCase from ..models import Index, IndexInstanceNode from ..permissions import ( diff --git a/mayan/apps/document_parsing/tests/test_api.py b/mayan/apps/document_parsing/tests/test_api.py index 4d1b0d5825..ed72feb7b3 100644 --- a/mayan/apps/document_parsing/tests/test_api.py +++ b/mayan/apps/document_parsing/tests/test_api.py @@ -4,8 +4,9 @@ from django.test import override_settings from rest_framework import status -from mayan.apps.documents.tests import DocumentTestMixin, TEST_HYBRID_DOCUMENT -from mayan.apps.rest_api.tests import BaseAPITestCase +from mayan.apps.documents.tests.literals import TEST_HYBRID_DOCUMENT +from mayan.apps.documents.tests.mixins import DocumentTestMixin +from mayan.apps.rest_api.tests.base import BaseAPITestCase from ..permissions import permission_content_view diff --git a/mayan/apps/document_parsing/tests/test_indexing.py b/mayan/apps/document_parsing/tests/test_indexing.py index 4936cf4352..96e8d0dbde 100644 --- a/mayan/apps/document_parsing/tests/test_indexing.py +++ b/mayan/apps/document_parsing/tests/test_indexing.py @@ -1,7 +1,8 @@ from __future__ import unicode_literals -from mayan.apps.common.tests import BaseTestCase -from mayan.apps.documents.tests import DocumentTestMixin, TEST_HYBRID_DOCUMENT +from mayan.apps.common.tests.base import BaseTestCase +from mayan.apps.documents.tests.literals import TEST_HYBRID_DOCUMENT +from mayan.apps.documents.tests.mixins import DocumentTestMixin from mayan.apps.document_indexing.models import Index, IndexInstanceNode from mayan.apps.document_indexing.tests.literals import TEST_INDEX_LABEL diff --git a/mayan/apps/document_parsing/tests/test_models.py b/mayan/apps/document_parsing/tests/test_models.py index ee5ccb55a3..72db48398c 100644 --- a/mayan/apps/document_parsing/tests/test_models.py +++ b/mayan/apps/document_parsing/tests/test_models.py @@ -2,7 +2,8 @@ from __future__ import unicode_literals from django.test import override_settings -from mayan.apps.documents.tests import GenericDocumentTestCase, TEST_HYBRID_DOCUMENT +from mayan.apps.documents.tests.base import GenericDocumentTestCase +from mayan.apps.documents.tests.literals import TEST_HYBRID_DOCUMENT from .literals import TEST_DOCUMENT_CONTENT diff --git a/mayan/apps/document_parsing/tests/test_parsers.py b/mayan/apps/document_parsing/tests/test_parsers.py index 1a4f731503..237bccc567 100644 --- a/mayan/apps/document_parsing/tests/test_parsers.py +++ b/mayan/apps/document_parsing/tests/test_parsers.py @@ -1,7 +1,8 @@ from __future__ import unicode_literals -from mayan.apps.common.tests import BaseTestCase -from mayan.apps.documents.tests import DocumentTestMixin, TEST_HYBRID_DOCUMENT +from mayan.apps.common.tests.base import BaseTestCase +from mayan.apps.documents.tests.literals import TEST_HYBRID_DOCUMENT +from mayan.apps.documents.tests.mixins import DocumentTestMixin from ..parsers import PopplerParser diff --git a/mayan/apps/document_parsing/tests/test_views.py b/mayan/apps/document_parsing/tests/test_views.py index 518a15423e..29b852ecc9 100644 --- a/mayan/apps/document_parsing/tests/test_views.py +++ b/mayan/apps/document_parsing/tests/test_views.py @@ -2,9 +2,8 @@ from __future__ import unicode_literals from django.test import override_settings -from mayan.apps.documents.tests import ( - GenericDocumentViewTestCase, TEST_HYBRID_DOCUMENT -) +from mayan.apps.documents.tests.base import GenericDocumentViewTestCase +from mayan.apps.documents.tests.literals import TEST_HYBRID_DOCUMENT from ..permissions import ( permission_content_view, permission_document_type_parsing_setup, diff --git a/mayan/apps/document_signatures/tests/test_links.py b/mayan/apps/document_signatures/tests/test_links.py index 5f2b4678c3..8ad2d010c2 100644 --- a/mayan/apps/document_signatures/tests/test_links.py +++ b/mayan/apps/document_signatures/tests/test_links.py @@ -2,9 +2,8 @@ from __future__ import unicode_literals from django.urls import reverse -from mayan.apps.documents.tests import ( - GenericDocumentViewTestCase, TEST_DOCUMENT_PATH -) +from mayan.apps.documents.tests.base import GenericDocumentViewTestCase +from mayan.apps.documents.tests.literals import TEST_DOCUMENT_PATH from ..links import ( link_document_version_signature_delete, diff --git a/mayan/apps/document_signatures/tests/test_models.py b/mayan/apps/document_signatures/tests/test_models.py index 957b87a159..2ac5c03ab4 100644 --- a/mayan/apps/document_signatures/tests/test_models.py +++ b/mayan/apps/document_signatures/tests/test_models.py @@ -8,9 +8,8 @@ from mayan.apps.django_gpg.tests.literals import ( TEST_KEY_DATA, TEST_KEY_PASSPHRASE ) from mayan.apps.documents.models import DocumentVersion -from mayan.apps.documents.tests import ( - GenericDocumentTestCase, TEST_DOCUMENT_PATH -) +from mayan.apps.documents.tests.base import GenericDocumentTestCase +from mayan.apps.documents.tests.literals import TEST_DOCUMENT_PATH from ..models import DetachedSignature, EmbeddedSignature from ..tasks import task_verify_missing_embedded_signature diff --git a/mayan/apps/document_signatures/tests/test_views.py b/mayan/apps/document_signatures/tests/test_views.py index d9b0ffd0d6..080260f79d 100644 --- a/mayan/apps/document_signatures/tests/test_views.py +++ b/mayan/apps/document_signatures/tests/test_views.py @@ -3,9 +3,8 @@ from __future__ import absolute_import, unicode_literals from django_downloadview.test import assert_download_response from mayan.apps.documents.models import DocumentVersion -from mayan.apps.documents.tests import ( - GenericDocumentViewTestCase, TEST_DOCUMENT_PATH -) +from mayan.apps.documents.tests.base import GenericDocumentViewTestCase +from mayan.apps.documents.tests.literals import TEST_DOCUMENT_PATH from ..models import DetachedSignature, EmbeddedSignature from ..permissions import ( diff --git a/mayan/apps/document_states/tests/test_api.py b/mayan/apps/document_states/tests/test_api.py index 84c55394f0..c7bb35eb9f 100644 --- a/mayan/apps/document_states/tests/test_api.py +++ b/mayan/apps/document_states/tests/test_api.py @@ -4,7 +4,7 @@ from rest_framework import status from mayan.apps.documents.permissions import permission_document_type_view from mayan.apps.documents.tests.mixins import DocumentTestMixin -from mayan.apps.rest_api.tests import BaseAPITestCase +from mayan.apps.rest_api.tests.base import BaseAPITestCase from ..models import Workflow from ..permissions import ( diff --git a/mayan/apps/document_states/tests/test_events.py b/mayan/apps/document_states/tests/test_events.py index 9998331665..e0d7bd7301 100644 --- a/mayan/apps/document_states/tests/test_events.py +++ b/mayan/apps/document_states/tests/test_events.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals from actstream.models import Action -from mayan.apps.common.tests import GenericViewTestCase +from mayan.apps.common.tests.base import GenericViewTestCase from ..events import event_workflow_created, event_workflow_edited from ..models import Workflow diff --git a/mayan/apps/document_states/tests/test_indexing.py b/mayan/apps/document_states/tests/test_indexing.py index 179988ef5f..5154397c86 100644 --- a/mayan/apps/document_states/tests/test_indexing.py +++ b/mayan/apps/document_states/tests/test_indexing.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals -from mayan.apps.documents.tests import GenericDocumentTestCase +from mayan.apps.documents.tests.base import GenericDocumentTestCase from mayan.apps.document_indexing.models import Index, IndexInstanceNode from ..models import Workflow diff --git a/mayan/apps/document_states/tests/test_models.py b/mayan/apps/document_states/tests/test_models.py index ebe512f244..462483bea5 100644 --- a/mayan/apps/document_states/tests/test_models.py +++ b/mayan/apps/document_states/tests/test_models.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals -from mayan.apps.common.tests import BaseTestCase +from mayan.apps.common.tests.base import BaseTestCase from .mixins import WorkflowTestMixin diff --git a/mayan/apps/document_states/tests/test_workflow_state_action_views.py b/mayan/apps/document_states/tests/test_workflow_state_action_views.py index c1b54093a8..f72ab4cdf2 100644 --- a/mayan/apps/document_states/tests/test_workflow_state_action_views.py +++ b/mayan/apps/document_states/tests/test_workflow_state_action_views.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals -from mayan.apps.common.tests import GenericViewTestCase +from mayan.apps.common.tests.base import GenericViewTestCase from ..permissions import permission_workflow_edit diff --git a/mayan/apps/document_states/tests/test_workflow_state_views.py b/mayan/apps/document_states/tests/test_workflow_state_views.py index 30fcb5dedf..1c2027da23 100644 --- a/mayan/apps/document_states/tests/test_workflow_state_views.py +++ b/mayan/apps/document_states/tests/test_workflow_state_views.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals -from mayan.apps.common.tests import GenericViewTestCase +from mayan.apps.common.tests.base import GenericViewTestCase from ..models import WorkflowState from ..permissions import permission_workflow_edit, permission_workflow_view diff --git a/mayan/apps/document_states/tests/test_workflow_transition_views.py b/mayan/apps/document_states/tests/test_workflow_transition_views.py index c4a004871c..0aa25d168d 100644 --- a/mayan/apps/document_states/tests/test_workflow_transition_views.py +++ b/mayan/apps/document_states/tests/test_workflow_transition_views.py @@ -1,7 +1,7 @@ from __future__ import unicode_literals -from mayan.apps.common.tests import GenericViewTestCase -from mayan.apps.documents.tests import GenericDocumentViewTestCase +from mayan.apps.common.tests.base import GenericViewTestCase +from mayan.apps.documents.tests.base import GenericDocumentViewTestCase from ..models import WorkflowTransition from ..permissions import ( diff --git a/mayan/apps/document_states/tests/test_workflow_views.py b/mayan/apps/document_states/tests/test_workflow_views.py index 1e738d7d53..07af93b6fe 100644 --- a/mayan/apps/document_states/tests/test_workflow_views.py +++ b/mayan/apps/document_states/tests/test_workflow_views.py @@ -1,7 +1,7 @@ from __future__ import unicode_literals -from mayan.apps.common.tests import GenericViewTestCase -from mayan.apps.documents.tests import GenericDocumentViewTestCase +from mayan.apps.common.tests.base import GenericViewTestCase +from mayan.apps.documents.tests.base import GenericDocumentViewTestCase from ..models import Workflow from ..permissions import ( diff --git a/mayan/apps/document_states/workflow_actions.py b/mayan/apps/document_states/workflow_actions.py index 1e1eb5fe01..98e69978eb 100644 --- a/mayan/apps/document_states/workflow_actions.py +++ b/mayan/apps/document_states/workflow_actions.py @@ -11,7 +11,6 @@ from django.utils.translation import ugettext_lazy as _ from .classes import WorkflowAction from .exceptions import WorkflowStateActionError -__all__ = ('DocumentPropertiesEditAction', 'HTTPPostAction',) logger = logging.getLogger(__name__) DEFAULT_TIMEOUT = 4 # 4 seconds @@ -37,7 +36,7 @@ class DocumentPropertiesEditAction(WorkflowAction): }, } field_order = ('document_label', 'document_description') - label = _('Modify the properties of the document') + label = _('Modify document properties') widgets = { 'document_description': { 'class': 'django.forms.widgets.Textarea', 'kwargs': { diff --git a/mayan/apps/documents/tests/__init__.py b/mayan/apps/documents/tests/__init__.py index c1f93fb9de..e69de29bb2 100644 --- a/mayan/apps/documents/tests/__init__.py +++ b/mayan/apps/documents/tests/__init__.py @@ -1,3 +0,0 @@ -from .base import GenericDocumentTestCase, GenericDocumentViewTestCase # NOQA -from .literals import * # NOQA -from .mixins import * # NOQA diff --git a/mayan/apps/documents/tests/base.py b/mayan/apps/documents/tests/base.py index 54014d919d..644e6e4f42 100644 --- a/mayan/apps/documents/tests/base.py +++ b/mayan/apps/documents/tests/base.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals -from mayan.apps.common.tests import BaseTestCase, GenericViewTestCase +from mayan.apps.common.tests.base import BaseTestCase, GenericViewTestCase from .mixins import DocumentTestMixin diff --git a/mayan/apps/documents/tests/test_api.py b/mayan/apps/documents/tests/test_api.py index 1f610d2fc5..d5e44a9c2c 100644 --- a/mayan/apps/documents/tests/test_api.py +++ b/mayan/apps/documents/tests/test_api.py @@ -7,8 +7,7 @@ from django.utils.encoding import force_text from django_downloadview import assert_download_response from rest_framework import status -from mayan.apps.converter.tests.mixins import LayerTestMixin -from mayan.apps.rest_api.tests import BaseAPITestCase +from mayan.apps.rest_api.tests.base import BaseAPITestCase from ..models import Document, DocumentType from ..permissions import ( diff --git a/mayan/apps/documents/tests/test_models.py b/mayan/apps/documents/tests/test_models.py index fda9936e8c..4a441d43ff 100644 --- a/mayan/apps/documents/tests/test_models.py +++ b/mayan/apps/documents/tests/test_models.py @@ -3,7 +3,7 @@ from __future__ import unicode_literals from datetime import timedelta import time -from mayan.apps.common.tests import BaseTestCase +from mayan.apps.common.tests.base import BaseTestCase from ..literals import STUB_EXPIRATION_INTERVAL from ..models import ( diff --git a/mayan/apps/documents/tests/test_search.py b/mayan/apps/documents/tests/test_search.py index 76cc6b56be..531f6e8d2f 100644 --- a/mayan/apps/documents/tests/test_search.py +++ b/mayan/apps/documents/tests/test_search.py @@ -1,9 +1,9 @@ from __future__ import unicode_literals -from mayan.apps.common.tests import BaseTestCase +from mayan.apps.common.tests.base import BaseTestCase from mayan.apps.documents.permissions import permission_document_view from mayan.apps.documents.search import document_search, document_page_search -from mayan.apps.documents.tests import DocumentTestMixin +from mayan.apps.documents.tests.mixins import DocumentTestMixin class DocumentSearchTestCase(DocumentTestMixin, BaseTestCase): diff --git a/mayan/apps/documents/tests/test_statistics.py b/mayan/apps/documents/tests/test_statistics.py index 5f342b8b42..61c7463f96 100644 --- a/mayan/apps/documents/tests/test_statistics.py +++ b/mayan/apps/documents/tests/test_statistics.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals -from mayan.apps.common.tests import BaseTestCase +from mayan.apps.common.tests.base import BaseTestCase from ..statistics import namespace diff --git a/mayan/apps/documents/tests/test_utils.py b/mayan/apps/documents/tests/test_utils.py index 1484282931..b89d6819d0 100644 --- a/mayan/apps/documents/tests/test_utils.py +++ b/mayan/apps/documents/tests/test_utils.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals -from mayan.apps.common.tests import BaseTestCase +from mayan.apps.common.tests.base import BaseTestCase from ..utils import parse_range diff --git a/mayan/apps/dynamic_search/tests/test_api.py b/mayan/apps/dynamic_search/tests/test_api.py index c3b6ef53c3..36f4d9740b 100644 --- a/mayan/apps/dynamic_search/tests/test_api.py +++ b/mayan/apps/dynamic_search/tests/test_api.py @@ -4,8 +4,8 @@ from rest_framework import status from mayan.apps.documents.search import document_search from mayan.apps.documents.permissions import permission_document_view -from mayan.apps.documents.tests import DocumentTestMixin -from mayan.apps.rest_api.tests import BaseAPITestCase +from mayan.apps.documents.tests.base import DocumentTestMixin +from mayan.apps.rest_api.tests.base import BaseAPITestCase from ..classes import SearchModel diff --git a/mayan/apps/dynamic_search/tests/test_models.py b/mayan/apps/dynamic_search/tests/test_models.py index c322d7d0fb..679311c669 100644 --- a/mayan/apps/dynamic_search/tests/test_models.py +++ b/mayan/apps/dynamic_search/tests/test_models.py @@ -2,10 +2,10 @@ from __future__ import unicode_literals from django.utils.encoding import force_text -from mayan.apps.common.tests import BaseTestCase +from mayan.apps.common.tests.base import BaseTestCase from mayan.apps.documents.permissions import permission_document_view from mayan.apps.documents.search import document_search -from mayan.apps.documents.tests import DocumentTestMixin +from mayan.apps.documents.tests.mixins import DocumentTestMixin class DocumentSearchTestCase(DocumentTestMixin, BaseTestCase): diff --git a/mayan/apps/dynamic_search/tests/test_views.py b/mayan/apps/dynamic_search/tests/test_views.py index 310f27481b..885c9ada42 100644 --- a/mayan/apps/dynamic_search/tests/test_views.py +++ b/mayan/apps/dynamic_search/tests/test_views.py @@ -1,9 +1,9 @@ from __future__ import unicode_literals -from mayan.apps.common.tests import GenericViewTestCase +from mayan.apps.common.tests.base import GenericViewTestCase from mayan.apps.documents.permissions import permission_document_view from mayan.apps.documents.search import document_search -from mayan.apps.documents.tests import DocumentTestMixin +from mayan.apps.documents.tests.mixins import DocumentTestMixin class Issue46TestCase(DocumentTestMixin, GenericViewTestCase): diff --git a/mayan/apps/events/tests/test_api.py b/mayan/apps/events/tests/test_api.py index 1312f8e741..185b46c9e4 100644 --- a/mayan/apps/events/tests/test_api.py +++ b/mayan/apps/events/tests/test_api.py @@ -4,8 +4,8 @@ from django.contrib.contenttypes.models import ContentType from rest_framework import status -from mayan.apps.documents.tests import DocumentTestMixin -from mayan.apps.rest_api.tests import BaseAPITestCase +from mayan.apps.documents.tests.mixins import DocumentTestMixin +from mayan.apps.rest_api.tests.base import BaseAPITestCase from ..permissions import permission_events_view diff --git a/mayan/apps/events/tests/test_views.py b/mayan/apps/events/tests/test_views.py index c600524f6f..f49cb8fbfe 100644 --- a/mayan/apps/events/tests/test_views.py +++ b/mayan/apps/events/tests/test_views.py @@ -2,8 +2,8 @@ from __future__ import absolute_import, unicode_literals from django.contrib.contenttypes.models import ContentType -from mayan.apps.common.tests import GenericViewTestCase -from mayan.apps.documents.tests import GenericDocumentViewTestCase +from mayan.apps.common.tests.base import GenericViewTestCase +from mayan.apps.documents.tests.base import GenericDocumentViewTestCase from ..permissions import permission_events_view diff --git a/mayan/apps/file_caching/tests/test_events.py b/mayan/apps/file_caching/tests/test_events.py index 023da0dea8..f64952560d 100644 --- a/mayan/apps/file_caching/tests/test_events.py +++ b/mayan/apps/file_caching/tests/test_events.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals from actstream.models import Action -from mayan.apps.common.tests import BaseTestCase +from mayan.apps.common.tests.base import BaseTestCase from ..events import event_cache_created, event_cache_purged from ..models import Cache diff --git a/mayan/apps/file_caching/tests/test_models.py b/mayan/apps/file_caching/tests/test_models.py index 4c7871bc70..62ccab2189 100644 --- a/mayan/apps/file_caching/tests/test_models.py +++ b/mayan/apps/file_caching/tests/test_models.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals -from mayan.apps.common.tests import BaseTestCase +from mayan.apps.common.tests.base import BaseTestCase from .mixins import CacheTestMixin diff --git a/mayan/apps/file_caching/tests/test_views.py b/mayan/apps/file_caching/tests/test_views.py index 7b2a92a25d..e50249ede7 100644 --- a/mayan/apps/file_caching/tests/test_views.py +++ b/mayan/apps/file_caching/tests/test_views.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals -from mayan.apps.common.tests import GenericViewTestCase +from mayan.apps.common.tests.base import GenericViewTestCase from ..permissions import ( permission_cache_purge, permission_cache_view diff --git a/mayan/apps/file_metadata/tests/test_classes.py b/mayan/apps/file_metadata/tests/test_classes.py index 42c8c5a74f..7076b5ebea 100644 --- a/mayan/apps/file_metadata/tests/test_classes.py +++ b/mayan/apps/file_metadata/tests/test_classes.py @@ -1,9 +1,8 @@ from __future__ import unicode_literals -from mayan.apps.common.tests import BaseTestCase -from mayan.apps.documents.tests import ( - TEST_PDF_DOCUMENT_FILENAME, DocumentTestMixin -) +from mayan.apps.common.tests.base import BaseTestCase +from mayan.apps.documents.tests.literals import TEST_PDF_DOCUMENT_FILENAME +from mayan.apps.documents.tests.mixins import DocumentTestMixin from .literals import ( TEST_PDF_FILE_METADATA_DOTTED_NAME, TEST_PDF_FILE_METADATA_VALUE diff --git a/mayan/apps/file_metadata/tests/test_indexing.py b/mayan/apps/file_metadata/tests/test_indexing.py index 441a4e39ca..f1aa644b5e 100644 --- a/mayan/apps/file_metadata/tests/test_indexing.py +++ b/mayan/apps/file_metadata/tests/test_indexing.py @@ -1,9 +1,9 @@ from __future__ import unicode_literals -from mayan.apps.common.tests import BaseTestCase +from mayan.apps.common.tests.base import BaseTestCase from mayan.apps.document_indexing.models import Index, IndexInstanceNode from mayan.apps.document_indexing.tests.literals import TEST_INDEX_LABEL -from mayan.apps.documents.tests import DocumentTestMixin +from mayan.apps.documents.tests.base import DocumentTestMixin from .literals import ( TEST_FILE_METADATA_INDEX_NODE_TEMPLATE, TEST_FILE_METADATA_VALUE diff --git a/mayan/apps/file_metadata/tests/test_views.py b/mayan/apps/file_metadata/tests/test_views.py index 7ddfbbf8f0..16fa68be38 100644 --- a/mayan/apps/file_metadata/tests/test_views.py +++ b/mayan/apps/file_metadata/tests/test_views.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals from django.test import override_settings -from mayan.apps.documents.tests import GenericDocumentViewTestCase +from mayan.apps.documents.tests.base import GenericDocumentViewTestCase from ..permissions import ( permission_document_type_file_metadata_setup, diff --git a/mayan/apps/linking/tests/test_api.py b/mayan/apps/linking/tests/test_api.py index 5e78646e23..00b40e23e3 100644 --- a/mayan/apps/linking/tests/test_api.py +++ b/mayan/apps/linking/tests/test_api.py @@ -3,8 +3,8 @@ from __future__ import unicode_literals from rest_framework import status from mayan.apps.documents.permissions import permission_document_view -from mayan.apps.documents.tests import DocumentTestMixin -from mayan.apps.rest_api.tests import BaseAPITestCase +from mayan.apps.documents.tests.base import DocumentTestMixin +from mayan.apps.rest_api.tests.base import BaseAPITestCase from ..models import SmartLink, SmartLinkCondition from ..permissions import ( diff --git a/mayan/apps/linking/tests/test_events.py b/mayan/apps/linking/tests/test_events.py index c798109e50..a7745df769 100644 --- a/mayan/apps/linking/tests/test_events.py +++ b/mayan/apps/linking/tests/test_events.py @@ -2,8 +2,8 @@ from __future__ import unicode_literals from actstream.models import Action -from mayan.apps.common.tests import GenericViewTestCase -from mayan.apps.documents.tests import DocumentTestMixin +from mayan.apps.common.tests.base import GenericViewTestCase +from mayan.apps.documents.tests.base import DocumentTestMixin from ..permissions import ( permission_smart_link_create, permission_smart_link_edit, diff --git a/mayan/apps/linking/tests/test_models.py b/mayan/apps/linking/tests/test_models.py index 3c726323b6..2dffc41a6d 100644 --- a/mayan/apps/linking/tests/test_models.py +++ b/mayan/apps/linking/tests/test_models.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals -from mayan.apps.documents.tests import GenericDocumentTestCase +from mayan.apps.documents.tests.base import GenericDocumentTestCase from .mixins import SmartLinkTestMixin diff --git a/mayan/apps/linking/tests/test_views.py b/mayan/apps/linking/tests/test_views.py index 1fa62f79a7..4d33534789 100644 --- a/mayan/apps/linking/tests/test_views.py +++ b/mayan/apps/linking/tests/test_views.py @@ -1,8 +1,8 @@ from __future__ import absolute_import, unicode_literals -from mayan.apps.common.tests import GenericViewTestCase +from mayan.apps.common.tests.base import GenericViewTestCase from mayan.apps.documents.permissions import permission_document_view -from mayan.apps.documents.tests import GenericDocumentViewTestCase +from mayan.apps.documents.tests.base import GenericDocumentViewTestCase from ..models import SmartLink from ..permissions import ( diff --git a/mayan/apps/mailer/tests/test_actions.py b/mayan/apps/mailer/tests/test_actions.py index cf21f68b0d..e52f1ff95b 100644 --- a/mayan/apps/mailer/tests/test_actions.py +++ b/mayan/apps/mailer/tests/test_actions.py @@ -4,7 +4,7 @@ import json from django.core import mail -from mayan.apps.common.tests import GenericViewTestCase +from mayan.apps.common.tests.base import GenericViewTestCase from mayan.apps.documents.tests.mixins import DocumentTestMixin from mayan.apps.document_states.literals import WORKFLOW_ACTION_ON_ENTRY from mayan.apps.document_states.tests.mixins import WorkflowTestMixin diff --git a/mayan/apps/mailer/tests/test_events.py b/mayan/apps/mailer/tests/test_events.py index 95ebe32b57..124ff8e97f 100644 --- a/mayan/apps/mailer/tests/test_events.py +++ b/mayan/apps/mailer/tests/test_events.py @@ -4,8 +4,8 @@ from django.core import mail from actstream.models import Action -from mayan.apps.common.tests import GenericViewTestCase -from mayan.apps.documents.tests import DocumentTestMixin +from mayan.apps.common.tests.base import GenericViewTestCase +from mayan.apps.documents.tests.base import DocumentTestMixin from ..permissions import ( permission_mailing_send_document, permission_user_mailer_use diff --git a/mayan/apps/mailer/tests/test_models.py b/mayan/apps/mailer/tests/test_models.py index 02f3cab3b1..a161889e31 100644 --- a/mayan/apps/mailer/tests/test_models.py +++ b/mayan/apps/mailer/tests/test_models.py @@ -2,7 +2,7 @@ from __future__ import absolute_import, unicode_literals from django.core import mail -from mayan.apps.documents.tests.test_models import GenericDocumentTestCase +from mayan.apps.documents.tests.base import GenericDocumentTestCase from .literals import ( TEST_EMAIL_BODY_HTML, TEST_EMAIL_ADDRESS, TEST_EMAIL_FROM_ADDRESS, diff --git a/mayan/apps/mailer/tests/test_views.py b/mayan/apps/mailer/tests/test_views.py index 5b86cb6888..4cc58f4deb 100644 --- a/mayan/apps/mailer/tests/test_views.py +++ b/mayan/apps/mailer/tests/test_views.py @@ -2,8 +2,8 @@ from __future__ import unicode_literals from django.core import mail -from mayan.apps.common.tests import GenericViewTestCase -from mayan.apps.documents.tests import GenericDocumentViewTestCase +from mayan.apps.common.tests.base import GenericViewTestCase +from mayan.apps.documents.tests.base import GenericDocumentViewTestCase from ..models import UserMailer from ..permissions import ( diff --git a/mayan/apps/mayan_statistics/tests/test_views.py b/mayan/apps/mayan_statistics/tests/test_views.py index 4eeab8a6fb..6508abbe33 100644 --- a/mayan/apps/mayan_statistics/tests/test_views.py +++ b/mayan/apps/mayan_statistics/tests/test_views.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals -from mayan.apps.common.tests import GenericViewTestCase +from mayan.apps.common.tests.base import GenericViewTestCase from ..classes import Statistic from ..permissions import permission_statistics_view diff --git a/mayan/apps/metadata/tests/test_api.py b/mayan/apps/metadata/tests/test_api.py index ab06e11725..f74f7cdfce 100644 --- a/mayan/apps/metadata/tests/test_api.py +++ b/mayan/apps/metadata/tests/test_api.py @@ -5,8 +5,8 @@ from rest_framework import status from mayan.apps.documents.permissions import ( permission_document_type_edit, permission_document_type_view ) -from mayan.apps.documents.tests import DocumentTestMixin -from mayan.apps.rest_api.tests import BaseAPITestCase +from mayan.apps.documents.tests.mixins import DocumentTestMixin +from mayan.apps.rest_api.tests.base import BaseAPITestCase from ..models import DocumentTypeMetadataType, MetadataType from ..permissions import ( diff --git a/mayan/apps/metadata/tests/test_events.py b/mayan/apps/metadata/tests/test_events.py index cdd8e1b45c..60c06e76a3 100644 --- a/mayan/apps/metadata/tests/test_events.py +++ b/mayan/apps/metadata/tests/test_events.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals from actstream.models import Action -from mayan.apps.common.tests import GenericViewTestCase +from mayan.apps.common.tests.base import GenericViewTestCase from ..events import ( event_metadata_type_created, event_metadata_type_edited diff --git a/mayan/apps/metadata/tests/test_models.py b/mayan/apps/metadata/tests/test_models.py index 8cc9bbb08d..46f134c5bb 100644 --- a/mayan/apps/metadata/tests/test_models.py +++ b/mayan/apps/metadata/tests/test_models.py @@ -3,11 +3,10 @@ from __future__ import unicode_literals from django.core.exceptions import ValidationError -from mayan.apps.common.tests import BaseTestCase +from mayan.apps.common.tests.base import BaseTestCase from mayan.apps.documents.models import DocumentType -from mayan.apps.documents.tests import ( - DocumentTestMixin, TEST_DOCUMENT_TYPE_2_LABEL -) +from mayan.apps.documents.tests.literals import TEST_DOCUMENT_TYPE_2_LABEL +from mayan.apps.documents.tests.mixins import DocumentTestMixin from ..models import DocumentMetadata diff --git a/mayan/apps/metadata/tests/test_views.py b/mayan/apps/metadata/tests/test_views.py index 124b7cd34d..071a955ec5 100644 --- a/mayan/apps/metadata/tests/test_views.py +++ b/mayan/apps/metadata/tests/test_views.py @@ -1,14 +1,13 @@ from __future__ import unicode_literals -from mayan.apps.common.tests import GenericViewTestCase +from mayan.apps.common.tests.base import GenericViewTestCase from mayan.apps.documents.models import DocumentType from mayan.apps.documents.permissions import ( permission_document_properties_edit, permission_document_type_edit, permission_document_view ) -from mayan.apps.documents.tests import ( - GenericDocumentViewTestCase, TEST_DOCUMENT_TYPE_2_LABEL -) +from mayan.apps.documents.tests.base import GenericDocumentViewTestCase +from mayan.apps.documents.tests.literals import TEST_DOCUMENT_TYPE_2_LABEL from ..models import MetadataType from ..permissions import ( diff --git a/mayan/apps/metadata/tests/test_wizard_steps.py b/mayan/apps/metadata/tests/test_wizard_steps.py index cd0e49497e..a2384fdd83 100644 --- a/mayan/apps/metadata/tests/test_wizard_steps.py +++ b/mayan/apps/metadata/tests/test_wizard_steps.py @@ -5,9 +5,8 @@ from django.urls import reverse from mayan.apps.common.http import URL from mayan.apps.documents.models import Document from mayan.apps.documents.permissions import permission_document_create -from mayan.apps.documents.tests import ( - GenericDocumentViewTestCase, TEST_SMALL_DOCUMENT_PATH, -) +from mayan.apps.documents.tests.base import GenericDocumentViewTestCase +from mayan.apps.documents.tests.literals import TEST_SMALL_DOCUMENT_PATH from mayan.apps.sources.models import WebFormSource from mayan.apps.sources.tests.literals import ( TEST_SOURCE_LABEL, TEST_SOURCE_UNCOMPRESS_N, diff --git a/mayan/apps/mimetype/tests/test_functions.py b/mayan/apps/mimetype/tests/test_functions.py index 68dca2ade4..2123d3e771 100644 --- a/mayan/apps/mimetype/tests/test_functions.py +++ b/mayan/apps/mimetype/tests/test_functions.py @@ -4,10 +4,11 @@ import resource from django.test import override_settings, tag -from mayan.apps.common.tests import BaseTestCase +from mayan.apps.common.tests.base import BaseTestCase from mayan.apps.common.tests.literals import EXCLUDE_TEST_TAG from mayan.apps.documents.models import Document -from mayan.apps.documents.tests import DocumentTestMixin, TEST_PDF_DOCUMENT_FILENAME +from mayan.apps.documents.tests.base import DocumentTestMixin +from mayan.apps.documents.tests.literals import TEST_PDF_DOCUMENT_FILENAME # This constant may need tweaking as document upload code path changes. # The value is targeted at making the document upload process fail exactly diff --git a/mayan/apps/mirroring/tests/test_caches.py b/mayan/apps/mirroring/tests/test_caches.py index 42249ce375..91bb7d8a98 100644 --- a/mayan/apps/mirroring/tests/test_caches.py +++ b/mayan/apps/mirroring/tests/test_caches.py @@ -2,7 +2,7 @@ from __future__ import absolute_import, unicode_literals import warnings -from mayan.apps.common.tests import BaseTestCase +from mayan.apps.common.tests.base import BaseTestCase from ..caches import IndexFilesystemCache diff --git a/mayan/apps/mirroring/tests/test_filesystems.py b/mayan/apps/mirroring/tests/test_filesystems.py index 3036f929f6..7d41900383 100644 --- a/mayan/apps/mirroring/tests/test_filesystems.py +++ b/mayan/apps/mirroring/tests/test_filesystems.py @@ -4,10 +4,10 @@ import hashlib from fuse import FuseOSError -from mayan.apps.common.tests import BaseTestCase +from mayan.apps.common.tests.base import BaseTestCase from mayan.apps.documents.models import Document -from mayan.apps.documents.tests import DocumentTestMixin -from mayan.apps.document_indexing.tests import IndexTestMixin +from mayan.apps.documents.tests.mixins import DocumentTestMixin +from mayan.apps.document_indexing.tests.mixins import IndexTestMixin from ..filesystems import IndexFilesystem diff --git a/mayan/apps/motd/tests/test_api.py b/mayan/apps/motd/tests/test_api.py index d9619ae416..9e83ff4c6c 100644 --- a/mayan/apps/motd/tests/test_api.py +++ b/mayan/apps/motd/tests/test_api.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals from rest_framework import status -from mayan.apps.rest_api.tests import BaseAPITestCase +from mayan.apps.rest_api.tests.base import BaseAPITestCase from ..models import Message from ..permissions import ( diff --git a/mayan/apps/motd/tests/test_models.py b/mayan/apps/motd/tests/test_models.py index 574e1e7a08..0fe60f2bd6 100644 --- a/mayan/apps/motd/tests/test_models.py +++ b/mayan/apps/motd/tests/test_models.py @@ -2,15 +2,16 @@ from __future__ import unicode_literals from datetime import timedelta -from django.test import TestCase from django.utils import timezone +from mayan.apps.common.tests.base import BaseTestCase + from ..models import Message from .mixins import MOTDTestMixin -class MOTDTestCase(MOTDTestMixin, TestCase): +class MOTDTestCase(MOTDTestMixin, BaseTestCase): def setUp(self): super(MOTDTestCase, self).setUp() self._create_test_message() diff --git a/mayan/apps/navigation/tests/test_classes.py b/mayan/apps/navigation/tests/test_classes.py index 6a75f57740..8bca9d6af3 100644 --- a/mayan/apps/navigation/tests/test_classes.py +++ b/mayan/apps/navigation/tests/test_classes.py @@ -6,7 +6,7 @@ from django.urls import reverse from furl import furl from mayan.apps.acls.classes import ModelPermission -from mayan.apps.common.tests import GenericViewTestCase +from mayan.apps.common.tests.base import GenericViewTestCase from mayan.apps.common.tests.literals import TEST_VIEW_NAME from mayan.apps.permissions import Permission, PermissionNamespace diff --git a/mayan/apps/ocr/tests/test_api.py b/mayan/apps/ocr/tests/test_api.py index b34c8a73f1..e847550141 100644 --- a/mayan/apps/ocr/tests/test_api.py +++ b/mayan/apps/ocr/tests/test_api.py @@ -2,8 +2,8 @@ from __future__ import unicode_literals from rest_framework import status -from mayan.apps.documents.tests import DocumentTestMixin -from mayan.apps.rest_api.tests import BaseAPITestCase +from mayan.apps.documents.tests.mixins import DocumentTestMixin +from mayan.apps.rest_api.tests.base import BaseAPITestCase from ..permissions import ( permission_ocr_document, permission_ocr_content_view, diff --git a/mayan/apps/ocr/tests/test_indexing.py b/mayan/apps/ocr/tests/test_indexing.py index 2e785f391f..41c641774f 100644 --- a/mayan/apps/ocr/tests/test_indexing.py +++ b/mayan/apps/ocr/tests/test_indexing.py @@ -1,7 +1,7 @@ from __future__ import unicode_literals -from mayan.apps.common.tests import BaseTestCase -from mayan.apps.documents.tests import DocumentTestMixin +from mayan.apps.common.tests.base import BaseTestCase +from mayan.apps.documents.tests.mixins import DocumentTestMixin from mayan.apps.document_indexing.models import Index, IndexInstanceNode from mayan.apps.document_indexing.tests.literals import TEST_INDEX_LABEL diff --git a/mayan/apps/ocr/tests/test_models.py b/mayan/apps/ocr/tests/test_models.py index d2a842054a..cd4992d0d4 100644 --- a/mayan/apps/ocr/tests/test_models.py +++ b/mayan/apps/ocr/tests/test_models.py @@ -2,10 +2,9 @@ from __future__ import unicode_literals from django.test import override_settings -from mayan.apps.common.tests import BaseTestCase -from mayan.apps.documents.tests import ( - DocumentTestMixin, TEST_DEU_DOCUMENT_PATH -) +from mayan.apps.common.tests.base import BaseTestCase +from mayan.apps.documents.tests.mixins import DocumentTestMixin +from mayan.apps.documents.tests.literals import TEST_DEU_DOCUMENT_PATH from .literals import ( TEST_DOCUMENT_CONTENT, TEST_DOCUMENT_CONTENT_DEU_1, diff --git a/mayan/apps/ocr/tests/test_views.py b/mayan/apps/ocr/tests/test_views.py index ccc327ea6b..1459744584 100644 --- a/mayan/apps/ocr/tests/test_views.py +++ b/mayan/apps/ocr/tests/test_views.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals -from mayan.apps.documents.tests import GenericDocumentViewTestCase +from mayan.apps.documents.tests.base import GenericDocumentViewTestCase from ..permissions import ( permission_ocr_content_view, permission_ocr_document, diff --git a/mayan/apps/permissions/apps.py b/mayan/apps/permissions/apps.py index c1c7392966..16c7de3f1c 100644 --- a/mayan/apps/permissions/apps.py +++ b/mayan/apps/permissions/apps.py @@ -31,7 +31,7 @@ from .methods import method_group_roles_add, method_group_roles_remove from .permissions import ( permission_role_delete, permission_role_edit, permission_role_view ) -from .search import * # NOQA +from .search import role_search # NOQA class PermissionsApp(MayanAppConfig): diff --git a/mayan/apps/permissions/tests/test_api.py b/mayan/apps/permissions/tests/test_api.py index 816eb49b48..19e318d510 100644 --- a/mayan/apps/permissions/tests/test_api.py +++ b/mayan/apps/permissions/tests/test_api.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals from rest_framework import status -from mayan.apps.rest_api.tests import BaseAPITestCase +from mayan.apps.rest_api.tests.base import BaseAPITestCase from mayan.apps.user_management.tests.mixins import GroupTestMixin from ..classes import Permission diff --git a/mayan/apps/permissions/tests/test_events.py b/mayan/apps/permissions/tests/test_events.py index 9fa5057bc6..6a207ac9d8 100644 --- a/mayan/apps/permissions/tests/test_events.py +++ b/mayan/apps/permissions/tests/test_events.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals from actstream.models import Action -from mayan.apps.common.tests import GenericViewTestCase +from mayan.apps.common.tests.base import GenericViewTestCase from ..events import event_role_created, event_role_edited from ..permissions import permission_role_create, permission_role_edit diff --git a/mayan/apps/permissions/tests/test_models.py b/mayan/apps/permissions/tests/test_models.py index 3448cdbb15..c10dde1d05 100644 --- a/mayan/apps/permissions/tests/test_models.py +++ b/mayan/apps/permissions/tests/test_models.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals from django.core.exceptions import PermissionDenied -from mayan.apps.common.tests import BaseTestCase +from mayan.apps.common.tests.base import BaseTestCase from mayan.apps.user_management.tests.mixins import GroupTestMixin from ..classes import Permission, PermissionNamespace diff --git a/mayan/apps/permissions/tests/test_views.py b/mayan/apps/permissions/tests/test_views.py index bdc7399d17..6276b178cb 100644 --- a/mayan/apps/permissions/tests/test_views.py +++ b/mayan/apps/permissions/tests/test_views.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals -from mayan.apps.common.tests import GenericViewTestCase +from mayan.apps.common.tests.base import GenericViewTestCase from mayan.apps.user_management.permissions import permission_group_edit from mayan.apps.user_management.tests.mixins import GroupTestMixin diff --git a/mayan/apps/redactions/apps.py b/mayan/apps/redactions/apps.py index 48d9ddaa39..a7460b817d 100644 --- a/mayan/apps/redactions/apps.py +++ b/mayan/apps/redactions/apps.py @@ -10,7 +10,7 @@ from mayan.apps.converter.links import link_transformation_list from mayan.apps.common.menus import menu_list_facet from .dependencies import * # NOQA -from .layers import layer_redactions # NOQA +from .layers import layer_redactions from .transformations import * # NOQA logger = logging.getLogger(__name__) diff --git a/mayan/apps/rest_api/tests/__init__.py b/mayan/apps/rest_api/tests/__init__.py index 0b7c12d02a..e69de29bb2 100644 --- a/mayan/apps/rest_api/tests/__init__.py +++ b/mayan/apps/rest_api/tests/__init__.py @@ -1 +0,0 @@ -from .base import BaseAPITestCase # NOQA diff --git a/mayan/apps/rest_api/tests/base.py b/mayan/apps/rest_api/tests/base.py index 114549d89e..7419688585 100644 --- a/mayan/apps/rest_api/tests/base.py +++ b/mayan/apps/rest_api/tests/base.py @@ -2,7 +2,7 @@ from __future__ import absolute_import, unicode_literals from rest_framework.test import APITestCase -from mayan.apps.common.tests import GenericViewTestCase +from mayan.apps.common.tests.base import GenericViewTestCase from mayan.apps.permissions.classes import Permission from mayan.apps.smart_settings.classes import Namespace diff --git a/mayan/apps/smart_settings/apps.py b/mayan/apps/smart_settings/apps.py index d84e9dedf8..32d2a69950 100644 --- a/mayan/apps/smart_settings/apps.py +++ b/mayan/apps/smart_settings/apps.py @@ -11,7 +11,6 @@ from .links import ( link_namespace_detail, link_namespace_list, link_namespace_root_list, link_setting_edit ) -from .settings import * # NOQA from .widgets import setting_widget diff --git a/mayan/apps/smart_settings/tests/test_classes.py b/mayan/apps/smart_settings/tests/test_classes.py index 4eb6839ea9..266e1e75f4 100644 --- a/mayan/apps/smart_settings/tests/test_classes.py +++ b/mayan/apps/smart_settings/tests/test_classes.py @@ -8,7 +8,7 @@ from django.conf import settings from django.utils.encoding import force_text from mayan.apps.common.settings import setting_paginate_by -from mayan.apps.common.tests import BaseTestCase +from mayan.apps.common.tests.base import BaseTestCase from mayan.apps.storage.utils import fs_cleanup from ..classes import Setting diff --git a/mayan/apps/smart_settings/tests/test_views.py b/mayan/apps/smart_settings/tests/test_views.py index 50748d5f6d..78e972e069 100644 --- a/mayan/apps/smart_settings/tests/test_views.py +++ b/mayan/apps/smart_settings/tests/test_views.py @@ -1,6 +1,6 @@ from __future__ import absolute_import, unicode_literals -from mayan.apps.common.tests import GenericViewTestCase +from mayan.apps.common.tests.base import GenericViewTestCase from ..permissions import permission_settings_view diff --git a/mayan/apps/sources/tests/test_classes.py b/mayan/apps/sources/tests/test_classes.py index 319c3eeb37..76f70e1935 100644 --- a/mayan/apps/sources/tests/test_classes.py +++ b/mayan/apps/sources/tests/test_classes.py @@ -3,8 +3,8 @@ from __future__ import unicode_literals import os import shutil -from mayan.apps.common.tests import BaseTestCase -from mayan.apps.documents.tests import TEST_NON_ASCII_DOCUMENT_PATH +from mayan.apps.common.tests.base import BaseTestCase +from mayan.apps.documents.tests.literals import TEST_NON_ASCII_DOCUMENT_PATH from mayan.apps.storage.utils import mkdtemp from ..classes import StagingFile diff --git a/mayan/apps/sources/tests/test_links.py b/mayan/apps/sources/tests/test_links.py index 2466ab7897..7be34c1157 100644 --- a/mayan/apps/sources/tests/test_links.py +++ b/mayan/apps/sources/tests/test_links.py @@ -1,7 +1,7 @@ from __future__ import unicode_literals -from mayan.apps.documents.tests import GenericDocumentViewTestCase from mayan.apps.documents.permissions import permission_document_create +from mayan.apps.documents.tests.base import GenericDocumentViewTestCase from ..links import link_document_create_multiple diff --git a/mayan/apps/sources/tests/test_models.py b/mayan/apps/sources/tests/test_models.py index a49b00ce42..350fa18530 100644 --- a/mayan/apps/sources/tests/test_models.py +++ b/mayan/apps/sources/tests/test_models.py @@ -12,11 +12,11 @@ from django.utils.encoding import force_text from mayan.apps.common.serialization import yaml_dump from mayan.apps.documents.models import Document -from mayan.apps.documents.tests import ( - GenericDocumentTestCase, TEST_COMPRESSED_DOCUMENT_PATH, - TEST_NON_ASCII_DOCUMENT_FILENAME, TEST_NON_ASCII_DOCUMENT_PATH, - TEST_NON_ASCII_COMPRESSED_DOCUMENT_PATH, TEST_SMALL_DOCUMENT_FILENAME, - TEST_SMALL_DOCUMENT_PATH +from mayan.apps.documents.tests.base import GenericDocumentTestCase +from mayan.apps.documents.tests.literals import ( + TEST_COMPRESSED_DOCUMENT_PATH, TEST_NON_ASCII_DOCUMENT_FILENAME, + TEST_NON_ASCII_DOCUMENT_PATH, TEST_NON_ASCII_COMPRESSED_DOCUMENT_PATH, + TEST_SMALL_DOCUMENT_FILENAME, TEST_SMALL_DOCUMENT_PATH ) from mayan.apps.metadata.models import MetadataType from mayan.apps.storage.utils import mkdtemp diff --git a/mayan/apps/sources/tests/test_views.py b/mayan/apps/sources/tests/test_views.py index cc6579fc9d..756608ea51 100644 --- a/mayan/apps/sources/tests/test_views.py +++ b/mayan/apps/sources/tests/test_views.py @@ -4,13 +4,13 @@ import os import shutil from mayan.apps.checkouts.models import NewVersionBlock -from mayan.apps.common.tests import GenericViewTestCase +from mayan.apps.common.tests.base import GenericViewTestCase from mayan.apps.documents.models import Document from mayan.apps.documents.permissions import permission_document_create -from mayan.apps.documents.tests import ( - GenericDocumentViewTestCase, TEST_COMPRESSED_DOCUMENT_PATH, - TEST_DOCUMENT_DESCRIPTION, TEST_SMALL_DOCUMENT_CHECKSUM, - TEST_SMALL_DOCUMENT_PATH, +from mayan.apps.documents.tests.base import GenericDocumentViewTestCase +from mayan.apps.documents.tests.literals import ( + TEST_COMPRESSED_DOCUMENT_PATH, TEST_DOCUMENT_DESCRIPTION, + TEST_SMALL_DOCUMENT_CHECKSUM, TEST_SMALL_DOCUMENT_PATH ) from mayan.apps.storage.utils import fs_cleanup, mkdtemp diff --git a/mayan/apps/tags/tests/test_actions.py b/mayan/apps/tags/tests/test_actions.py index ec0fe3caa5..4fed190e0a 100644 --- a/mayan/apps/tags/tests/test_actions.py +++ b/mayan/apps/tags/tests/test_actions.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals -from mayan.apps.common.tests import GenericViewTestCase +from mayan.apps.common.tests.base import GenericViewTestCase from mayan.apps.document_states.tests.mixins import WorkflowTestMixin from mayan.apps.document_states.tests.test_actions import ActionTestCase diff --git a/mayan/apps/tags/tests/test_api.py b/mayan/apps/tags/tests/test_api.py index cb7a1ca4dd..efc133f4e8 100644 --- a/mayan/apps/tags/tests/test_api.py +++ b/mayan/apps/tags/tests/test_api.py @@ -5,8 +5,8 @@ from django.utils.encoding import force_text from rest_framework import status from mayan.apps.documents.permissions import permission_document_view -from mayan.apps.documents.tests import DocumentTestMixin -from mayan.apps.rest_api.tests import BaseAPITestCase +from mayan.apps.documents.tests.mixins import DocumentTestMixin +from mayan.apps.rest_api.tests.base import BaseAPITestCase from ..models import Tag from ..permissions import ( diff --git a/mayan/apps/tags/tests/test_events.py b/mayan/apps/tags/tests/test_events.py index 82e8dc1327..ecd26c7bf9 100644 --- a/mayan/apps/tags/tests/test_events.py +++ b/mayan/apps/tags/tests/test_events.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals from actstream.models import Action -from mayan.apps.common.tests import GenericViewTestCase +from mayan.apps.common.tests.base import GenericViewTestCase from ..events import event_tag_created, event_tag_edited from ..models import Tag diff --git a/mayan/apps/tags/tests/test_indexing.py b/mayan/apps/tags/tests/test_indexing.py index 897c1ffff0..9bb205e059 100644 --- a/mayan/apps/tags/tests/test_indexing.py +++ b/mayan/apps/tags/tests/test_indexing.py @@ -1,7 +1,7 @@ from __future__ import unicode_literals -from mayan.apps.common.tests import BaseTestCase -from mayan.apps.documents.tests import DocumentTestMixin +from mayan.apps.common.tests.base import BaseTestCase +from mayan.apps.documents.tests.mixins import DocumentTestMixin from mayan.apps.document_indexing.models import Index, IndexInstanceNode from mayan.apps.document_indexing.tests.literals import TEST_INDEX_LABEL diff --git a/mayan/apps/tags/tests/test_models.py b/mayan/apps/tags/tests/test_models.py index c0df95db9c..3e3a7f13c5 100644 --- a/mayan/apps/tags/tests/test_models.py +++ b/mayan/apps/tags/tests/test_models.py @@ -1,7 +1,7 @@ from __future__ import unicode_literals -from mayan.apps.common.tests import BaseTestCase -from mayan.apps.documents.tests import DocumentTestMixin +from mayan.apps.common.tests.base import BaseTestCase +from mayan.apps.documents.tests.mixins import DocumentTestMixin from .mixins import TagTestMixin diff --git a/mayan/apps/tags/tests/test_views.py b/mayan/apps/tags/tests/test_views.py index 23189d7635..3ef2bf3a22 100644 --- a/mayan/apps/tags/tests/test_views.py +++ b/mayan/apps/tags/tests/test_views.py @@ -2,8 +2,8 @@ from __future__ import unicode_literals from django.utils.encoding import force_text -from mayan.apps.common.tests import GenericViewTestCase -from mayan.apps.documents.tests import GenericDocumentViewTestCase +from mayan.apps.common.tests.base import GenericViewTestCase +from mayan.apps.documents.tests.base import GenericDocumentViewTestCase from ..models import Tag from ..permissions import ( diff --git a/mayan/apps/tags/tests/test_widgets.py b/mayan/apps/tags/tests/test_widgets.py index 8f6fcc18c3..659785e452 100644 --- a/mayan/apps/tags/tests/test_widgets.py +++ b/mayan/apps/tags/tests/test_widgets.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals from django.utils.encoding import force_text -from mayan.apps.documents.tests import GenericDocumentViewTestCase +from mayan.apps.documents.tests.base import GenericDocumentViewTestCase from mayan.apps.documents.tests.mixins import DocumentViewTestMixin from mayan.apps.documents.permissions import permission_document_view diff --git a/mayan/apps/tags/tests/test_wizard_steps.py b/mayan/apps/tags/tests/test_wizard_steps.py index a241b9725d..46824a83b1 100644 --- a/mayan/apps/tags/tests/test_wizard_steps.py +++ b/mayan/apps/tags/tests/test_wizard_steps.py @@ -2,9 +2,8 @@ from __future__ import unicode_literals from mayan.apps.documents.models import Document from mayan.apps.documents.permissions import permission_document_create -from mayan.apps.documents.tests import ( - GenericDocumentViewTestCase, TEST_SMALL_DOCUMENT_PATH, -) +from mayan.apps.documents.tests.base import GenericDocumentViewTestCase +from mayan.apps.documents.tests.literals import TEST_SMALL_DOCUMENT_PATH from mayan.apps.sources.models import WebFormSource from mayan.apps.sources.tests.literals import ( TEST_SOURCE_LABEL, TEST_SOURCE_UNCOMPRESS_N diff --git a/mayan/apps/task_manager/tests/test_views.py b/mayan/apps/task_manager/tests/test_views.py index 4df67fa61c..a9459da180 100644 --- a/mayan/apps/task_manager/tests/test_views.py +++ b/mayan/apps/task_manager/tests/test_views.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals -from mayan.apps.common.tests import GenericViewTestCase +from mayan.apps.common.tests.base import GenericViewTestCase from ..classes import Worker, CeleryQueue from ..permissions import permission_task_view diff --git a/mayan/apps/user_management/apps.py b/mayan/apps/user_management/apps.py index 22ac437887..28ee9e1615 100644 --- a/mayan/apps/user_management/apps.py +++ b/mayan/apps/user_management/apps.py @@ -56,7 +56,7 @@ from .permissions import ( permission_group_view, permission_user_delete, permission_user_edit, permission_user_view ) -from .search import * # NOQA +from .search import group_search, user_search # NOQA def get_groups(): diff --git a/mayan/apps/user_management/search.py b/mayan/apps/user_management/search.py index 03e5494aec..90591d7824 100644 --- a/mayan/apps/user_management/search.py +++ b/mayan/apps/user_management/search.py @@ -8,6 +8,16 @@ from mayan.apps.dynamic_search.classes import SearchModel from .permissions import permission_group_view, permission_user_view from .querysets import get_user_queryset +group_search = SearchModel( + app_label='auth', label=_('Group'), model_name='Group', + permission=permission_group_view, + serializer_path='mayan.apps.user_management.serializers.GroupSerializer' +) + +group_search.add_model_field( + field='name', label=_('Name') +) + user_app, user_model = settings.AUTH_USER_MODEL.split('.') user_search = SearchModel( @@ -31,13 +41,3 @@ user_search.add_model_field( user_search.add_model_field( field='username', label=_('username') ) - -group_search = SearchModel( - app_label='auth', label=_('Group'), model_name='Group', - permission=permission_group_view, - serializer_path='mayan.apps.user_management.serializers.GroupSerializer' -) - -group_search.add_model_field( - field='name', label=_('Name') -) diff --git a/mayan/apps/user_management/tests/test_api.py b/mayan/apps/user_management/tests/test_api.py index 7ae2d4a947..33e24cc0f0 100644 --- a/mayan/apps/user_management/tests/test_api.py +++ b/mayan/apps/user_management/tests/test_api.py @@ -5,7 +5,7 @@ from django.contrib.auth.models import Group from rest_framework import status -from mayan.apps.rest_api.tests import BaseAPITestCase +from mayan.apps.rest_api.tests.base import BaseAPITestCase from ..permissions import ( permission_group_create, permission_group_delete, diff --git a/mayan/apps/user_management/tests/test_events.py b/mayan/apps/user_management/tests/test_events.py index 245c407eea..cef117c1f1 100644 --- a/mayan/apps/user_management/tests/test_events.py +++ b/mayan/apps/user_management/tests/test_events.py @@ -2,8 +2,8 @@ from __future__ import unicode_literals from actstream.models import Action -from mayan.apps.common.tests import GenericViewTestCase -from mayan.apps.rest_api.tests import BaseAPITestCase +from mayan.apps.common.tests.base import GenericViewTestCase +from mayan.apps.rest_api.tests.base import BaseAPITestCase from ..permissions import ( permission_group_create, permission_group_edit, permission_user_create, diff --git a/mayan/apps/user_management/tests/test_views.py b/mayan/apps/user_management/tests/test_views.py index 15a4a12c12..6d989393c3 100644 --- a/mayan/apps/user_management/tests/test_views.py +++ b/mayan/apps/user_management/tests/test_views.py @@ -3,8 +3,8 @@ from __future__ import unicode_literals from django.contrib.auth import get_user_model from django.contrib.auth.models import Group -from mayan.apps.common.tests import GenericViewTestCase -from mayan.apps.documents.tests import GenericDocumentViewTestCase +from mayan.apps.common.tests.base import GenericViewTestCase +from mayan.apps.documents.tests.base import GenericDocumentViewTestCase from mayan.apps.metadata.permissions import permission_document_metadata_edit from mayan.apps.metadata.tests.mixins import MetadataTypeTestMixin diff --git a/mayan/apps/web_links/tests/test_views.py b/mayan/apps/web_links/tests/test_views.py index 57cc7fc92b..8d2b03f664 100644 --- a/mayan/apps/web_links/tests/test_views.py +++ b/mayan/apps/web_links/tests/test_views.py @@ -2,8 +2,8 @@ from __future__ import unicode_literals from django.utils.encoding import force_text -from mayan.apps.common.tests import GenericViewTestCase -from mayan.apps.documents.tests import GenericDocumentViewTestCase +from mayan.apps.common.tests.base import GenericViewTestCase +from mayan.apps.documents.tests.base import GenericDocumentViewTestCase from ..models import WebLink from ..permissions import (