From cde31daf8815e05b4b86b857b49fb0e31e1f0a38 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Thu, 1 Jun 2017 13:23:48 -0400 Subject: [PATCH] Sorted imports per isort 4.2.9. --- django/contrib/gis/db/backends/mysql/base.py | 5 +++-- django/contrib/gis/db/backends/mysql/features.py | 5 +++-- django/contrib/gis/db/backends/mysql/operations.py | 5 +++-- django/contrib/gis/db/backends/oracle/base.py | 5 +++-- django/contrib/gis/db/backends/oracle/features.py | 5 +++-- django/contrib/gis/db/backends/oracle/operations.py | 5 +++-- django/contrib/gis/db/backends/postgis/base.py | 5 +++-- django/contrib/gis/db/backends/postgis/features.py | 5 +++-- django/contrib/gis/db/backends/postgis/operations.py | 5 +++-- django/contrib/gis/db/backends/spatialite/features.py | 5 +++-- .../contrib/gis/db/backends/spatialite/operations.py | 5 +++-- django/contrib/gis/management/commands/inspectdb.py | 5 +++-- .../staticfiles/management/commands/runserver.py | 5 +++-- django/core/mail/backends/filebased.py | 5 +++-- tests/backends/test_creation.py | 10 ++++++---- tests/base/models.py | 1 - tests/foreign_object/tests.py | 1 - tests/i18n/test_compilation.py | 5 +++-- tests/i18n/test_extraction.py | 5 +++-- tests/model_inheritance/models.py | 1 - tests/model_options/models/tablespaces.py | 1 - tests/prefetch_related/models.py | 2 -- tests/proxy_models/models.py | 1 - tests/select_related/models.py | 1 - tests/serializers/test_data.py | 1 - tests/sessions_tests/tests.py | 10 ++++++---- tests/staticfiles_tests/test_storage.py | 5 +++-- tests/unmanaged_models/models.py | 1 - 28 files changed, 63 insertions(+), 52 deletions(-) diff --git a/django/contrib/gis/db/backends/mysql/base.py b/django/contrib/gis/db/backends/mysql/base.py index 9cf61e40d2..fccea5919d 100644 --- a/django/contrib/gis/db/backends/mysql/base.py +++ b/django/contrib/gis/db/backends/mysql/base.py @@ -1,5 +1,6 @@ -from django.db.backends.mysql.base import \ - DatabaseWrapper as MySQLDatabaseWrapper +from django.db.backends.mysql.base import ( + DatabaseWrapper as MySQLDatabaseWrapper, +) from .features import DatabaseFeatures from .introspection import MySQLIntrospection diff --git a/django/contrib/gis/db/backends/mysql/features.py b/django/contrib/gis/db/backends/mysql/features.py index 05affeecb7..9d4f8982d5 100644 --- a/django/contrib/gis/db/backends/mysql/features.py +++ b/django/contrib/gis/db/backends/mysql/features.py @@ -1,6 +1,7 @@ from django.contrib.gis.db.backends.base.features import BaseSpatialFeatures -from django.db.backends.mysql.features import \ - DatabaseFeatures as MySQLDatabaseFeatures +from django.db.backends.mysql.features import ( + DatabaseFeatures as MySQLDatabaseFeatures, +) class DatabaseFeatures(BaseSpatialFeatures, MySQLDatabaseFeatures): diff --git a/django/contrib/gis/db/backends/mysql/operations.py b/django/contrib/gis/db/backends/mysql/operations.py index 1c850b39d1..b2ffd73928 100644 --- a/django/contrib/gis/db/backends/mysql/operations.py +++ b/django/contrib/gis/db/backends/mysql/operations.py @@ -1,6 +1,7 @@ from django.contrib.gis.db.backends.base.adapter import WKTAdapter -from django.contrib.gis.db.backends.base.operations import \ - BaseSpatialOperations +from django.contrib.gis.db.backends.base.operations import ( + BaseSpatialOperations, +) from django.contrib.gis.db.backends.utils import SpatialOperator from django.contrib.gis.db.models import GeometryField, aggregates from django.db.backends.mysql.operations import DatabaseOperations diff --git a/django/contrib/gis/db/backends/oracle/base.py b/django/contrib/gis/db/backends/oracle/base.py index a4f6684f6d..0093ef83bb 100644 --- a/django/contrib/gis/db/backends/oracle/base.py +++ b/django/contrib/gis/db/backends/oracle/base.py @@ -1,5 +1,6 @@ -from django.db.backends.oracle.base import \ - DatabaseWrapper as OracleDatabaseWrapper +from django.db.backends.oracle.base import ( + DatabaseWrapper as OracleDatabaseWrapper, +) from .features import DatabaseFeatures from .introspection import OracleIntrospection diff --git a/django/contrib/gis/db/backends/oracle/features.py b/django/contrib/gis/db/backends/oracle/features.py index 996fe8e54b..ece45b2623 100644 --- a/django/contrib/gis/db/backends/oracle/features.py +++ b/django/contrib/gis/db/backends/oracle/features.py @@ -1,6 +1,7 @@ from django.contrib.gis.db.backends.base.features import BaseSpatialFeatures -from django.db.backends.oracle.features import \ - DatabaseFeatures as OracleDatabaseFeatures +from django.db.backends.oracle.features import ( + DatabaseFeatures as OracleDatabaseFeatures, +) class DatabaseFeatures(BaseSpatialFeatures, OracleDatabaseFeatures): diff --git a/django/contrib/gis/db/backends/oracle/operations.py b/django/contrib/gis/db/backends/oracle/operations.py index 50f5bed8b9..d40121e850 100644 --- a/django/contrib/gis/db/backends/oracle/operations.py +++ b/django/contrib/gis/db/backends/oracle/operations.py @@ -9,8 +9,9 @@ """ import re -from django.contrib.gis.db.backends.base.operations import \ - BaseSpatialOperations +from django.contrib.gis.db.backends.base.operations import ( + BaseSpatialOperations, +) from django.contrib.gis.db.backends.oracle.adapter import OracleSpatialAdapter from django.contrib.gis.db.backends.utils import SpatialOperator from django.contrib.gis.db.models import aggregates diff --git a/django/contrib/gis/db/backends/postgis/base.py b/django/contrib/gis/db/backends/postgis/base.py index c14df8ccfa..5b93d7cf1e 100644 --- a/django/contrib/gis/db/backends/postgis/base.py +++ b/django/contrib/gis/db/backends/postgis/base.py @@ -1,6 +1,7 @@ from django.db.backends.base.base import NO_DB_ALIAS -from django.db.backends.postgresql.base import \ - DatabaseWrapper as Psycopg2DatabaseWrapper +from django.db.backends.postgresql.base import ( + DatabaseWrapper as Psycopg2DatabaseWrapper, +) from .features import DatabaseFeatures from .introspection import PostGISIntrospection diff --git a/django/contrib/gis/db/backends/postgis/features.py b/django/contrib/gis/db/backends/postgis/features.py index 2d613efe6e..60158ca5c3 100644 --- a/django/contrib/gis/db/backends/postgis/features.py +++ b/django/contrib/gis/db/backends/postgis/features.py @@ -1,6 +1,7 @@ from django.contrib.gis.db.backends.base.features import BaseSpatialFeatures -from django.db.backends.postgresql.features import \ - DatabaseFeatures as Psycopg2DatabaseFeatures +from django.db.backends.postgresql.features import ( + DatabaseFeatures as Psycopg2DatabaseFeatures, +) class DatabaseFeatures(BaseSpatialFeatures, Psycopg2DatabaseFeatures): diff --git a/django/contrib/gis/db/backends/postgis/operations.py b/django/contrib/gis/db/backends/postgis/operations.py index 71302d9eb7..ef443c47d6 100644 --- a/django/contrib/gis/db/backends/postgis/operations.py +++ b/django/contrib/gis/db/backends/postgis/operations.py @@ -1,8 +1,9 @@ import re from django.conf import settings -from django.contrib.gis.db.backends.base.operations import \ - BaseSpatialOperations +from django.contrib.gis.db.backends.base.operations import ( + BaseSpatialOperations, +) from django.contrib.gis.db.backends.utils import SpatialOperator from django.contrib.gis.gdal import GDALRaster from django.contrib.gis.measure import Distance diff --git a/django/contrib/gis/db/backends/spatialite/features.py b/django/contrib/gis/db/backends/spatialite/features.py index 19235dea95..319f81c4e1 100644 --- a/django/contrib/gis/db/backends/spatialite/features.py +++ b/django/contrib/gis/db/backends/spatialite/features.py @@ -1,6 +1,7 @@ from django.contrib.gis.db.backends.base.features import BaseSpatialFeatures -from django.db.backends.sqlite3.features import \ - DatabaseFeatures as SQLiteDatabaseFeatures +from django.db.backends.sqlite3.features import ( + DatabaseFeatures as SQLiteDatabaseFeatures, +) from django.utils.functional import cached_property diff --git a/django/contrib/gis/db/backends/spatialite/operations.py b/django/contrib/gis/db/backends/spatialite/operations.py index 087a879d07..3458239bed 100644 --- a/django/contrib/gis/db/backends/spatialite/operations.py +++ b/django/contrib/gis/db/backends/spatialite/operations.py @@ -5,8 +5,9 @@ https://www.gaia-gis.it/gaia-sins/spatialite-sql-4.2.1.html """ import re -from django.contrib.gis.db.backends.base.operations import \ - BaseSpatialOperations +from django.contrib.gis.db.backends.base.operations import ( + BaseSpatialOperations, +) from django.contrib.gis.db.backends.spatialite.adapter import SpatiaLiteAdapter from django.contrib.gis.db.backends.utils import SpatialOperator from django.contrib.gis.db.models import aggregates diff --git a/django/contrib/gis/management/commands/inspectdb.py b/django/contrib/gis/management/commands/inspectdb.py index 012ca14fed..af70d6015a 100644 --- a/django/contrib/gis/management/commands/inspectdb.py +++ b/django/contrib/gis/management/commands/inspectdb.py @@ -1,5 +1,6 @@ -from django.core.management.commands.inspectdb import \ - Command as InspectDBCommand +from django.core.management.commands.inspectdb import ( + Command as InspectDBCommand, +) class Command(InspectDBCommand): diff --git a/django/contrib/staticfiles/management/commands/runserver.py b/django/contrib/staticfiles/management/commands/runserver.py index 8a3dcc83e1..fe050f4dfa 100644 --- a/django/contrib/staticfiles/management/commands/runserver.py +++ b/django/contrib/staticfiles/management/commands/runserver.py @@ -1,7 +1,8 @@ from django.conf import settings from django.contrib.staticfiles.handlers import StaticFilesHandler -from django.core.management.commands.runserver import \ - Command as RunserverCommand +from django.core.management.commands.runserver import ( + Command as RunserverCommand, +) class Command(RunserverCommand): diff --git a/django/core/mail/backends/filebased.py b/django/core/mail/backends/filebased.py index e956a3367a..2d1238665e 100644 --- a/django/core/mail/backends/filebased.py +++ b/django/core/mail/backends/filebased.py @@ -5,8 +5,9 @@ import os from django.conf import settings from django.core.exceptions import ImproperlyConfigured -from django.core.mail.backends.console import \ - EmailBackend as ConsoleEmailBackend +from django.core.mail.backends.console import ( + EmailBackend as ConsoleEmailBackend, +) class EmailBackend(ConsoleEmailBackend): diff --git a/tests/backends/test_creation.py b/tests/backends/test_creation.py index 90ea59086e..4b5d01ea2d 100644 --- a/tests/backends/test_creation.py +++ b/tests/backends/test_creation.py @@ -8,10 +8,12 @@ from django.db import DEFAULT_DB_ALIAS, connection, connections from django.db.backends.base.creation import ( TEST_DATABASE_PREFIX, BaseDatabaseCreation, ) -from django.db.backends.mysql.creation import \ - DatabaseCreation as MySQLDatabaseCreation -from django.db.backends.oracle.creation import \ - DatabaseCreation as OracleDatabaseCreation +from django.db.backends.mysql.creation import ( + DatabaseCreation as MySQLDatabaseCreation, +) +from django.db.backends.oracle.creation import ( + DatabaseCreation as OracleDatabaseCreation, +) from django.db.utils import DatabaseError from django.test import SimpleTestCase, TestCase diff --git a/tests/base/models.py b/tests/base/models.py index b179878704..70088bd96e 100644 --- a/tests/base/models.py +++ b/tests/base/models.py @@ -1,6 +1,5 @@ from django.db import models - # The models definitions below used to crash. Generating models dynamically # at runtime is a bad idea because it pollutes the app registry. This doesn't # integrate well with the test suite but at least it prevents regressions. diff --git a/tests/foreign_object/tests.py b/tests/foreign_object/tests.py index 3c1f5bdfb4..e74732ab72 100644 --- a/tests/foreign_object/tests.py +++ b/tests/foreign_object/tests.py @@ -13,7 +13,6 @@ from .models import ( Group, Membership, NewsArticle, Person, ) - # Note that these tests are testing internal implementation details. # ForeignObject is not part of public API. diff --git a/tests/i18n/test_compilation.py b/tests/i18n/test_compilation.py index 258ab53042..02114fa2dd 100644 --- a/tests/i18n/test_compilation.py +++ b/tests/i18n/test_compilation.py @@ -9,8 +9,9 @@ from unittest import mock from django.core.management import ( CommandError, call_command, execute_from_command_line, ) -from django.core.management.commands.makemessages import \ - Command as MakeMessagesCommand +from django.core.management.commands.makemessages import ( + Command as MakeMessagesCommand, +) from django.core.management.utils import find_command from django.test import SimpleTestCase, override_settings from django.test.utils import captured_stderr, captured_stdout diff --git a/tests/i18n/test_extraction.py b/tests/i18n/test_extraction.py index fc1c68a090..731c29a978 100644 --- a/tests/i18n/test_extraction.py +++ b/tests/i18n/test_extraction.py @@ -11,8 +11,9 @@ from admin_scripts.tests import AdminScriptTestCase from django.core import management from django.core.management import execute_from_command_line from django.core.management.base import CommandError -from django.core.management.commands.makemessages import \ - Command as MakeMessagesCommand +from django.core.management.commands.makemessages import ( + Command as MakeMessagesCommand, +) from django.core.management.utils import find_command from django.test import SimpleTestCase, override_settings from django.test.utils import captured_stderr, captured_stdout diff --git a/tests/model_inheritance/models.py b/tests/model_inheritance/models.py index 86b1cddb8c..a542385d60 100644 --- a/tests/model_inheritance/models.py +++ b/tests/model_inheritance/models.py @@ -13,7 +13,6 @@ Both styles are demonstrated here. """ from django.db import models - # # Abstract base classes # diff --git a/tests/model_options/models/tablespaces.py b/tests/model_options/models/tablespaces.py index ec705b7b2d..0ee0e20ef4 100644 --- a/tests/model_options/models/tablespaces.py +++ b/tests/model_options/models/tablespaces.py @@ -1,6 +1,5 @@ from django.db import models - # Since the test database doesn't have tablespaces, it's impossible for Django # to create the tables for models where db_tablespace is set. To avoid this # problem, we mark the models as unmanaged, and temporarily revert them to diff --git a/tests/prefetch_related/models.py b/tests/prefetch_related/models.py index 8b6b82a31a..08e62c26e0 100644 --- a/tests/prefetch_related/models.py +++ b/tests/prefetch_related/models.py @@ -9,8 +9,6 @@ from django.db.models.query import ModelIterable, QuerySet from django.utils.functional import cached_property -# Basic tests - class Author(models.Model): name = models.CharField(max_length=50, unique=True) first_book = models.ForeignKey('Book', models.CASCADE, related_name='first_time_authors') diff --git a/tests/proxy_models/models.py b/tests/proxy_models/models.py index 2e4679122d..d0603886e0 100644 --- a/tests/proxy_models/models.py +++ b/tests/proxy_models/models.py @@ -6,7 +6,6 @@ providing a modified interface to the data from the base class. """ from django.db import models - # A couple of managers for testing managing overriding in proxy model cases. diff --git a/tests/select_related/models.py b/tests/select_related/models.py index c8ecf831ba..b3f113efa8 100644 --- a/tests/select_related/models.py +++ b/tests/select_related/models.py @@ -13,7 +13,6 @@ from django.contrib.contenttypes.fields import ( from django.contrib.contenttypes.models import ContentType from django.db import models - # Who remembers high school biology? diff --git a/tests/serializers/test_data.py b/tests/serializers/test_data.py index 966df682b2..c56223a1e8 100644 --- a/tests/serializers/test_data.py +++ b/tests/serializers/test_data.py @@ -29,7 +29,6 @@ from .models import ( ) from .tests import register_tests - # A set of functions that can be used to recreate # test data objects of various kinds. # The save method is a raw base model save, to make diff --git a/tests/sessions_tests/tests.py b/tests/sessions_tests/tests.py index 4cbb6c1d51..bd0e3b7668 100644 --- a/tests/sessions_tests/tests.py +++ b/tests/sessions_tests/tests.py @@ -11,12 +11,14 @@ from http import cookies from django.conf import settings from django.contrib.sessions.backends.base import UpdateError from django.contrib.sessions.backends.cache import SessionStore as CacheSession -from django.contrib.sessions.backends.cached_db import \ - SessionStore as CacheDBSession +from django.contrib.sessions.backends.cached_db import ( + SessionStore as CacheDBSession, +) from django.contrib.sessions.backends.db import SessionStore as DatabaseSession from django.contrib.sessions.backends.file import SessionStore as FileSession -from django.contrib.sessions.backends.signed_cookies import \ - SessionStore as CookieSession +from django.contrib.sessions.backends.signed_cookies import ( + SessionStore as CookieSession, +) from django.contrib.sessions.exceptions import InvalidSessionKey from django.contrib.sessions.middleware import SessionMiddleware from django.contrib.sessions.models import Session diff --git a/tests/staticfiles_tests/test_storage.py b/tests/staticfiles_tests/test_storage.py index f5372b22b8..12d4c85c01 100644 --- a/tests/staticfiles_tests/test_storage.py +++ b/tests/staticfiles_tests/test_storage.py @@ -7,8 +7,9 @@ from io import StringIO from django.conf import settings from django.contrib.staticfiles import finders, storage -from django.contrib.staticfiles.management.commands.collectstatic import \ - Command as CollectstaticCommand +from django.contrib.staticfiles.management.commands.collectstatic import ( + Command as CollectstaticCommand, +) from django.core.cache.backends.base import BaseCache from django.core.management import call_command from django.test import override_settings diff --git a/tests/unmanaged_models/models.py b/tests/unmanaged_models/models.py index 13824b7732..c8da49aa07 100644 --- a/tests/unmanaged_models/models.py +++ b/tests/unmanaged_models/models.py @@ -5,7 +5,6 @@ is generated for the table on various manage.py operations. from django.db import models - # All of these models are created in the database by Django.