From d992844c7456c86f0f4da4165ba0bfe08d2fb475 Mon Sep 17 00:00:00 2001 From: Raffaele Salmaso Date: Tue, 20 Feb 2018 23:14:26 +0100 Subject: [PATCH] Run isort --- src/wiki/conf/settings.py | 1 - src/wiki/core/markdown/__init__.py | 3 +-- src/wiki/core/permissions.py | 1 - src/wiki/decorators.py | 5 ++--- src/wiki/editors/__init__.py | 2 +- src/wiki/editors/markitup.py | 1 - src/wiki/forms.py | 9 +++------ src/wiki/managers.py | 2 +- src/wiki/migrations/0001_initial.py | 1 - src/wiki/models/__init__.py | 6 ++---- src/wiki/models/article.py | 3 +-- src/wiki/models/pluginbase.py | 1 - src/wiki/models/urlpath.py | 6 ++---- src/wiki/plugins/attachments/forms.py | 3 +-- src/wiki/plugins/attachments/markdown_extensions.py | 2 +- .../plugins/attachments/migrations/0001_initial.py | 3 +-- src/wiki/plugins/attachments/models.py | 3 +-- src/wiki/plugins/haystack/__init__.py | 11 +++++------ src/wiki/plugins/images/forms.py | 3 +-- src/wiki/plugins/images/models.py | 3 +-- src/wiki/plugins/images/views.py | 2 +- src/wiki/plugins/links/mdx/djangowikilinks.py | 1 - src/wiki/plugins/notifications/forms.py | 3 +-- .../commands/wiki_notifications_create_defaults.py | 1 - src/wiki/templatetags/wiki_tags.py | 2 +- src/wiki/views/accounts.py | 5 ++--- src/wiki/views/article.py | 5 ++--- testproject/testproject/settings/base.py | 1 - testproject/testproject/settings/customauthuser.py | 1 - testproject/testproject/settings/haystack.py | 1 - testproject/testproject/settings/sendfile.py | 1 - tests/base.py | 3 +-- tests/core/test_accounts.py | 6 +++--- tests/core/test_basic.py | 2 +- tests/core/test_checks.py | 4 ++-- tests/core/test_forms.py | 1 - tests/core/test_models.py | 2 -- tests/core/test_template_filters.py | 5 ++--- tests/core/test_template_tags.py | 5 ++--- tests/core/test_urls.py | 4 +--- tests/core/test_views.py | 3 +-- tests/plugins/attachments/test_views.py | 2 +- tests/plugins/globalhistory/test_globalhistory.py | 3 +-- tests/plugins/images/test_views.py | 3 +-- tests/plugins/links/test_links.py | 2 +- tests/settings.py | 1 - 46 files changed, 48 insertions(+), 90 deletions(-) diff --git a/src/wiki/conf/settings.py b/src/wiki/conf/settings.py index 255da842..7a40a6a1 100644 --- a/src/wiki/conf/settings.py +++ b/src/wiki/conf/settings.py @@ -1,5 +1,4 @@ import bleach - from django.apps import apps from django.conf import settings as django_settings from django.contrib.messages import constants as messages diff --git a/src/wiki/core/markdown/__init__.py b/src/wiki/core/markdown/__init__.py index c8446c23..4c89c1f1 100644 --- a/src/wiki/core/markdown/__init__.py +++ b/src/wiki/core/markdown/__init__.py @@ -1,10 +1,9 @@ import bleach import markdown - from wiki.conf import settings +from wiki.core.markdown.mdx.codehilite import WikiCodeHiliteExtension from wiki.core.markdown.mdx.previewlinks import PreviewLinksExtension from wiki.core.markdown.mdx.responsivetable import ResponsiveTableExtension -from wiki.core.markdown.mdx.codehilite import WikiCodeHiliteExtension from wiki.core.plugins import registry as plugin_registry diff --git a/src/wiki/core/permissions.py b/src/wiki/core/permissions.py index cc826bc2..140bfde7 100644 --- a/src/wiki/core/permissions.py +++ b/src/wiki/core/permissions.py @@ -1,6 +1,5 @@ from wiki.conf import settings - ############################### # ARTICLE PERMISSION HANDLING # ############################### diff --git a/src/wiki/decorators.py b/src/wiki/decorators.py index 329b2c6c..531eb23f 100644 --- a/src/wiki/decorators.py +++ b/src/wiki/decorators.py @@ -1,10 +1,9 @@ from functools import wraps -from django.urls import reverse -from django.http import (HttpResponseForbidden, HttpResponseNotFound, - HttpResponseRedirect) +from django.http import HttpResponseForbidden, HttpResponseNotFound, HttpResponseRedirect from django.shortcuts import get_object_or_404, redirect from django.template.loader import render_to_string +from django.urls import reverse from django.utils.http import urlquote from wiki.conf import settings from wiki.core.exceptions import NoRootURL diff --git a/src/wiki/editors/__init__.py b/src/wiki/editors/__init__.py index 2fb0aa58..7fd6550d 100644 --- a/src/wiki/editors/__init__.py +++ b/src/wiki/editors/__init__.py @@ -1,5 +1,5 @@ -from wiki.conf import settings from django.urls import get_callable +from wiki.conf import settings _EditorClass = None _editor = None diff --git a/src/wiki/editors/markitup.py b/src/wiki/editors/markitup.py index 0f10be62..2e1336eb 100644 --- a/src/wiki/editors/markitup.py +++ b/src/wiki/editors/markitup.py @@ -3,7 +3,6 @@ from django.forms.utils import flatatt from django.utils.encoding import force_text from django.utils.html import conditional_escape from django.utils.safestring import mark_safe - from wiki.compat import BuildAttrsCompat from wiki.editors.base import BaseEditor diff --git a/src/wiki/forms.py b/src/wiki/forms.py index 436136ae..5d4b9c86 100644 --- a/src/wiki/forms.py +++ b/src/wiki/forms.py @@ -8,22 +8,19 @@ from django.apps import apps from django.contrib.auth import get_user_model from django.contrib.auth.forms import UserCreationForm from django.core import validators -from django.urls import Resolver404, resolve from django.core.validators import RegexValidator from django.forms.utils import flatatt from django.forms.widgets import HiddenInput from django.shortcuts import get_object_or_404 +from django.urls import Resolver404, resolve from django.utils import timezone from django.utils.encoding import force_text from django.utils.html import conditional_escape, escape from django.utils.safestring import mark_safe -from django.utils.translation import pgettext_lazy -from django.utils.translation import gettext -from django.utils.translation import gettext_lazy as _ - +from django.utils.translation import gettext, gettext_lazy as _, pgettext_lazy from wiki import models -from wiki.conf import settings from wiki.compat import BuildAttrsCompat +from wiki.conf import settings from wiki.core import permissions from wiki.core.diff import simple_merge from wiki.core.plugins.base import PluginSettingsFormMixin diff --git a/src/wiki/managers.py b/src/wiki/managers.py index c2434a6b..7ea0fb65 100644 --- a/src/wiki/managers.py +++ b/src/wiki/managers.py @@ -1,5 +1,5 @@ from django.db import models -from django.db.models import Q, Count +from django.db.models import Count, Q from django.db.models.query import EmptyQuerySet, QuerySet from mptt.managers import TreeManager diff --git a/src/wiki/migrations/0001_initial.py b/src/wiki/migrations/0001_initial.py index 6e31069f..3b2f17d5 100644 --- a/src/wiki/migrations/0001_initial.py +++ b/src/wiki/migrations/0001_initial.py @@ -3,7 +3,6 @@ import mptt.fields from django.conf import settings from django.db import migrations, models from django.db.models.fields import GenericIPAddressField as IPAddressField - from wiki.conf.settings import GROUP_MODEL diff --git a/src/wiki/models/__init__.py b/src/wiki/models/__init__.py index b89415fb..e2a31b84 100644 --- a/src/wiki/models/__init__.py +++ b/src/wiki/models/__init__.py @@ -1,12 +1,10 @@ +from django import shortcuts, urls from django.urls import base -from django import urls -from django import shortcuts +from django.utils.functional import lazy from .article import * # noqa from .pluginbase import * # noqa from .urlpath import * # noqa -from django.utils.functional import lazy - original_django_reverse = urls.reverse diff --git a/src/wiki/models/article.py b/src/wiki/models/article.py index 7e53255c..f5accc27 100644 --- a/src/wiki/models/article.py +++ b/src/wiki/models/article.py @@ -2,10 +2,10 @@ from django.conf import settings as django_settings from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django.core.cache import cache -from django.urls import reverse from django.db import models from django.db.models.fields import GenericIPAddressField as IPAddressField from django.db.models.signals import post_save, pre_delete, pre_save +from django.urls import reverse from django.utils import translation from django.utils.safestring import mark_safe from django.utils.translation import gettext_lazy as _ @@ -16,7 +16,6 @@ from wiki.core import permissions from wiki.core.markdown import article_markdown from wiki.decorators import disable_signal_for_loaddata - __all__ = [ 'Article', 'ArticleForObject', 'ArticleRevision', 'BaseRevisionMixin', diff --git a/src/wiki/models/pluginbase.py b/src/wiki/models/pluginbase.py index 819d5301..98a8f459 100644 --- a/src/wiki/models/pluginbase.py +++ b/src/wiki/models/pluginbase.py @@ -25,7 +25,6 @@ from wiki.decorators import disable_signal_for_loaddata from .article import ArticleRevision, BaseRevisionMixin - __all__ = [ 'ArticlePlugin', 'SimplePlugin', 'SimplePluginCreateError', diff --git a/src/wiki/models/urlpath.py b/src/wiki/models/urlpath.py index 8c36420d..7104eaa5 100644 --- a/src/wiki/models/urlpath.py +++ b/src/wiki/models/urlpath.py @@ -5,12 +5,11 @@ from django.contrib.contenttypes.fields import GenericRelation from django.contrib.contenttypes.models import ContentType from django.contrib.sites.models import Site from django.core.exceptions import ValidationError -from django.urls import reverse from django.db import models, transaction from django.db.models.signals import post_save, pre_delete +from django.urls import reverse # Django 1.6 transaction API, required for 1.8+ -from django.utils.translation import gettext_lazy as _ -from django.utils.translation import gettext +from django.utils.translation import gettext, gettext_lazy as _ from mptt.fields import TreeForeignKey from mptt.models import MPTTModel from wiki import managers @@ -19,7 +18,6 @@ from wiki.core.exceptions import MultipleRootURLs, NoRootURL from wiki.decorators import disable_signal_for_loaddata from wiki.models.article import Article, ArticleForObject, ArticleRevision - __all__ = [ 'URLPath', ] diff --git a/src/wiki/plugins/attachments/forms.py b/src/wiki/plugins/attachments/forms.py index 5be23f3e..1215e6af 100644 --- a/src/wiki/plugins/attachments/forms.py +++ b/src/wiki/plugins/attachments/forms.py @@ -3,8 +3,7 @@ import zipfile from django import forms from django.core.files.uploadedfile import File -from django.utils.translation import gettext_lazy as _ -from django.utils.translation import gettext +from django.utils.translation import gettext, gettext_lazy as _ from wiki.core.permissions import can_moderate from wiki.plugins.attachments import models from wiki.plugins.attachments.models import IllegalFileExtension diff --git a/src/wiki/plugins/attachments/markdown_extensions.py b/src/wiki/plugins/attachments/markdown_extensions.py index 848f063c..88851e44 100644 --- a/src/wiki/plugins/attachments/markdown_extensions.py +++ b/src/wiki/plugins/attachments/markdown_extensions.py @@ -2,8 +2,8 @@ import re import markdown from django.contrib.auth.models import AnonymousUser -from django.urls import reverse from django.template.loader import render_to_string +from django.urls import reverse from wiki.core.permissions import can_read from wiki.plugins.attachments import models diff --git a/src/wiki/plugins/attachments/migrations/0001_initial.py b/src/wiki/plugins/attachments/migrations/0001_initial.py index 3e0a2ccf..11de0079 100644 --- a/src/wiki/plugins/attachments/migrations/0001_initial.py +++ b/src/wiki/plugins/attachments/migrations/0001_initial.py @@ -1,10 +1,9 @@ import django.db.models.deletion +import wiki.plugins.attachments.models from django.conf import settings from django.db import migrations, models from django.db.models.fields import GenericIPAddressField as IPAddressField -import wiki.plugins.attachments.models - class Migration(migrations.Migration): diff --git a/src/wiki/plugins/attachments/models.py b/src/wiki/plugins/attachments/models.py index 1154ef0d..4ac40883 100644 --- a/src/wiki/plugins/attachments/models.py +++ b/src/wiki/plugins/attachments/models.py @@ -3,8 +3,7 @@ import os from django.conf import settings as django_settings from django.db import models from django.db.models import signals -from django.utils.translation import gettext_lazy as _ -from django.utils.translation import gettext +from django.utils.translation import gettext, gettext_lazy as _ from wiki import managers from wiki.decorators import disable_signal_for_loaddata from wiki.models.article import BaseRevisionMixin diff --git a/src/wiki/plugins/haystack/__init__.py b/src/wiki/plugins/haystack/__init__.py index a9a28dcc..10e233e2 100644 --- a/src/wiki/plugins/haystack/__init__.py +++ b/src/wiki/plugins/haystack/__init__.py @@ -1,11 +1,10 @@ -from wiki.conf import settings -from wiki.core import permissions -from wiki import models - -from haystack import views as haystack_views from django.db.models import Q -from django.utils.decorators import classonlymethod from django.shortcuts import redirect +from django.utils.decorators import classonlymethod +from haystack import views as haystack_views +from wiki import models +from wiki.conf import settings +from wiki.core import permissions class SearchViewHaystack(haystack_views.SearchView): diff --git a/src/wiki/plugins/images/forms.py b/src/wiki/plugins/images/forms.py index 6311cf84..ca5f9a68 100644 --- a/src/wiki/plugins/images/forms.py +++ b/src/wiki/plugins/images/forms.py @@ -1,6 +1,5 @@ from django import forms -from django.utils.translation import gettext_lazy as _ -from django.utils.translation import gettext +from django.utils.translation import gettext, gettext_lazy as _ from wiki.core.plugins.base import PluginSidebarFormMixin from wiki.plugins.images import models diff --git a/src/wiki/plugins/images/models.py b/src/wiki/plugins/images/models.py index 5bff00dc..227adb6b 100644 --- a/src/wiki/plugins/images/models.py +++ b/src/wiki/plugins/images/models.py @@ -5,8 +5,7 @@ from django.conf import settings as django_settings from django.core.exceptions import ImproperlyConfigured from django.db import models from django.db.models import signals -from django.utils.translation import gettext_lazy as _ -from django.utils.translation import gettext +from django.utils.translation import gettext, gettext_lazy as _ from wiki.models.pluginbase import RevisionPlugin, RevisionPluginRevision from . import settings diff --git a/src/wiki/plugins/images/views.py b/src/wiki/plugins/images/views.py index 678c9da4..a1e41f32 100644 --- a/src/wiki/plugins/images/views.py +++ b/src/wiki/plugins/images/views.py @@ -1,8 +1,8 @@ import logging from django.contrib import messages -from django.urls import reverse from django.shortcuts import get_object_or_404, redirect +from django.urls import reverse from django.utils.decorators import method_decorator from django.utils.translation import gettext as _ from django.views.generic.base import RedirectView diff --git a/src/wiki/plugins/links/mdx/djangowikilinks.py b/src/wiki/plugins/links/mdx/djangowikilinks.py index 9dd4b2f8..a0cef9fb 100755 --- a/src/wiki/plugins/links/mdx/djangowikilinks.py +++ b/src/wiki/plugins/links/mdx/djangowikilinks.py @@ -23,7 +23,6 @@ from os import path as os_path import markdown from markdown.util import etree - from wiki import models diff --git a/src/wiki/plugins/notifications/forms.py b/src/wiki/plugins/notifications/forms.py index 8b33dec7..2a606f68 100644 --- a/src/wiki/plugins/notifications/forms.py +++ b/src/wiki/plugins/notifications/forms.py @@ -2,8 +2,7 @@ from django import forms from django.contrib.contenttypes.models import ContentType from django.forms.models import BaseModelFormSet, modelformset_factory from django.utils.safestring import mark_safe -from django.utils.translation import gettext_lazy as _ -from django.utils.translation import gettext +from django.utils.translation import gettext, gettext_lazy as _ from django_nyt.models import NotificationType, Settings, Subscription from wiki.core.plugins.base import PluginSettingsFormMixin from wiki.plugins.notifications import models diff --git a/src/wiki/plugins/notifications/management/commands/wiki_notifications_create_defaults.py b/src/wiki/plugins/notifications/management/commands/wiki_notifications_create_defaults.py index bf8e5dd5..b4191892 100644 --- a/src/wiki/plugins/notifications/management/commands/wiki_notifications_create_defaults.py +++ b/src/wiki/plugins/notifications/management/commands/wiki_notifications_create_defaults.py @@ -4,7 +4,6 @@ from django.core.management.base import BaseCommand from django.utils import translation from django_nyt.models import Settings from django_nyt.utils import subscribe - from wiki.models import Article from wiki.plugins.notifications import models from wiki.plugins.notifications.settings import ARTICLE_EDIT diff --git a/src/wiki/templatetags/wiki_tags.py b/src/wiki/templatetags/wiki_tags.py index 92562645..4a97efc0 100644 --- a/src/wiki/templatetags/wiki_tags.py +++ b/src/wiki/templatetags/wiki_tags.py @@ -1,7 +1,7 @@ import re -from django.apps import apps from django import template +from django.apps import apps from django.conf import settings as django_settings from django.contrib.contenttypes.models import ContentType from django.db.models import Model diff --git a/src/wiki/views/accounts.py b/src/wiki/views/accounts.py index 165b7bc8..47333099 100644 --- a/src/wiki/views/accounts.py +++ b/src/wiki/views/accounts.py @@ -11,11 +11,10 @@ SETTINGS.LOGOUT_URL from django.conf import settings as django_settings from django.contrib import messages -from django.contrib.auth import get_user_model, login as auth_login -from django.contrib.auth import logout as auth_logout +from django.contrib.auth import get_user_model, login as auth_login, logout as auth_logout from django.contrib.auth.forms import AuthenticationForm -from django.urls import reverse from django.shortcuts import get_object_or_404, redirect, render +from django.urls import reverse from django.utils.translation import gettext as _ from django.views.generic.base import View from django.views.generic.edit import CreateView, FormView, UpdateView diff --git a/src/wiki/views/article.py b/src/wiki/views/article.py index 5587806a..0534b2e0 100644 --- a/src/wiki/views/article.py +++ b/src/wiki/views/article.py @@ -4,14 +4,13 @@ from urllib.parse import urljoin from django.contrib import messages from django.contrib.auth.decorators import login_required -from django.urls import reverse from django.db import transaction from django.db.models import Q from django.http import Http404 from django.shortcuts import get_object_or_404, redirect, render +from django.urls import reverse from django.utils.decorators import method_decorator -from django.utils.translation import gettext as _ -from django.utils.translation import ngettext +from django.utils.translation import gettext as _, ngettext from django.views.generic import DetailView from django.views.generic.base import RedirectView, TemplateView, View from django.views.generic.edit import FormView diff --git a/testproject/testproject/settings/base.py b/testproject/testproject/settings/base.py index 1f54d1e9..9f66e2da 100644 --- a/testproject/testproject/settings/base.py +++ b/testproject/testproject/settings/base.py @@ -12,7 +12,6 @@ import os from django.urls import reverse_lazy - PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) BASE_DIR = os.path.dirname(PROJECT_DIR) diff --git a/testproject/testproject/settings/customauthuser.py b/testproject/testproject/settings/customauthuser.py index b00496af..01f8769b 100644 --- a/testproject/testproject/settings/customauthuser.py +++ b/testproject/testproject/settings/customauthuser.py @@ -2,7 +2,6 @@ import os # noqa @UnusedImport from .base import * # noqa @UnusedWildImport - DATABASES = { 'default': { # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. diff --git a/testproject/testproject/settings/haystack.py b/testproject/testproject/settings/haystack.py index d7cfa83b..3fc578ed 100644 --- a/testproject/testproject/settings/haystack.py +++ b/testproject/testproject/settings/haystack.py @@ -1,6 +1,5 @@ from .base import * # noqa @UnusedWildImport - # Django Haystack HAYSTACK_WHOOSH_PATH = os.path.join(PROJECT_DIR, 'index_woosh') diff --git a/testproject/testproject/settings/sendfile.py b/testproject/testproject/settings/sendfile.py index d0ec562e..0d05286e 100644 --- a/testproject/testproject/settings/sendfile.py +++ b/testproject/testproject/settings/sendfile.py @@ -1,6 +1,5 @@ from .base import * # noqa @UnusedWildImport - INSTALLED_APPS += ['sendfile'] WIKI_ATTACHMENTS_USE_SENDFILE = True diff --git a/tests/base.py b/tests/base.py index cf4b8899..3f058bb6 100644 --- a/tests/base.py +++ b/tests/base.py @@ -3,10 +3,9 @@ import unittest import django_functest from django.contrib.staticfiles.testing import StaticLiveServerTestCase -from django.urls import reverse from django.template import Context, Template from django.test import TestCase, override_settings - +from django.urls import reverse from wiki.models import URLPath SUPERUSER1_USERNAME = 'admin' diff --git a/tests/core/test_accounts.py b/tests/core/test_accounts.py index 5ad8c98c..66571436 100644 --- a/tests/core/test_accounts.py +++ b/tests/core/test_accounts.py @@ -6,9 +6,9 @@ from django.shortcuts import resolve_url from wiki.conf import settings as wiki_settings from wiki.models import reverse -from ..base import (SUPERUSER1_PASSWORD, SUPERUSER1_USERNAME, - ArticleWebTestUtils, DjangoClientTestBase, - RequireRootArticleMixin, TestBase, wiki_override_settings) +from ..base import ( + SUPERUSER1_PASSWORD, SUPERUSER1_USERNAME, ArticleWebTestUtils, DjangoClientTestBase, RequireRootArticleMixin, TestBase, wiki_override_settings, +) from ..testdata.models import CustomUser diff --git a/tests/core/test_basic.py b/tests/core/test_basic.py index ebc12297..2e402322 100644 --- a/tests/core/test_basic.py +++ b/tests/core/test_basic.py @@ -1,8 +1,8 @@ from django.test import TestCase - from wiki.conf import settings as wiki_settings from wiki.forms import Group from wiki.models import URLPath + from ..base import wiki_override_settings from ..testdata.models import CustomGroup diff --git a/tests/core/test_checks.py b/tests/core/test_checks.py index 449eea30..b46cf3b1 100644 --- a/tests/core/test_checks.py +++ b/tests/core/test_checks.py @@ -1,9 +1,9 @@ import copy from django.conf import settings -from django.test import TestCase from django.core.checks import Error, registry -from wiki.checks import REQUIRED_CONTEXT_PROCESSORS, REQUIRED_INSTALLED_APPS, OBSOLETE_INSTALLED_APPS, Tags +from django.test import TestCase +from wiki.checks import OBSOLETE_INSTALLED_APPS, REQUIRED_CONTEXT_PROCESSORS, REQUIRED_INSTALLED_APPS, Tags class CheckTests(TestCase): diff --git a/tests/core/test_forms.py b/tests/core/test_forms.py index d4d18651..26bdbcf0 100644 --- a/tests/core/test_forms.py +++ b/tests/core/test_forms.py @@ -1,6 +1,5 @@ from django.test import TestCase from django.utils.translation import gettext - from tests.base import DjangoClientTestBase, RequireRootArticleMixin from wiki.forms import DeleteForm, UserCreationForm diff --git a/tests/core/test_models.py b/tests/core/test_models.py index 2b1e9d59..2f77c5af 100644 --- a/tests/core/test_models.py +++ b/tests/core/test_models.py @@ -2,14 +2,12 @@ from django.apps import apps from django.contrib.auth import get_user_model from django.contrib.sites.models import Site from django.test.testcases import TestCase - from wiki.compat import include, url from wiki.conf import settings from wiki.managers import ArticleManager from wiki.models import Article, ArticleRevision, URLPath from wiki.urls import WikiURLPatterns - User = get_user_model() Group = apps.get_model(settings.GROUP_MODEL) diff --git a/tests/core/test_template_filters.py b/tests/core/test_template_filters.py index 5f542569..9a2186f2 100644 --- a/tests/core/test_template_filters.py +++ b/tests/core/test_template_filters.py @@ -1,8 +1,7 @@ from django.contrib.auth import get_user_model from wiki.models import Article, ArticleRevision -from wiki.templatetags.wiki_tags import (can_delete, can_moderate, can_read, - can_write, get_content_snippet, - is_locked) +from wiki.templatetags.wiki_tags import can_delete, can_moderate, can_read, can_write, get_content_snippet, is_locked + from ..base import TemplateTestCase, wiki_override_settings User = get_user_model() diff --git a/tests/core/test_template_tags.py b/tests/core/test_template_tags.py index 52e38151..5e4374c5 100644 --- a/tests/core/test_template_tags.py +++ b/tests/core/test_template_tags.py @@ -4,12 +4,11 @@ Almost all test cases covers both tag calling and template using. from django.conf import settings as django_settings from django.contrib.contenttypes.models import ContentType from django.http import HttpRequest - from wiki.conf import settings from wiki.forms import CreateRootForm from wiki.models import Article, ArticleForObject, ArticleRevision -from wiki.templatetags.wiki_tags import (article_for_object, login_url, - wiki_form, wiki_render) +from wiki.templatetags.wiki_tags import article_for_object, login_url, wiki_form, wiki_render + from ..base import TemplateTestCase if not django_settings.configured: diff --git a/tests/core/test_urls.py b/tests/core/test_urls.py index e40f031a..662294d4 100644 --- a/tests/core/test_urls.py +++ b/tests/core/test_urls.py @@ -4,12 +4,10 @@ from django.test.testcases import TestCase from django_nyt.urls import get_pattern as get_notify_pattern from wiki.compat import include, url from wiki.models import Article, URLPath -from wiki.urls import get_pattern as get_wiki_pattern -from wiki.urls import WikiURLPatterns +from wiki.urls import WikiURLPatterns, get_pattern as get_wiki_pattern from ..base import wiki_override_settings - User = get_user_model() diff --git a/tests/core/test_views.py b/tests/core/test_views.py index 47e3a2bf..60b9eabf 100644 --- a/tests/core/test_views.py +++ b/tests/core/test_views.py @@ -8,8 +8,7 @@ from wiki import models from wiki.forms import validate_slug_numbers from wiki.models import ArticleRevision, URLPath, reverse -from ..base import (ArticleWebTestUtils, DjangoClientTestBase, - RequireRootArticleMixin, SeleniumBase, WebTestBase) +from ..base import ArticleWebTestUtils, DjangoClientTestBase, RequireRootArticleMixin, SeleniumBase, WebTestBase class RootArticleViewTestsBase(FuncBaseMixin): diff --git a/tests/plugins/attachments/test_views.py b/tests/plugins/attachments/test_views.py index ae5295f7..4efe9abf 100644 --- a/tests/plugins/attachments/test_views.py +++ b/tests/plugins/attachments/test_views.py @@ -4,7 +4,7 @@ from django.core.files.uploadedfile import InMemoryUploadedFile from django.urls import reverse from wiki.models import URLPath -from ...base import RequireRootArticleMixin, ArticleWebTestUtils, DjangoClientTestBase +from ...base import ArticleWebTestUtils, DjangoClientTestBase, RequireRootArticleMixin class AttachmentTests(RequireRootArticleMixin, ArticleWebTestUtils, DjangoClientTestBase): diff --git a/tests/plugins/globalhistory/test_globalhistory.py b/tests/plugins/globalhistory/test_globalhistory.py index b3ef8eff..a902584c 100644 --- a/tests/plugins/globalhistory/test_globalhistory.py +++ b/tests/plugins/globalhistory/test_globalhistory.py @@ -1,8 +1,7 @@ from django.urls import reverse from wiki.models import URLPath -from ...base import (ArticleWebTestUtils, DjangoClientTestBase, - RequireRootArticleMixin) +from ...base import ArticleWebTestUtils, DjangoClientTestBase, RequireRootArticleMixin class GlobalhistoryTests(RequireRootArticleMixin, ArticleWebTestUtils, DjangoClientTestBase): diff --git a/tests/plugins/images/test_views.py b/tests/plugins/images/test_views.py index 67744ede..22804b78 100644 --- a/tests/plugins/images/test_views.py +++ b/tests/plugins/images/test_views.py @@ -8,8 +8,7 @@ from wiki.models import URLPath from wiki.plugins.images import models from wiki.plugins.images.wiki_plugin import ImagePlugin -from ...base import (ArticleWebTestUtils, DjangoClientTestBase, - RequireRootArticleMixin) +from ...base import ArticleWebTestUtils, DjangoClientTestBase, RequireRootArticleMixin class ImageTests(RequireRootArticleMixin, ArticleWebTestUtils, DjangoClientTestBase): diff --git a/tests/plugins/links/test_links.py b/tests/plugins/links/test_links.py index 26fa78ed..38908d7c 100644 --- a/tests/plugins/links/test_links.py +++ b/tests/plugins/links/test_links.py @@ -1,6 +1,6 @@ import markdown -from django.urls import reverse_lazy from django.test import TestCase +from django.urls import reverse_lazy from wiki.models import URLPath from wiki.plugins.links.mdx.djangowikilinks import WikiPathExtension diff --git a/tests/settings.py b/tests/settings.py index 8a28cb97..61deabe8 100644 --- a/tests/settings.py +++ b/tests/settings.py @@ -2,7 +2,6 @@ import os from django.urls import reverse_lazy - TESTS_DATA_ROOT = os.path.dirname(__file__) MEDIA_ROOT = os.path.join(TESTS_DATA_ROOT, 'media') -- 2.45.2