summaryrefslogtreecommitdiff
path: root/django/test
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2015-02-09 13:19:34 -0500
committerTim Graham <timograham@gmail.com>2015-02-09 14:24:06 -0500
commita8b70d251d238b4e6cfc7bb4296da15494f8dff3 (patch)
tree94ef5bc53e59131906aecfcf792eeac86242aa62 /django/test
parenteb406aa686ff1809903366ef6896037af2f1f69b (diff)
[1.8.x] Sorted imports with isort; refs #23860.
Backport of 0ed7d155635da9f79d4dd67e4889087d3673c6da from master
Diffstat (limited to 'django/test')
-rw-r--r--django/test/client.py19
-rw-r--r--django/test/html.py7
-rw-r--r--django/test/runner.py2
-rw-r--r--django/test/signals.py4
-rw-r--r--django/test/testcases.py27
-rw-r--r--django/test/utils.py10
6 files changed, 36 insertions, 33 deletions
diff --git a/django/test/client.py b/django/test/client.py
index a19970f02e..d845fe76a7 100644
--- a/django/test/client.py
+++ b/django/test/client.py
@@ -1,9 +1,9 @@
from __future__ import unicode_literals
-import sys
+import mimetypes
import os
import re
-import mimetypes
+import sys
from copy import copy
from importlib import import_module
from io import BytesIO
@@ -12,20 +12,21 @@ from django.apps import apps
from django.conf import settings
from django.core import urlresolvers
from django.core.handlers.base import BaseHandler
-from django.core.handlers.wsgi import WSGIRequest, ISO_8859_1, UTF_8
-from django.core.signals import (request_started, request_finished,
- got_request_exception)
+from django.core.handlers.wsgi import ISO_8859_1, UTF_8, WSGIRequest
+from django.core.signals import (
+ got_request_exception, request_finished, request_started,
+)
from django.db import close_old_connections
-from django.http import SimpleCookie, HttpRequest, QueryDict
+from django.http import HttpRequest, QueryDict, SimpleCookie
from django.template import TemplateDoesNotExist
from django.test import signals
-from django.utils.functional import curry, SimpleLazyObject
+from django.test.utils import ContextList
+from django.utils import six
from django.utils.encoding import force_bytes, force_str, uri_to_iri
+from django.utils.functional import SimpleLazyObject, curry
from django.utils.http import urlencode
from django.utils.itercompat import is_iterable
-from django.utils import six
from django.utils.six.moves.urllib.parse import urlparse, urlsplit
-from django.test.utils import ContextList
__all__ = ('Client', 'RedirectCycleError', 'RequestFactory', 'encode_file', 'encode_multipart')
diff --git a/django/test/html.py b/django/test/html.py
index cca4a48491..28db398cf7 100644
--- a/django/test/html.py
+++ b/django/test/html.py
@@ -5,11 +5,10 @@ Comparing two html documents.
from __future__ import unicode_literals
import re
-from django.utils.encoding import force_text
-from django.utils.html_parser import HTMLParser, HTMLParseError
-from django.utils import six
-from django.utils.encoding import python_2_unicode_compatible
+from django.utils import six
+from django.utils.encoding import force_text, python_2_unicode_compatible
+from django.utils.html_parser import HTMLParseError, HTMLParser
WHITESPACE = re.compile('\s+')
diff --git a/django/test/runner.py b/django/test/runner.py
index 73a5a9d175..1106c52803 100644
--- a/django/test/runner.py
+++ b/django/test/runner.py
@@ -1,7 +1,7 @@
-from importlib import import_module
import logging
import os
import unittest
+from importlib import import_module
from unittest import TestSuite, defaultTestLoader
from django.conf import settings
diff --git a/django/test/signals.py b/django/test/signals.py
index 56a8945e01..d2bb209dbf 100644
--- a/django/test/signals.py
+++ b/django/test/signals.py
@@ -1,13 +1,13 @@
import os
-import time
import threading
+import time
import warnings
from django.conf import settings
from django.core.signals import setting_changed
from django.db import connections, router
from django.db.utils import ConnectionRouter
-from django.dispatch import receiver, Signal
+from django.dispatch import Signal, receiver
from django.utils import timezone
from django.utils.functional import empty
diff --git a/django/test/testcases.py b/django/test/testcases.py
index 2896631d47..afb5cf0d3a 100644
--- a/django/test/testcases.py
+++ b/django/test/testcases.py
@@ -1,10 +1,7 @@
from __future__ import unicode_literals
-from collections import Counter
-from copy import copy
import difflib
import errno
-from functools import wraps
import json
import os
import posixpath
@@ -14,35 +11,41 @@ import sys
import threading
import unittest
import warnings
-from unittest import skipIf # NOQA: Imported here for backward compatibility
+from collections import Counter
+from copy import copy
+from functools import wraps
+from unittest import skipIf # NOQA: Imported here for backward compatibility
from unittest.util import safe_repr
from django.apps import apps
from django.conf import settings
from django.core import mail
-from django.core.exceptions import ValidationError, ImproperlyConfigured
-from django.core.handlers.wsgi import get_path_info, WSGIHandler
+from django.core.exceptions import ImproperlyConfigured, ValidationError
+from django.core.handlers.wsgi import WSGIHandler, get_path_info
from django.core.management import call_command
from django.core.management.color import no_style
from django.core.management.commands import flush
from django.core.servers.basehttp import WSGIRequestHandler, WSGIServer
from django.core.urlresolvers import clear_url_caches, set_urlconf
-from django.db import connection, connections, DEFAULT_DB_ALIAS, transaction
+from django.db import DEFAULT_DB_ALIAS, connection, connections, transaction
from django.forms.fields import CharField
from django.http import QueryDict
from django.test.client import Client
from django.test.html import HTMLParseError, parse_html
from django.test.signals import setting_changed, template_rendered
-from django.test.utils import (CaptureQueriesContext, ContextList,
- override_settings, modify_settings, compare_xml)
+from django.test.utils import (
+ CaptureQueriesContext, ContextList, compare_xml, modify_settings,
+ override_settings,
+)
+from django.utils import six
from django.utils.deprecation import RemovedInDjango20Warning
from django.utils.encoding import force_text
-from django.utils import six
-from django.utils.six.moves.urllib.parse import urlsplit, urlunsplit, urlparse, unquote
+from django.utils.six.moves.urllib.parse import (
+ unquote, urlparse, urlsplit, urlunsplit,
+)
from django.utils.six.moves.urllib.request import url2pathname
from django.views.static import serve
-
__all__ = ('TestCase', 'TransactionTestCase',
'SimpleTestCase', 'skipIfDBFeature', 'skipUnlessDBFeature')
diff --git a/django/test/utils.py b/django/test/utils.py
index 6b5b06cd7c..c91d501335 100644
--- a/django/test/utils.py
+++ b/django/test/utils.py
@@ -1,22 +1,22 @@
-from contextlib import contextmanager
import logging
import re
import sys
import time
-from unittest import skipIf, skipUnless
import warnings
+from contextlib import contextmanager
from functools import wraps
-from xml.dom.minidom import parseString, Node
+from unittest import skipIf, skipUnless
+from xml.dom.minidom import Node, parseString
from django.apps import apps
-from django.conf import settings, UserSettingsHolder
+from django.conf import UserSettingsHolder, settings
from django.core import mail
from django.core.signals import request_started
from django.db import reset_queries
from django.http import request
from django.template import Template
from django.template.loaders import locmem
-from django.test.signals import template_rendered, setting_changed
+from django.test.signals import setting_changed, template_rendered
from django.utils import six
from django.utils.deprecation import RemovedInDjango19Warning
from django.utils.encoding import force_str