From b6161e9d92f55ff96c228fa4b1e98d3920878696 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Thu, 30 Jun 2016 21:30:01 -0400 Subject: [PATCH] PEP8 and code style cleanups. --- mayan/apps/acls/tests/test_models.py | 2 +- mayan/apps/authentication/auth/model_auth_backend.py | 1 - mayan/apps/authentication/tests/test_views.py | 2 +- mayan/apps/checkouts/tests/test_models.py | 2 +- .../apps/common/management/commands/initialsetup.py | 12 +++++++++--- mayan/apps/common/tests/decorators.py | 8 ++++---- mayan/apps/common/tests/test_views.py | 1 - .../document_states/tests/test_organization_views.py | 7 +------ mayan/apps/documents/managers.py | 3 --- mayan/apps/documents/tests/test_api.py | 3 --- mayan/apps/documents/tests/test_models.py | 3 +-- .../apps/documents/tests/test_organization_views.py | 6 ++---- mayan/apps/documents/tests/test_views.py | 1 - mayan/apps/folders/tests/test_api.py | 4 ---- mayan/apps/folders/tests/test_organization_views.py | 2 +- mayan/apps/metadata/tests/test_api.py | 4 ---- mayan/apps/metadata/tests/test_organization_views.py | 5 ++--- mayan/apps/ocr/parsers.py | 1 - mayan/apps/ocr/tests/test_models.py | 2 -- mayan/apps/ocr/tests/test_parsers.py | 3 --- mayan/apps/organizations/apps.py | 4 +--- .../management/commands/createorganizationadmin.py | 5 ----- .../migrations/0002_add_data_default_organization.py | 4 ++-- mayan/apps/organizations/models.py | 7 ++----- mayan/apps/organizations/settings.py | 2 -- mayan/apps/organizations/shortcuts.py | 2 +- mayan/apps/organizations/tests/literals.py | 1 - mayan/apps/organizations/tests/test_middleware.py | 2 +- mayan/apps/organizations/tests/test_models.py | 2 +- mayan/apps/organizations/utils.py | 7 ++++--- mayan/apps/permissions/tests/test_models.py | 2 +- mayan/apps/rest_api/tests/__init__.py | 2 +- mayan/apps/rest_api/tests/base.py | 3 --- mayan/apps/tags/tests/test_api.py | 4 ---- mayan/apps/tags/tests/test_models.py | 2 +- mayan/apps/user_management/admin.py | 1 - 36 files changed, 38 insertions(+), 84 deletions(-) diff --git a/mayan/apps/acls/tests/test_models.py b/mayan/apps/acls/tests/test_models.py index 164883d507..4ebcc1aef6 100644 --- a/mayan/apps/acls/tests/test_models.py +++ b/mayan/apps/acls/tests/test_models.py @@ -2,7 +2,7 @@ from __future__ import absolute_import, unicode_literals from django.contrib.auth import get_user_model from django.core.exceptions import PermissionDenied -from django.test import TestCase, override_settings +from django.test import override_settings from documents.models import Document, DocumentType from documents.permissions import permission_document_view diff --git a/mayan/apps/authentication/auth/model_auth_backend.py b/mayan/apps/authentication/auth/model_auth_backend.py index 96beabcd7e..bc24c3784a 100644 --- a/mayan/apps/authentication/auth/model_auth_backend.py +++ b/mayan/apps/authentication/auth/model_auth_backend.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -from django.conf import settings from django.contrib.auth import get_user_model from django.contrib.auth.backends import ModelBackend diff --git a/mayan/apps/authentication/tests/test_views.py b/mayan/apps/authentication/tests/test_views.py index e7243e297d..64a20ca50d 100644 --- a/mayan/apps/authentication/tests/test_views.py +++ b/mayan/apps/authentication/tests/test_views.py @@ -3,7 +3,7 @@ from __future__ import absolute_import, unicode_literals from django.conf import settings from django.contrib.auth import get_user_model from django.core.urlresolvers import reverse -from django.test import TestCase, override_settings +from django.test import override_settings from django.test.client import Client from organizations.tests.base import OrganizationTestCase diff --git a/mayan/apps/checkouts/tests/test_models.py b/mayan/apps/checkouts/tests/test_models.py index 3c239bff86..243c95ad02 100644 --- a/mayan/apps/checkouts/tests/test_models.py +++ b/mayan/apps/checkouts/tests/test_models.py @@ -4,7 +4,7 @@ import datetime import time from django.contrib.auth import get_user_model -from django.test import TestCase, override_settings +from django.test import override_settings from django.utils.timezone import now from documents.exceptions import NewDocumentVersionNotAllowed diff --git a/mayan/apps/common/management/commands/initialsetup.py b/mayan/apps/common/management/commands/initialsetup.py index 0ef0c88ab2..c4fbb558d5 100644 --- a/mayan/apps/common/management/commands/initialsetup.py +++ b/mayan/apps/common/management/commands/initialsetup.py @@ -12,9 +12,15 @@ class Command(management.BaseCommand): def handle(self, *args, **options): management.call_command('createsettings', interactive=False) try: - result = management.call_command('migrate', interactive=False) - except OperationalError as exception: - self.stderr.write(self.style.NOTICE('Unable to migrate the database. The initialsetup command is to be used only on new installations. To upgrade existing installations use the performupgrade command.')) + management.call_command('migrate', interactive=False) + except OperationalError: + self.stderr.write( + self.style.NOTICE( + 'Unable to migrate the database. The initialsetup command ' + 'is to be used only on new installations. To upgrade ' + 'existing installations use the performupgrade command.' + ) + ) raise management.call_command('createautoadmin', interactive=False) management.call_command('createorganizationadmin', interactive=False) diff --git a/mayan/apps/common/tests/decorators.py b/mayan/apps/common/tests/decorators.py index 9c1b5b8186..264e5cc7cf 100644 --- a/mayan/apps/common/tests/decorators.py +++ b/mayan/apps/common/tests/decorators.py @@ -1,5 +1,5 @@ def skip_file_descriptor_check(func): - def func_wrapper(item): - item._skip_file_descriptor_test = True - return func(item) - return func_wrapper + def func_wrapper(item): + item._skip_file_descriptor_test = True + return func(item) + return func_wrapper diff --git a/mayan/apps/common/tests/test_views.py b/mayan/apps/common/tests/test_views.py index e68d9e741f..ee01c59d3c 100644 --- a/mayan/apps/common/tests/test_views.py +++ b/mayan/apps/common/tests/test_views.py @@ -5,7 +5,6 @@ from django.contrib.auth import get_user_model from django.core.urlresolvers import clear_url_caches, reverse from django.http import HttpResponse from django.template import Context, Template -from django.test import TestCase from organizations.tests.base import OrganizationTestCase from permissions import Permission diff --git a/mayan/apps/document_states/tests/test_organization_views.py b/mayan/apps/document_states/tests/test_organization_views.py index 160b854b4b..6264a0afb7 100644 --- a/mayan/apps/document_states/tests/test_organization_views.py +++ b/mayan/apps/document_states/tests/test_organization_views.py @@ -6,12 +6,7 @@ from organizations.tests.test_organization_views import OrganizationViewTestCase from ..models import Workflow -from .literals import ( - TEST_WORKFLOW_LABEL, TEST_WORKFLOW_LABEL_EDITED, - TEST_WORKFLOW_INITIAL_STATE_LABEL, TEST_WORKFLOW_INITIAL_STATE_COMPLETION, - TEST_WORKFLOW_STATE_LABEL, TEST_WORKFLOW_STATE_COMPLETION, - TEST_WORKFLOW_TRANSITION_LABEL -) +from .literals import TEST_WORKFLOW_LABEL, TEST_WORKFLOW_LABEL_EDITED @override_settings(OCR_AUTO_OCR=False) diff --git a/mayan/apps/documents/managers.py b/mayan/apps/documents/managers.py index d5e24671fb..a0068a97ea 100644 --- a/mayan/apps/documents/managers.py +++ b/mayan/apps/documents/managers.py @@ -4,7 +4,6 @@ from datetime import timedelta import logging from django.apps import apps -from django.conf import settings from django.db import models from django.utils.timezone import now @@ -182,8 +181,6 @@ class RecentDocumentManager(models.Manager): class TrashedDocumentManager(models.Manager): def get_queryset(self): - DocumentType = apps.get_model('documents', 'DocumentType') - return super( TrashedDocumentManager, self ).get_queryset().filter(in_trash=True) diff --git a/mayan/apps/documents/tests/test_api.py b/mayan/apps/documents/tests/test_api.py index 216f7b7bf8..e7274b9d28 100644 --- a/mayan/apps/documents/tests/test_api.py +++ b/mayan/apps/documents/tests/test_api.py @@ -11,9 +11,6 @@ from django.utils.six import BytesIO from rest_framework import status from rest_api.tests import GenericAPITestCase -from user_management.tests.literals import ( - TEST_ADMIN_EMAIL, TEST_ADMIN_PASSWORD, TEST_ADMIN_USERNAME -) from .literals import ( TEST_DOCUMENT_FILENAME, TEST_DOCUMENT_PATH, TEST_DOCUMENT_TYPE, diff --git a/mayan/apps/documents/tests/test_models.py b/mayan/apps/documents/tests/test_models.py index dba9eea4f3..23570a8c59 100644 --- a/mayan/apps/documents/tests/test_models.py +++ b/mayan/apps/documents/tests/test_models.py @@ -3,8 +3,7 @@ from __future__ import unicode_literals from datetime import timedelta import time -from common.tests import BaseTestCase -from django.test import TestCase, override_settings +from django.test import override_settings from organizations.tests.base import OrganizationTestCase diff --git a/mayan/apps/documents/tests/test_organization_views.py b/mayan/apps/documents/tests/test_organization_views.py index 982fd22525..35d2809436 100644 --- a/mayan/apps/documents/tests/test_organization_views.py +++ b/mayan/apps/documents/tests/test_organization_views.py @@ -2,12 +2,10 @@ from __future__ import unicode_literals from organizations.tests.test_organization_views import OrganizationViewTestCase -from ..models import Document,DocumentType +from ..models import DocumentType from .literals import ( - TEST_DOCUMENT_TYPE, TEST_DOCUMENT_TYPE_2_LABEL, - TEST_DOCUMENT_TYPE_QUICK_LABEL, TEST_SMALL_DOCUMENT_CHECKSUM, - TEST_SMALL_DOCUMENT_PATH + TEST_DOCUMENT_TYPE, TEST_DOCUMENT_TYPE_2_LABEL, TEST_SMALL_DOCUMENT_PATH ) diff --git a/mayan/apps/documents/tests/test_views.py b/mayan/apps/documents/tests/test_views.py index 222fbb0c12..209850d3fa 100644 --- a/mayan/apps/documents/tests/test_views.py +++ b/mayan/apps/documents/tests/test_views.py @@ -367,7 +367,6 @@ class DocumentsViewsTestCase(GenericDocumentViewTestCase): self.assertContains(response, text='queued', status_code=200) self.assertEqual(self.document.pages.count(), page_count) - def test_document_multiple_update_page_count_view_no_permission(self): self.login(username=TEST_USER_USERNAME, password=TEST_USER_PASSWORD) diff --git a/mayan/apps/folders/tests/test_api.py b/mayan/apps/folders/tests/test_api.py index f86ce29bf5..0ef6f3b02b 100644 --- a/mayan/apps/folders/tests/test_api.py +++ b/mayan/apps/folders/tests/test_api.py @@ -1,15 +1,11 @@ from __future__ import unicode_literals -from django.contrib.auth import get_user_model from django.core.urlresolvers import reverse from django.test import override_settings from documents.models import DocumentType from documents.tests import TEST_DOCUMENT_TYPE, TEST_SMALL_DOCUMENT_PATH from rest_api.tests import GenericAPITestCase -from user_management.tests.literals import ( - TEST_ADMIN_EMAIL, TEST_ADMIN_PASSWORD, TEST_ADMIN_USERNAME -) from ..models import Folder diff --git a/mayan/apps/folders/tests/test_organization_views.py b/mayan/apps/folders/tests/test_organization_views.py index 599b35e82c..e5549858ba 100644 --- a/mayan/apps/folders/tests/test_organization_views.py +++ b/mayan/apps/folders/tests/test_organization_views.py @@ -11,7 +11,7 @@ class FolderOrganizationViewTestCase(OrganizationViewTestCase): def test_folder_create_view(self): # Create a folder for organization A with self.settings(ORGANIZATION_ID=self.organization_a.pk): - response = self.post( + self.post( 'folders:folder_create', data={ 'label': TEST_FOLDER_LABEL } diff --git a/mayan/apps/metadata/tests/test_api.py b/mayan/apps/metadata/tests/test_api.py index 1b17a25885..150fec8828 100644 --- a/mayan/apps/metadata/tests/test_api.py +++ b/mayan/apps/metadata/tests/test_api.py @@ -1,15 +1,11 @@ from __future__ import unicode_literals -from django.contrib.auth import get_user_model from django.core.urlresolvers import reverse from django.test import override_settings from documents.models import DocumentType from documents.tests import TEST_DOCUMENT_TYPE, TEST_SMALL_DOCUMENT_PATH from rest_api.tests import GenericAPITestCase -from user_management.tests.literals import ( - TEST_ADMIN_EMAIL, TEST_ADMIN_PASSWORD, TEST_ADMIN_USERNAME -) from ..models import DocumentMetadata, DocumentTypeMetadataType, MetadataType diff --git a/mayan/apps/metadata/tests/test_organization_views.py b/mayan/apps/metadata/tests/test_organization_views.py index 0a387e0258..de5ae92fbd 100644 --- a/mayan/apps/metadata/tests/test_organization_views.py +++ b/mayan/apps/metadata/tests/test_organization_views.py @@ -5,9 +5,8 @@ from organizations.tests.test_organization_views import OrganizationViewTestCase from ..models import MetadataType from .literals import ( - TEST_DOCUMENT_METADATA_VALUE_2, TEST_METADATA_TYPE_LABEL, - TEST_METADATA_TYPE_LABEL_2, TEST_METADATA_TYPE_NAME, - TEST_METADATA_TYPE_NAME_2 + TEST_METADATA_TYPE_LABEL, TEST_METADATA_TYPE_LABEL_2, + TEST_METADATA_TYPE_NAME, ) diff --git a/mayan/apps/ocr/parsers.py b/mayan/apps/ocr/parsers.py index 088072f566..ad304f5430 100644 --- a/mayan/apps/ocr/parsers.py +++ b/mayan/apps/ocr/parsers.py @@ -11,7 +11,6 @@ import subprocess from django.utils.translation import ugettext_lazy as _ -from common.settings import setting_temporary_directory from common.utils import copyfile, fs_cleanup, mkstemp from .exceptions import ParserError, NoMIMETypeMatch diff --git a/mayan/apps/ocr/tests/test_models.py b/mayan/apps/ocr/tests/test_models.py index c6c7a2955c..e68eb5aabc 100644 --- a/mayan/apps/ocr/tests/test_models.py +++ b/mayan/apps/ocr/tests/test_models.py @@ -2,8 +2,6 @@ from __future__ import unicode_literals -from django.core.files.base import File - from documents.models import DocumentType from documents.settings import setting_language_choices from documents.tests import ( diff --git a/mayan/apps/ocr/tests/test_parsers.py b/mayan/apps/ocr/tests/test_parsers.py index b17670422a..949af7bd71 100644 --- a/mayan/apps/ocr/tests/test_parsers.py +++ b/mayan/apps/ocr/tests/test_parsers.py @@ -1,10 +1,7 @@ from __future__ import unicode_literals -from django.core.files.base import File from django.test import override_settings -from common.settings import setting_temporary_directory -from common.tests import BaseTestCase from documents.models import DocumentType from documents.tests import ( TEST_DOCUMENT_PATH, TEST_DOCUMENT_TYPE, TEST_HYBRID_DOCUMENT_PATH diff --git a/mayan/apps/organizations/apps.py b/mayan/apps/organizations/apps.py index 847c307836..e34dd0540f 100644 --- a/mayan/apps/organizations/apps.py +++ b/mayan/apps/organizations/apps.py @@ -1,12 +1,10 @@ from __future__ import unicode_literals -from django.apps import AppConfig - from django.utils.translation import ugettext_lazy as _ from common.apps import MayanAppConfig -class OrganizationApp(AppConfig): +class OrganizationApp(MayanAppConfig): name = 'organizations' verbose_name = _('Organizations') diff --git a/mayan/apps/organizations/management/commands/createorganizationadmin.py b/mayan/apps/organizations/management/commands/createorganizationadmin.py index 64c18b4d4b..bbfe751455 100644 --- a/mayan/apps/organizations/management/commands/createorganizationadmin.py +++ b/mayan/apps/organizations/management/commands/createorganizationadmin.py @@ -1,15 +1,10 @@ from __future__ import unicode_literals -import os - -from django.conf import settings from django.core import management -from django.utils.crypto import get_random_string from ...models import Organization - class Command(management.BaseCommand): help = 'Creates an organization admin user with a secure random password and all permissions.' diff --git a/mayan/apps/organizations/migrations/0002_add_data_default_organization.py b/mayan/apps/organizations/migrations/0002_add_data_default_organization.py index 71183d28cc..a188330587 100644 --- a/mayan/apps/organizations/migrations/0002_add_data_default_organization.py +++ b/mayan/apps/organizations/migrations/0002_add_data_default_organization.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals -from django.db import migrations, models +from django.db import migrations from ..literals import DEFAULT_ORGANIZATION_LABEL @@ -9,7 +9,7 @@ from ..literals import DEFAULT_ORGANIZATION_LABEL def default_data(apps, schema_editor): # We can't import the Organization model directly as it may be a newer # version than this migration expects. We use the historical version. - Organization = apps.get_model("organizations", "Organization") + Organization = apps.get_model('organizations', 'Organization') default_organization = Organization(label=DEFAULT_ORGANIZATION_LABEL) default_organization.save() diff --git a/mayan/apps/organizations/models.py b/mayan/apps/organizations/models.py index 37c74b04a3..dd7825c727 100644 --- a/mayan/apps/organizations/models.py +++ b/mayan/apps/organizations/models.py @@ -1,16 +1,13 @@ from __future__ import absolute_import, unicode_literals import logging -import string -import warnings from django.apps import apps from django.conf import settings from django.contrib.auth import get_user_model -from django.core.exceptions import ImproperlyConfigured, ValidationError +from django.core.exceptions import ImproperlyConfigured from django.db import models from django.db.models.signals import pre_save, pre_delete -from django.utils.deprecation import RemovedInDjango19Warning from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ @@ -110,7 +107,7 @@ class Organization(models.Model): ) account = UserModel.objects.get( - **{UserModel.USERNAME_FIELD: username, 'organization': self,} + **{UserModel.USERNAME_FIELD: username, 'organization': self} ) account.set_password(raw_password=password_value) account.save() diff --git a/mayan/apps/organizations/settings.py b/mayan/apps/organizations/settings.py index a6503dd9a8..80901928a2 100644 --- a/mayan/apps/organizations/settings.py +++ b/mayan/apps/organizations/settings.py @@ -1,7 +1,5 @@ from __future__ import unicode_literals -import tempfile - from django.utils.translation import ugettext_lazy as _ from smart_settings import Namespace diff --git a/mayan/apps/organizations/shortcuts.py b/mayan/apps/organizations/shortcuts.py index 84480ac072..8f3cf700b2 100644 --- a/mayan/apps/organizations/shortcuts.py +++ b/mayan/apps/organizations/shortcuts.py @@ -4,5 +4,5 @@ from django.apps import apps def get_current_organization(): - from .models import Organization + Organization = apps.get_model('organizations', 'Organizations') return Organization.objects.get_current().pk diff --git a/mayan/apps/organizations/tests/literals.py b/mayan/apps/organizations/tests/literals.py index fb73a7fb44..7917ff2838 100644 --- a/mayan/apps/organizations/tests/literals.py +++ b/mayan/apps/organizations/tests/literals.py @@ -1,4 +1,3 @@ from __future__ import absolute_import, unicode_literals TEST_ORGANIZATION_LABEL = 'test organization label' -TEST_ORGANIZATION_EDITED_LABEL = 'test organization edited label' diff --git a/mayan/apps/organizations/tests/test_middleware.py b/mayan/apps/organizations/tests/test_middleware.py index 9155657575..f26c3ff647 100644 --- a/mayan/apps/organizations/tests/test_middleware.py +++ b/mayan/apps/organizations/tests/test_middleware.py @@ -4,7 +4,7 @@ import unittest from django.apps import apps from django.conf import settings -from django.core.exceptions import ObjectDoesNotExist, ValidationError +from django.core.exceptions import ObjectDoesNotExist from django.db import connections, router from django.http import HttpRequest from django.test import TestCase, modify_settings, override_settings diff --git a/mayan/apps/organizations/tests/test_models.py b/mayan/apps/organizations/tests/test_models.py index 817cdab833..28cc19f863 100644 --- a/mayan/apps/organizations/tests/test_models.py +++ b/mayan/apps/organizations/tests/test_models.py @@ -4,7 +4,7 @@ from django.test import TestCase from ..models import Organization -from .literals import TEST_ORGANIZATION_LABEL, TEST_ORGANIZATION_EDITED_LABEL +from .literals import TEST_ORGANIZATION_LABEL class OrganizationModelTestCase(TestCase): diff --git a/mayan/apps/organizations/utils.py b/mayan/apps/organizations/utils.py index ed7fe98c07..99037a4ad3 100644 --- a/mayan/apps/organizations/utils.py +++ b/mayan/apps/organizations/utils.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals from django.apps import apps from django.core.management.color import no_style from django.db import DEFAULT_DB_ALIAS, connections, router -from django.db.models import signals from .literals import DEFAULT_ORGANIZATION_LABEL @@ -28,12 +27,14 @@ def create_default_organization(verbosity=2, interactive=True, using=DEFAULT_DB_ # the next id will be 1, so we coerce it. See #15573 and #16353. This # can also crop up outside of tests - see #15346. if verbosity >= 2: - print("Creating default Organization object") + print('Creating default Organization object') Organization(pk=1, label=DEFAULT_ORGANIZATION_LABEL).save(using=using) # We set an explicit pk instead of relying on auto-incrementation, # so we need to reset the database sequence. See #17415. - sequence_sql = connections[using].ops.sequence_reset_sql(no_style(), [Organization]) + sequence_sql = connections[using].ops.sequence_reset_sql( + no_style(), [Organization] + ) if sequence_sql: if verbosity >= 2: print('Resetting sequence') diff --git a/mayan/apps/permissions/tests/test_models.py b/mayan/apps/permissions/tests/test_models.py index 6a930f28ca..2ca5ad6a0c 100644 --- a/mayan/apps/permissions/tests/test_models.py +++ b/mayan/apps/permissions/tests/test_models.py @@ -9,7 +9,7 @@ from user_management.models import MayanGroup from user_management.tests import TEST_GROUP, TEST_USER_USERNAME from ..classes import Permission -from ..models import Role, StoredPermission +from ..models import Role from ..permissions import permission_role_view from .literals import TEST_ROLE_LABEL diff --git a/mayan/apps/rest_api/tests/__init__.py b/mayan/apps/rest_api/tests/__init__.py index f119bc4a90..d0585ed226 100644 --- a/mayan/apps/rest_api/tests/__init__.py +++ b/mayan/apps/rest_api/tests/__init__.py @@ -1 +1 @@ -from .base import GenericAPITestCase #NOQA +from .base import GenericAPITestCase # NOQA diff --git a/mayan/apps/rest_api/tests/base.py b/mayan/apps/rest_api/tests/base.py index d969e00a13..b5def4c8dd 100644 --- a/mayan/apps/rest_api/tests/base.py +++ b/mayan/apps/rest_api/tests/base.py @@ -1,8 +1,5 @@ from __future__ import unicode_literals -from django.contrib.auth import get_user_model -from django.test import override_settings - from rest_framework.test import APITestCase from organizations.models import Organization diff --git a/mayan/apps/tags/tests/test_api.py b/mayan/apps/tags/tests/test_api.py index cb9a7bd620..260c8bfdfc 100644 --- a/mayan/apps/tags/tests/test_api.py +++ b/mayan/apps/tags/tests/test_api.py @@ -1,15 +1,11 @@ from __future__ import unicode_literals -from django.contrib.auth import get_user_model from django.core.urlresolvers import reverse from django.test import override_settings from documents.models import DocumentType from documents.tests import TEST_DOCUMENT_TYPE, TEST_SMALL_DOCUMENT_PATH from rest_api.tests.base import GenericAPITestCase -from user_management.tests.literals import ( - TEST_ADMIN_EMAIL, TEST_ADMIN_PASSWORD, TEST_ADMIN_USERNAME -) from ..models import Tag diff --git a/mayan/apps/tags/tests/test_models.py b/mayan/apps/tags/tests/test_models.py index 51b8914f11..0b8b57b99f 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 django.core.files.base import File -from django.test import TestCase, override_settings +from django.test import override_settings from documents.models import DocumentType from documents.tests import TEST_DOCUMENT_TYPE, TEST_SMALL_DOCUMENT_PATH diff --git a/mayan/apps/user_management/admin.py b/mayan/apps/user_management/admin.py index acea763d5a..7cf822ea60 100644 --- a/mayan/apps/user_management/admin.py +++ b/mayan/apps/user_management/admin.py @@ -2,7 +2,6 @@ from __future__ import unicode_literals from django.contrib import admin from django.contrib.auth.admin import UserAdmin, GroupAdmin -from django.utils.translation import ugettext_lazy as _ from organizations.admin import OrganizationAdminMixin