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 7d8adbf158..a86370121d 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 013ffa74f6..758581a1aa 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 203e3ba075..afcf864680 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 ae0821694a..5cc9039768 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 79517e8190..8a08b7fef1 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 909355b031..31cf624287 100644 --- a/django/contrib/gis/db/backends/spatialite/operations.py +++ b/django/contrib/gis/db/backends/spatialite/operations.py @@ -6,8 +6,9 @@ https://www.gaia-gis.it/gaia-sins/spatialite-sql-4.2.1.html import re import sys -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/geoip/prototypes.py b/django/contrib/gis/geoip/prototypes.py index 74b9b2142f..ed46aebcb9 100644 --- a/django/contrib/gis/geoip/prototypes.py +++ b/django/contrib/gis/geoip/prototypes.py @@ -4,7 +4,6 @@ from django.contrib.gis.geoip.libgeoip import free, lgeoip # #### GeoIP C Structure definitions #### - class GeoIPRecord(Structure): _fields_ = [('country_code', c_char_p), ('country_code3', c_char_p), diff --git a/django/contrib/gis/management/commands/inspectdb.py b/django/contrib/gis/management/commands/inspectdb.py index 27345c59d4..5275175d66 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 c25ac1f369..455d926b3e 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 cfe033fb48..17e89b75a4 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, +) from django.utils import six diff --git a/tests/base/models.py b/tests/base/models.py index 4a8a2ffd81..7a6b114516 100644 --- a/tests/base/models.py +++ b/tests/base/models.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals from django.db import models from django.utils import six - # 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/check_framework/tests_1_10_compatibility.py b/tests/check_framework/tests_1_10_compatibility.py index 388ac1b024..e085f68881 100644 --- a/tests/check_framework/tests_1_10_compatibility.py +++ b/tests/check_framework/tests_1_10_compatibility.py @@ -1,5 +1,6 @@ -from django.core.checks.compatibility.django_1_10 import \ - check_duplicate_middleware_settings +from django.core.checks.compatibility.django_1_10 import ( + check_duplicate_middleware_settings, +) from django.test import SimpleTestCase from django.test.utils import override_settings diff --git a/tests/check_framework/tests_1_8_compatibility.py b/tests/check_framework/tests_1_8_compatibility.py index d8601b1064..c3865643b2 100644 --- a/tests/check_framework/tests_1_8_compatibility.py +++ b/tests/check_framework/tests_1_8_compatibility.py @@ -1,5 +1,6 @@ -from django.core.checks.compatibility.django_1_8_0 import \ - check_duplicate_template_settings +from django.core.checks.compatibility.django_1_8_0 import ( + check_duplicate_template_settings, +) from django.test import SimpleTestCase from django.test.utils import override_settings 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 b33338800a..85d3b7939a 100644 --- a/tests/i18n/test_compilation.py +++ b/tests/i18n/test_compilation.py @@ -10,8 +10,9 @@ from subprocess import Popen 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, mock, 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 9311a1e7f0..3befcb7c8a 100644 --- a/tests/i18n/test_extraction.py +++ b/tests/i18n/test_extraction.py @@ -14,8 +14,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, mock, 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 45f22df0bc..659f0c5b22 100644 --- a/tests/model_inheritance/models.py +++ b/tests/model_inheritance/models.py @@ -16,7 +16,6 @@ from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible - # # 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 6600418b8f..c5f895fe96 100644 --- a/tests/prefetch_related/models.py +++ b/tests/prefetch_related/models.py @@ -10,8 +10,6 @@ from django.utils.encoding import python_2_unicode_compatible from django.utils.functional import cached_property -# Basic tests - @python_2_unicode_compatible class Author(models.Model): name = models.CharField(max_length=50, unique=True) diff --git a/tests/proxy_models/models.py b/tests/proxy_models/models.py index 6960042d78..8b081f5290 100644 --- a/tests/proxy_models/models.py +++ b/tests/proxy_models/models.py @@ -7,7 +7,6 @@ providing a modified interface to the data from the base class. from django.db import models from django.utils.encoding import python_2_unicode_compatible - # 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 bef2873731..26bf34ebd1 100644 --- a/tests/select_related/models.py +++ b/tests/select_related/models.py @@ -14,7 +14,6 @@ from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.encoding import python_2_unicode_compatible - # Who remembers high school biology? diff --git a/tests/serializers/test_data.py b/tests/serializers/test_data.py index f9cb9582fe..cc42f2869a 100644 --- a/tests/serializers/test_data.py +++ b/tests/serializers/test_data.py @@ -32,7 +32,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 5ccccf699b..c15c39224b 100644 --- a/tests/sessions_tests/tests.py +++ b/tests/sessions_tests/tests.py @@ -10,12 +10,14 @@ from datetime import timedelta 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 e06e54487e..d0dcafc123 100644 --- a/tests/staticfiles_tests/test_storage.py +++ b/tests/staticfiles_tests/test_storage.py @@ -8,8 +8,9 @@ import unittest 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 e925752a06..657d3d5be0 100644 --- a/tests/unmanaged_models/models.py +++ b/tests/unmanaged_models/models.py @@ -6,7 +6,6 @@ is generated for the table on various manage.py operations. from django.db import models from django.utils.encoding import python_2_unicode_compatible - # All of these models are created in the database by Django.