From 9bcf73d788866bc93f8248cb2e9d601ecbc4b50c Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Thu, 1 Feb 2018 09:29:46 +0100 Subject: [PATCH] Fixed imports per isort 4.3.0. --- django/contrib/gis/utils/layermapping.py | 3 +-- django/contrib/gis/utils/ogrinspect.py | 3 +-- django/contrib/messages/__init__.py | 1 - django/core/handlers/exception.py | 3 +-- django/core/management/commands/runserver.py | 1 - django/db/models/fields/related.py | 3 +-- django/db/models/query.py | 3 +-- django/db/models/signals.py | 1 - tests/admin_views/test_actions.py | 3 +-- tests/contenttypes_tests/test_views.py | 3 +-- tests/db_functions/tests.py | 1 - tests/forms_tests/field_tests/test_charfield.py | 3 +-- tests/messages_tests/urls.py | 1 - tests/modeladmin/tests.py | 3 +-- tests/template_tests/syntax_tests/test_multiline.py | 1 - tests/urlpatterns_reverse/tests.py | 7 ++++--- tests/utils_tests/test_datetime_safe.py | 3 +-- 17 files changed, 14 insertions(+), 29 deletions(-) diff --git a/django/contrib/gis/utils/layermapping.py b/django/contrib/gis/utils/layermapping.py index e4baf56dcb..2b83df68f6 100644 --- a/django/contrib/gis/utils/layermapping.py +++ b/django/contrib/gis/utils/layermapping.py @@ -15,8 +15,7 @@ from django.contrib.gis.gdal import ( SpatialReference, ) from django.contrib.gis.gdal.field import ( - OFTDate, OFTDateTime, OFTInteger, OFTInteger64, OFTReal, OFTString, - OFTTime, + OFTDate, OFTDateTime, OFTInteger, OFTInteger64, OFTReal, OFTString, OFTTime, ) from django.core.exceptions import FieldDoesNotExist, ObjectDoesNotExist from django.db import connections, models, router, transaction diff --git a/django/contrib/gis/utils/ogrinspect.py b/django/contrib/gis/utils/ogrinspect.py index 9a091602fc..4685f33698 100644 --- a/django/contrib/gis/utils/ogrinspect.py +++ b/django/contrib/gis/utils/ogrinspect.py @@ -5,8 +5,7 @@ models for GeoDjango and/or mapping dictionaries for use with the """ from django.contrib.gis.gdal import DataSource from django.contrib.gis.gdal.field import ( - OFTDate, OFTDateTime, OFTInteger, OFTInteger64, OFTReal, OFTString, - OFTTime, + OFTDate, OFTDateTime, OFTInteger, OFTInteger64, OFTReal, OFTString, OFTTime, ) diff --git a/django/contrib/messages/__init__.py b/django/contrib/messages/__init__.py index a0cb24b2d9..25da09f3bf 100644 --- a/django/contrib/messages/__init__.py +++ b/django/contrib/messages/__init__.py @@ -1,5 +1,4 @@ from django.contrib.messages.api import * # NOQA from django.contrib.messages.constants import * # NOQA - default_app_config = 'django.contrib.messages.apps.MessagesConfig' diff --git a/django/core/handlers/exception.py b/django/core/handlers/exception.py index e98bec262a..2827ff6d11 100644 --- a/django/core/handlers/exception.py +++ b/django/core/handlers/exception.py @@ -5,8 +5,7 @@ from functools import wraps from django.conf import settings from django.core import signals from django.core.exceptions import ( - PermissionDenied, RequestDataTooBig, SuspiciousOperation, - TooManyFieldsSent, + PermissionDenied, RequestDataTooBig, SuspiciousOperation, TooManyFieldsSent, ) from django.http import Http404 from django.http.multipartparser import MultiPartParserError diff --git a/django/core/management/commands/runserver.py b/django/core/management/commands/runserver.py index fd49817f81..d38491d0a9 100644 --- a/django/core/management/commands/runserver.py +++ b/django/core/management/commands/runserver.py @@ -12,7 +12,6 @@ from django.core.servers.basehttp import ( ) from django.utils import autoreload - naiveip_re = re.compile(r"""^(?: (?P (?P\d{1,3}(?:\.\d{1,3}){3}) | # IPv4 address diff --git a/django/db/models/fields/related.py b/django/db/models/fields/related.py index d19d70d30c..5397a61e6e 100644 --- a/django/db/models/fields/related.py +++ b/django/db/models/fields/related.py @@ -19,8 +19,7 @@ from . import Field from .mixins import FieldCacheMixin from .related_descriptors import ( ForwardManyToOneDescriptor, ForwardOneToOneDescriptor, - ManyToManyDescriptor, ReverseManyToOneDescriptor, - ReverseOneToOneDescriptor, + ManyToManyDescriptor, ReverseManyToOneDescriptor, ReverseOneToOneDescriptor, ) from .related_lookups import ( RelatedExact, RelatedGreaterThan, RelatedGreaterThanOrEqual, RelatedIn, diff --git a/django/db/models/query.py b/django/db/models/query.py index 44bc51d0e0..b193de5790 100644 --- a/django/db/models/query.py +++ b/django/db/models/query.py @@ -11,8 +11,7 @@ from functools import lru_cache from django.conf import settings from django.core import exceptions from django.db import ( - DJANGO_VERSION_PICKLE_KEY, IntegrityError, connections, router, - transaction, + DJANGO_VERSION_PICKLE_KEY, IntegrityError, connections, router, transaction, ) from django.db.models import DateField, DateTimeField, sql from django.db.models.constants import LOOKUP_SEP diff --git a/django/db/models/signals.py b/django/db/models/signals.py index dafd49fd05..3b20874148 100644 --- a/django/db/models/signals.py +++ b/django/db/models/signals.py @@ -3,7 +3,6 @@ from functools import partial from django.db.models.utils import make_model_tuple from django.dispatch import Signal - class_prepared = Signal(providing_args=["class"]) diff --git a/tests/admin_views/test_actions.py b/tests/admin_views/test_actions.py index b77714b32d..44bff49ec2 100644 --- a/tests/admin_views/test_actions.py +++ b/tests/admin_views/test_actions.py @@ -12,8 +12,7 @@ from django.urls import reverse from .admin import SubscriberAdmin from .forms import MediaActionForm from .models import ( - Actor, Answer, ExternalSubscriber, Question, Subscriber, - UnchangeableObject, + Actor, Answer, ExternalSubscriber, Question, Subscriber, UnchangeableObject, ) diff --git a/tests/contenttypes_tests/test_views.py b/tests/contenttypes_tests/test_views.py index cdfa1e0961..93ef40b4c2 100644 --- a/tests/contenttypes_tests/test_views.py +++ b/tests/contenttypes_tests/test_views.py @@ -8,8 +8,7 @@ from django.test import TestCase, override_settings from django.test.utils import isolate_apps from .models import ( - Article, Author, ModelWithNullFKToSite, SchemeIncludedURL, - Site as MockSite, + Article, Author, ModelWithNullFKToSite, SchemeIncludedURL, Site as MockSite, ) diff --git a/tests/db_functions/tests.py b/tests/db_functions/tests.py index 70d4d802cd..28fd21d6fd 100644 --- a/tests/db_functions/tests.py +++ b/tests/db_functions/tests.py @@ -14,7 +14,6 @@ from django.utils import timezone from .models import Article, Author, DecimalModel, Fan - lorem_ipsum = """ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.""" diff --git a/tests/forms_tests/field_tests/test_charfield.py b/tests/forms_tests/field_tests/test_charfield.py index cbacf4d0d7..e9819268eb 100644 --- a/tests/forms_tests/field_tests/test_charfield.py +++ b/tests/forms_tests/field_tests/test_charfield.py @@ -1,6 +1,5 @@ from django.forms import ( - CharField, HiddenInput, PasswordInput, Textarea, TextInput, - ValidationError, + CharField, HiddenInput, PasswordInput, Textarea, TextInput, ValidationError, ) from django.test import SimpleTestCase diff --git a/tests/messages_tests/urls.py b/tests/messages_tests/urls.py index 4005ffac6b..d9a8a59b91 100644 --- a/tests/messages_tests/urls.py +++ b/tests/messages_tests/urls.py @@ -9,7 +9,6 @@ from django.urls import reverse from django.views.decorators.cache import never_cache from django.views.generic.edit import FormView - TEMPLATE = """{% if messages %}
    {% for message in messages %} diff --git a/tests/modeladmin/tests.py b/tests/modeladmin/tests.py index 202929df05..4f81036b9a 100644 --- a/tests/modeladmin/tests.py +++ b/tests/modeladmin/tests.py @@ -3,8 +3,7 @@ from datetime import date from django import forms from django.contrib.admin.models import ADDITION, CHANGE, DELETION, LogEntry from django.contrib.admin.options import ( - HORIZONTAL, VERTICAL, ModelAdmin, TabularInline, - get_content_type_for_model, + HORIZONTAL, VERTICAL, ModelAdmin, TabularInline, get_content_type_for_model, ) from django.contrib.admin.sites import AdminSite from django.contrib.admin.widgets import ( diff --git a/tests/template_tests/syntax_tests/test_multiline.py b/tests/template_tests/syntax_tests/test_multiline.py index b2371f7fd1..a95e12986a 100644 --- a/tests/template_tests/syntax_tests/test_multiline.py +++ b/tests/template_tests/syntax_tests/test_multiline.py @@ -2,7 +2,6 @@ from django.test import SimpleTestCase from ..utils import setup - multiline_string = """ Hello, boys. diff --git a/tests/urlpatterns_reverse/tests.py b/tests/urlpatterns_reverse/tests.py index 86f7ed5667..6112953d45 100644 --- a/tests/urlpatterns_reverse/tests.py +++ b/tests/urlpatterns_reverse/tests.py @@ -534,9 +534,10 @@ class ReverseLazySettingsTest(AdminScriptTestCase): import error. """ def setUp(self): - self.write_settings('settings.py', extra=""" -from django.urls import reverse_lazy -LOGIN_URL = reverse_lazy('login')""") + self.write_settings( + 'settings.py', + extra="from django.urls import reverse_lazy\nLOGIN_URL = reverse_lazy('login')", + ) def tearDown(self): self.remove_settings('settings.py') diff --git a/tests/utils_tests/test_datetime_safe.py b/tests/utils_tests/test_datetime_safe.py index 5fa08bc4f4..5b7f6213be 100644 --- a/tests/utils_tests/test_datetime_safe.py +++ b/tests/utils_tests/test_datetime_safe.py @@ -1,7 +1,6 @@ import unittest from datetime import ( - date as original_date, datetime as original_datetime, - time as original_time, + date as original_date, datetime as original_datetime, time as original_time, ) from django.utils.datetime_safe import date, datetime, time