mirror of
https://github.com/django/django.git
synced 2025-05-30 02:36:29 +00:00
Fixed a few more imports of django.utils.unittest.
One import per line please! Refs #20680.
This commit is contained in:
parent
09b446dfe8
commit
e021b87c00
@ -1,6 +1,7 @@
|
|||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
import unittest
|
||||||
from unittest import skipUnless
|
from unittest import skipUnless
|
||||||
|
|
||||||
from django.db import connection
|
from django.db import connection
|
||||||
@ -10,7 +11,7 @@ from django.contrib.gis.tests.utils import (
|
|||||||
no_mysql, no_oracle, no_spatialite,
|
no_mysql, no_oracle, no_spatialite,
|
||||||
mysql, oracle, postgis, spatialite)
|
mysql, oracle, postgis, spatialite)
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
from django.utils import six, unittest
|
from django.utils import six
|
||||||
|
|
||||||
if HAS_GEOS:
|
if HAS_GEOS:
|
||||||
from django.contrib.gis.geos import (fromstr, GEOSGeometry,
|
from django.contrib.gis.geos import (fromstr, GEOSGeometry,
|
||||||
|
@ -4,6 +4,7 @@ from __future__ import absolute_import, unicode_literals
|
|||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import datetime
|
import datetime
|
||||||
|
import unittest
|
||||||
try:
|
try:
|
||||||
from urllib.parse import urljoin
|
from urllib.parse import urljoin
|
||||||
except ImportError: # Python 2
|
except ImportError: # Python 2
|
||||||
@ -31,7 +32,8 @@ from django.forms.util import ErrorList
|
|||||||
from django.template.response import TemplateResponse
|
from django.template.response import TemplateResponse
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
from django.test.utils import patch_logger
|
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.cache import get_max_age
|
||||||
from django.utils.encoding import iri_to_uri, force_bytes
|
from django.utils.encoding import iri_to_uri, force_bytes
|
||||||
from django.utils.html import escape
|
from django.utils.html import escape
|
||||||
|
@ -5,6 +5,7 @@ from __future__ import absolute_import, unicode_literals
|
|||||||
import datetime
|
import datetime
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
import threading
|
import threading
|
||||||
|
import unittest
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.core.management.color import no_style
|
from django.core.management.color import no_style
|
||||||
@ -21,7 +22,7 @@ from django.db.utils import ConnectionHandler
|
|||||||
from django.test import (TestCase, skipUnlessDBFeature, skipIfDBFeature,
|
from django.test import (TestCase, skipUnlessDBFeature, skipIfDBFeature,
|
||||||
TransactionTestCase)
|
TransactionTestCase)
|
||||||
from django.test.utils import override_settings, str_prefix
|
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 django.utils.six.moves import xrange
|
||||||
|
|
||||||
from . import models
|
from . import models
|
||||||
@ -469,7 +470,7 @@ class BackendTestCase(TestCase):
|
|||||||
def create_squares_with_executemany(self, args):
|
def create_squares_with_executemany(self, args):
|
||||||
self.create_squares(args, 'format', True)
|
self.create_squares(args, 'format', True)
|
||||||
|
|
||||||
def create_squares(self, args, paramstyle, multiple):
|
def create_squares(self, args, paramstyle, multiple):
|
||||||
cursor = connection.cursor()
|
cursor = connection.cursor()
|
||||||
opts = models.Square._meta
|
opts = models.Square._meta
|
||||||
tbl = connection.introspection.table_name_converter(opts.db_table)
|
tbl = connection.introspection.table_name_converter(opts.db_table)
|
||||||
@ -541,7 +542,7 @@ class BackendTestCase(TestCase):
|
|||||||
# same test for DebugCursorWrapper
|
# same test for DebugCursorWrapper
|
||||||
self.create_squares(args, 'pyformat', multiple=True)
|
self.create_squares(args, 'pyformat', multiple=True)
|
||||||
self.assertEqual(models.Square.objects.count(), 9)
|
self.assertEqual(models.Square.objects.count(), 9)
|
||||||
|
|
||||||
def test_unicode_fetches(self):
|
def test_unicode_fetches(self):
|
||||||
#6254: fetchone, fetchmany, fetchall return strings as unicode objects
|
#6254: fetchone, fetchmany, fetchall return strings as unicode objects
|
||||||
qn = connection.ops.quote_name
|
qn = connection.ops.quote_name
|
||||||
|
7
tests/cache/tests.py
vendored
7
tests/cache/tests.py
vendored
@ -6,13 +6,14 @@ from __future__ import absolute_import, unicode_literals
|
|||||||
|
|
||||||
import hashlib
|
import hashlib
|
||||||
import os
|
import os
|
||||||
|
import pickle
|
||||||
import random
|
import random
|
||||||
import re
|
import re
|
||||||
import string
|
import string
|
||||||
import tempfile
|
import tempfile
|
||||||
import time
|
import time
|
||||||
|
import unittest
|
||||||
import warnings
|
import warnings
|
||||||
import pickle
|
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.core import management
|
from django.core import management
|
||||||
@ -29,7 +30,9 @@ from django.template import Template
|
|||||||
from django.template.response import TemplateResponse
|
from django.template.response import TemplateResponse
|
||||||
from django.test import TestCase, TransactionTestCase, RequestFactory
|
from django.test import TestCase, TransactionTestCase, RequestFactory
|
||||||
from django.test.utils import override_settings, IgnoreDeprecationWarningsMixin
|
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,
|
from django.utils.cache import (patch_vary_headers, get_cache_key,
|
||||||
learn_cache_key, patch_cache_control, patch_response_headers)
|
learn_cache_key, patch_cache_control, patch_response_headers)
|
||||||
from django.utils.encoding import force_text
|
from django.utils.encoding import force_text
|
||||||
|
@ -3,9 +3,11 @@ from __future__ import unicode_literals
|
|||||||
from datetime import datetime, date
|
from datetime import datetime, date
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
|
import unittest
|
||||||
|
|
||||||
from django.utils.dateformat import format
|
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.timezone import utc
|
||||||
from django.utils.tzinfo import FixedOffset, LocalTimezone
|
from django.utils.tzinfo import FixedOffset, LocalTimezone
|
||||||
|
|
||||||
|
@ -1,8 +1,11 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import datetime
|
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):
|
class FeedgeneratorTest(unittest.TestCase):
|
||||||
"""
|
"""
|
||||||
|
@ -4,12 +4,13 @@ from __future__ import absolute_import
|
|||||||
import gettext
|
import gettext
|
||||||
import os
|
import os
|
||||||
from os import path
|
from os import path
|
||||||
|
import unittest
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.core.urlresolvers import reverse
|
from django.core.urlresolvers import reverse
|
||||||
from django.test import LiveServerTestCase, TestCase
|
from django.test import LiveServerTestCase, TestCase
|
||||||
from django.test.utils import override_settings
|
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._os import upath
|
||||||
from django.utils.translation import override
|
from django.utils.translation import override
|
||||||
from django.utils.text import javascript_quote
|
from django.utils.text import javascript_quote
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
import unittest
|
||||||
|
|
||||||
from django.core.exceptions import ImproperlyConfigured
|
from django.core.exceptions import ImproperlyConfigured
|
||||||
from django.core.servers.basehttp import get_internal_wsgi_application
|
from django.core.servers.basehttp import get_internal_wsgi_application
|
||||||
from django.core.signals import request_started
|
from django.core.signals import request_started
|
||||||
@ -8,7 +10,7 @@ from django.db import close_old_connections
|
|||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
from django.test.client import RequestFactory
|
from django.test.client import RequestFactory
|
||||||
from django.test.utils import override_settings
|
from django.test.utils import override_settings
|
||||||
from django.utils import six, unittest
|
from django.utils import six
|
||||||
|
|
||||||
|
|
||||||
class WSGITest(TestCase):
|
class WSGITest(TestCase):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user