Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed a few more imports of django.utils.unittest.

One import per line please! Refs #20680.
  • Loading branch information...
commit e021b87c0009c11aa2e62b62fc40b4b0209a8e5d 1 parent 09b446d
@aaugustin aaugustin authored
View
3  django/contrib/gis/tests/geoapp/tests.py
@@ -1,6 +1,7 @@
from __future__ import absolute_import
import re
+import unittest
from unittest import skipUnless
from django.db import connection
@@ -10,7 +11,7 @@
no_mysql, no_oracle, no_spatialite,
mysql, oracle, postgis, spatialite)
from django.test import TestCase
-from django.utils import six, unittest
+from django.utils import six
if HAS_GEOS:
from django.contrib.gis.geos import (fromstr, GEOSGeometry,
View
4 tests/admin_views/tests.py
@@ -4,6 +4,7 @@
import os
import re
import datetime
+import unittest
try:
from urllib.parse import urljoin
except ImportError: # Python 2
@@ -31,7 +32,8 @@
from django.template.response import TemplateResponse
from django.test import TestCase
from django.test.utils import patch_logger
-from django.utils import formats, translation, unittest
+from django.utils import formats
+from django.utils import translation
from django.utils.cache import get_max_age
from django.utils.encoding import iri_to_uri, force_bytes
from django.utils.html import escape
View
7 tests/backends/tests.py
@@ -5,6 +5,7 @@
import datetime
from decimal import Decimal
import threading
+import unittest
from django.conf import settings
from django.core.management.color import no_style
@@ -21,7 +22,7 @@
from django.test import (TestCase, skipUnlessDBFeature, skipIfDBFeature,
TransactionTestCase)
from django.test.utils import override_settings, str_prefix
-from django.utils import six, unittest
+from django.utils import six
from django.utils.six.moves import xrange
from . import models
@@ -469,7 +470,7 @@ class BackendTestCase(TestCase):
def create_squares_with_executemany(self, args):
self.create_squares(args, 'format', True)
- def create_squares(self, args, paramstyle, multiple):
+ def create_squares(self, args, paramstyle, multiple):
cursor = connection.cursor()
opts = models.Square._meta
tbl = connection.introspection.table_name_converter(opts.db_table)
@@ -541,7 +542,7 @@ def test_cursor_executemany_with_pyformat_iterator(self):
# same test for DebugCursorWrapper
self.create_squares(args, 'pyformat', multiple=True)
self.assertEqual(models.Square.objects.count(), 9)
-
+
def test_unicode_fetches(self):
#6254: fetchone, fetchmany, fetchall return strings as unicode objects
qn = connection.ops.quote_name
View
7 tests/cache/tests.py
@@ -6,13 +6,14 @@
import hashlib
import os
+import pickle
import random
import re
import string
import tempfile
import time
+import unittest
import warnings
-import pickle
from django.conf import settings
from django.core import management
@@ -29,7 +30,9 @@
from django.template.response import TemplateResponse
from django.test import TestCase, TransactionTestCase, RequestFactory
from django.test.utils import override_settings, IgnoreDeprecationWarningsMixin
-from django.utils import six, timezone, translation, unittest
+from django.utils import six
+from django.utils import timezone
+from django.utils import translation
from django.utils.cache import (patch_vary_headers, get_cache_key,
learn_cache_key, patch_cache_control, patch_response_headers)
from django.utils.encoding import force_text
View
4 tests/utils_tests/test_dateformat.py
@@ -3,9 +3,11 @@
from datetime import datetime, date
import os
import time
+import unittest
from django.utils.dateformat import format
-from django.utils import dateformat, translation, unittest
+from django.utils import dateformat
+from django.utils import translation
from django.utils.timezone import utc
from django.utils.tzinfo import FixedOffset, LocalTimezone
View
5 tests/utils_tests/test_feedgenerator.py
@@ -1,8 +1,11 @@
from __future__ import unicode_literals
import datetime
+import unittest
+
+from django.utils import feedgenerator
+from django.utils import tzinfo
-from django.utils import feedgenerator, tzinfo, unittest
class FeedgeneratorTest(unittest.TestCase):
"""
View
3  tests/view_tests/tests/test_i18n.py
@@ -4,12 +4,13 @@
import gettext
import os
from os import path
+import unittest
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test import LiveServerTestCase, TestCase
from django.test.utils import override_settings
-from django.utils import six, unittest
+from django.utils import six
from django.utils._os import upath
from django.utils.translation import override
from django.utils.text import javascript_quote
View
4 tests/wsgi/tests.py
@@ -1,5 +1,7 @@
from __future__ import unicode_literals
+import unittest
+
from django.core.exceptions import ImproperlyConfigured
from django.core.servers.basehttp import get_internal_wsgi_application
from django.core.signals import request_started
@@ -8,7 +10,7 @@
from django.test import TestCase
from django.test.client import RequestFactory
from django.test.utils import override_settings
-from django.utils import six, unittest
+from django.utils import six
class WSGITest(TestCase):
Please sign in to comment.
Something went wrong with that request. Please try again.