summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
Diffstat (limited to 'django')
-rw-r--r--django/contrib/admin/tests.py2
-rw-r--r--django/contrib/admindocs/tests/test_fields.py3
-rw-r--r--django/contrib/auth/tests/test_hashers.py5
-rw-r--r--django/contrib/auth/tests/test_tokens.py4
-rw-r--r--django/contrib/auth/tests/utils.py3
-rw-r--r--django/contrib/formtools/tests/tests.py2
-rw-r--r--django/contrib/gis/gdal/tests/test_driver.py5
-rw-r--r--django/contrib/gis/gdal/tests/test_ds.py4
-rw-r--r--django/contrib/gis/gdal/tests/test_envelope.py7
-rw-r--r--django/contrib/gis/gdal/tests/test_geom.py4
-rw-r--r--django/contrib/gis/gdal/tests/test_srs.py5
-rw-r--r--django/contrib/gis/geoip/tests.py5
-rw-r--r--django/contrib/gis/geos/tests/test_geos.py4
-rw-r--r--django/contrib/gis/geos/tests/test_geos_mutation.py4
-rw-r--r--django/contrib/gis/geos/tests/test_io.py2
-rw-r--r--django/contrib/gis/geos/tests/test_mutable_list.py4
-rw-r--r--django/contrib/gis/tests/distapp/tests.py3
-rw-r--r--django/contrib/gis/tests/geo3d/tests.py2
-rw-r--r--django/contrib/gis/tests/geoadmin/tests.py3
-rw-r--r--django/contrib/gis/tests/geoapp/test_feeds.py2
-rw-r--r--django/contrib/gis/tests/geoapp/test_regress.py2
-rw-r--r--django/contrib/gis/tests/geoapp/test_sitemaps.py2
-rw-r--r--django/contrib/gis/tests/geoapp/tests.py2
-rw-r--r--django/contrib/gis/tests/geogapp/tests.py2
-rw-r--r--django/contrib/gis/tests/inspectapp/tests.py2
-rw-r--r--django/contrib/gis/tests/layermap/tests.py6
-rw-r--r--django/contrib/gis/tests/relatedapp/tests.py3
-rw-r--r--django/contrib/gis/tests/test_geoforms.py7
-rw-r--r--django/contrib/gis/tests/test_measure.py3
-rw-r--r--django/contrib/gis/tests/test_spatialrefsys.py3
-rw-r--r--django/contrib/humanize/tests.py2
-rw-r--r--django/contrib/messages/tests/base.py3
-rw-r--r--django/contrib/messages/tests/test_middleware.py3
-rw-r--r--django/contrib/sessions/tests.py2
-rw-r--r--django/contrib/sitemaps/tests/test_flatpages.py3
-rw-r--r--django/contrib/sitemaps/tests/test_http.py2
-rw-r--r--django/test/runner.py4
-rw-r--r--django/test/testcases.py17
38 files changed, 80 insertions, 61 deletions
diff --git a/django/contrib/admin/tests.py b/django/contrib/admin/tests.py
index 25ea230b28..82d0bdcb7b 100644
--- a/django/contrib/admin/tests.py
+++ b/django/contrib/admin/tests.py
@@ -1,8 +1,8 @@
import os
+from unittest import SkipTest
from django.test import LiveServerTestCase
from django.utils.module_loading import import_by_path
-from django.utils.unittest import SkipTest
from django.utils.translation import ugettext as _
diff --git a/django/contrib/admindocs/tests/test_fields.py b/django/contrib/admindocs/tests/test_fields.py
index c048f20287..b505d2deeb 100644
--- a/django/contrib/admindocs/tests/test_fields.py
+++ b/django/contrib/admindocs/tests/test_fields.py
@@ -1,9 +1,10 @@
from __future__ import absolute_import, unicode_literals
+import unittest
+
from django.contrib.admindocs import views
from django.db import models
from django.db.models import fields
-from django.utils import unittest
from django.utils.translation import ugettext as _
diff --git a/django/contrib/auth/tests/test_hashers.py b/django/contrib/auth/tests/test_hashers.py
index 9b7811a335..8e8119b741 100644
--- a/django/contrib/auth/tests/test_hashers.py
+++ b/django/contrib/auth/tests/test_hashers.py
@@ -1,13 +1,14 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
+import unittest
+from unittest import skipUnless
+
from django.conf.global_settings import PASSWORD_HASHERS as default_hashers
from django.contrib.auth.hashers import (is_password_usable, BasePasswordHasher,
check_password, make_password, PBKDF2PasswordHasher, load_hashers, PBKDF2SHA1PasswordHasher,
get_hasher, identify_hasher, UNUSABLE_PASSWORD_PREFIX, UNUSABLE_PASSWORD_SUFFIX_LENGTH)
from django.utils import six
-from django.utils import unittest
-from django.utils.unittest import skipUnless
try:
diff --git a/django/contrib/auth/tests/test_tokens.py b/django/contrib/auth/tests/test_tokens.py
index e8aeb46326..7afafc3e94 100644
--- a/django/contrib/auth/tests/test_tokens.py
+++ b/django/contrib/auth/tests/test_tokens.py
@@ -1,12 +1,12 @@
-import sys
from datetime import date, timedelta
+import sys
+import unittest
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth.tokens import PasswordResetTokenGenerator
from django.contrib.auth.tests.utils import skipIfCustomUser
from django.test import TestCase
-from django.utils import unittest
@skipIfCustomUser
diff --git a/django/contrib/auth/tests/utils.py b/django/contrib/auth/tests/utils.py
index 6bb3d9994f..09b34156b5 100644
--- a/django/contrib/auth/tests/utils.py
+++ b/django/contrib/auth/tests/utils.py
@@ -1,5 +1,6 @@
+from unittest import skipIf
+
from django.conf import settings
-from django.utils.unittest import skipIf
def skipIfCustomUser(test_func):
diff --git a/django/contrib/formtools/tests/tests.py b/django/contrib/formtools/tests/tests.py
index 58c59f4041..e1e6ab860b 100644
--- a/django/contrib/formtools/tests/tests.py
+++ b/django/contrib/formtools/tests/tests.py
@@ -3,6 +3,7 @@ from __future__ import unicode_literals
import datetime
import os
+import unittest
import warnings
from django import http
@@ -10,7 +11,6 @@ from django.contrib.formtools import preview, utils
from django.test import TestCase
from django.test.utils import override_settings
from django.utils._os import upath
-from django.utils import unittest
from django.contrib.formtools.tests.forms import *
diff --git a/django/contrib/gis/gdal/tests/test_driver.py b/django/contrib/gis/gdal/tests/test_driver.py
index c27302da72..af0ecf5dc8 100644
--- a/django/contrib/gis/gdal/tests/test_driver.py
+++ b/django/contrib/gis/gdal/tests/test_driver.py
@@ -1,6 +1,7 @@
+import unittest
+from unittest import skipUnless
+
from django.contrib.gis.gdal import HAS_GDAL
-from django.utils import unittest
-from django.utils.unittest import skipUnless
if HAS_GDAL:
from django.contrib.gis.gdal import Driver, OGRException
diff --git a/django/contrib/gis/gdal/tests/test_ds.py b/django/contrib/gis/gdal/tests/test_ds.py
index 3664f055f2..3ac2370fb7 100644
--- a/django/contrib/gis/gdal/tests/test_ds.py
+++ b/django/contrib/gis/gdal/tests/test_ds.py
@@ -1,9 +1,9 @@
import os
+import unittest
+from unittest import skipUnless
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.geometry.test_data import get_ds_file, TestDS, TEST_DATA
-from django.utils import unittest
-from django.utils.unittest import skipUnless
if HAS_GDAL:
from django.contrib.gis.gdal import DataSource, Envelope, OGRGeometry, OGRException, OGRIndexError, GDAL_VERSION
diff --git a/django/contrib/gis/gdal/tests/test_envelope.py b/django/contrib/gis/gdal/tests/test_envelope.py
index 7518dc69aa..14258ff816 100644
--- a/django/contrib/gis/gdal/tests/test_envelope.py
+++ b/django/contrib/gis/gdal/tests/test_envelope.py
@@ -1,6 +1,7 @@
+import unittest
+from unittest import skipUnless
+
from django.contrib.gis.gdal import HAS_GDAL
-from django.utils import unittest
-from django.utils.unittest import skipUnless
if HAS_GDAL:
from django.contrib.gis.gdal import Envelope, OGRException
@@ -17,7 +18,7 @@ class EnvelopeTest(unittest.TestCase):
def setUp(self):
self.e = Envelope(0, 0, 5, 5)
-
+
def test01_init(self):
"Testing Envelope initilization."
e1 = Envelope((0, 0, 5, 5))
diff --git a/django/contrib/gis/gdal/tests/test_geom.py b/django/contrib/gis/gdal/tests/test_geom.py
index c048d2bb82..74b1e894e1 100644
--- a/django/contrib/gis/gdal/tests/test_geom.py
+++ b/django/contrib/gis/gdal/tests/test_geom.py
@@ -4,12 +4,12 @@ try:
from django.utils.six.moves import cPickle as pickle
except ImportError:
import pickle
+import unittest
+from unittest import skipUnless
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.geometry.test_data import TestDataMixin
from django.utils.six.moves import xrange
-from django.utils import unittest
-from django.utils.unittest import skipUnless
if HAS_GDAL:
from django.contrib.gis.gdal import (OGRGeometry, OGRGeomType,
diff --git a/django/contrib/gis/gdal/tests/test_srs.py b/django/contrib/gis/gdal/tests/test_srs.py
index 363b597dae..cacff4be04 100644
--- a/django/contrib/gis/gdal/tests/test_srs.py
+++ b/django/contrib/gis/gdal/tests/test_srs.py
@@ -1,6 +1,7 @@
+import unittest
+from unittest import skipUnless
+
from django.contrib.gis.gdal import HAS_GDAL
-from django.utils import unittest
-from django.utils.unittest import skipUnless
if HAS_GDAL:
from django.contrib.gis.gdal import SpatialReference, CoordTransform, OGRException, SRSException
diff --git a/django/contrib/gis/geoip/tests.py b/django/contrib/gis/geoip/tests.py
index 3fa64bf6be..c49ffb5bf1 100644
--- a/django/contrib/gis/geoip/tests.py
+++ b/django/contrib/gis/geoip/tests.py
@@ -2,11 +2,12 @@
from __future__ import unicode_literals
import os
+import unittest
+from unittest import skipUnless
+
from django.conf import settings
from django.contrib.gis.geos import HAS_GEOS
from django.contrib.gis.geoip import HAS_GEOIP
-from django.utils import unittest
-from django.utils.unittest import skipUnless
from django.utils import six
diff --git a/django/contrib/gis/geos/tests/test_geos.py b/django/contrib/gis/geos/tests/test_geos.py
index c7fe5b2321..900a0adb40 100644
--- a/django/contrib/gis/geos/tests/test_geos.py
+++ b/django/contrib/gis/geos/tests/test_geos.py
@@ -3,6 +3,8 @@ from __future__ import unicode_literals
import ctypes
import json
import random
+import unittest
+from unittest import skipUnless
from binascii import a2b_hex, b2a_hex
from io import BytesIO
@@ -14,8 +16,6 @@ from django.contrib.gis.geometry.test_data import TestDataMixin
from django.utils.encoding import force_bytes
from django.utils import six
from django.utils.six.moves import xrange
-from django.utils import unittest
-from django.utils.unittest import skipUnless
from .. import HAS_GEOS
diff --git a/django/contrib/gis/geos/tests/test_geos_mutation.py b/django/contrib/gis/geos/tests/test_geos_mutation.py
index 40b708a0ef..337abb4d8b 100644
--- a/django/contrib/gis/geos/tests/test_geos_mutation.py
+++ b/django/contrib/gis/geos/tests/test_geos_mutation.py
@@ -2,8 +2,8 @@
# Modified from original contribution by Aryeh Leib Taurog, which was
# released under the New BSD license.
-from django.utils import unittest
-from django.utils.unittest import skipUnless
+import unittest
+from unittest import skipUnless
from .. import HAS_GEOS
diff --git a/django/contrib/gis/geos/tests/test_io.py b/django/contrib/gis/geos/tests/test_io.py
index 34eeaf95b9..2278be8a87 100644
--- a/django/contrib/gis/geos/tests/test_io.py
+++ b/django/contrib/gis/geos/tests/test_io.py
@@ -2,9 +2,9 @@ from __future__ import unicode_literals
import binascii
import unittest
+from unittest import skipUnless
from django.contrib.gis import memoryview
-from django.utils.unittest import skipUnless
from ..import HAS_GEOS
diff --git a/django/contrib/gis/geos/tests/test_mutable_list.py b/django/contrib/gis/geos/tests/test_mutable_list.py
index a4a56f2e5f..ae50a5f616 100644
--- a/django/contrib/gis/geos/tests/test_mutable_list.py
+++ b/django/contrib/gis/geos/tests/test_mutable_list.py
@@ -3,9 +3,11 @@
#
# Modified from original contribution by Aryeh Leib Taurog, which was
# released under the New BSD license.
+
+import unittest
+
from django.contrib.gis.geos.mutable_list import ListMixin
from django.utils import six
-from django.utils import unittest
class UserListA(ListMixin):
diff --git a/django/contrib/gis/tests/distapp/tests.py b/django/contrib/gis/tests/distapp/tests.py
index 2ed17a03bd..8915f01e50 100644
--- a/django/contrib/gis/tests/distapp/tests.py
+++ b/django/contrib/gis/tests/distapp/tests.py
@@ -1,5 +1,7 @@
from __future__ import absolute_import
+from unittest import skipUnless
+
from django.db import connection
from django.db.models import Q
from django.contrib.gis.geos import HAS_GEOS
@@ -8,7 +10,6 @@ from django.contrib.gis.tests.utils import (
HAS_SPATIAL_DB, mysql, oracle, postgis, spatialite, no_oracle, no_spatialite
)
from django.test import TestCase
-from django.utils.unittest import skipUnless
if HAS_GEOS and HAS_SPATIAL_DB:
from django.contrib.gis.geos import GEOSGeometry, LineString
diff --git a/django/contrib/gis/tests/geo3d/tests.py b/django/contrib/gis/tests/geo3d/tests.py
index df9f35690b..6c17003982 100644
--- a/django/contrib/gis/tests/geo3d/tests.py
+++ b/django/contrib/gis/tests/geo3d/tests.py
@@ -2,13 +2,13 @@ from __future__ import absolute_import, unicode_literals
import os
import re
+from unittest import skipUnless
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.geos import HAS_GEOS
from django.contrib.gis.tests.utils import postgis
from django.test import TestCase
from django.utils._os import upath
-from django.utils.unittest import skipUnless
if HAS_GEOS:
from django.contrib.gis.db.models import Union, Extent3D
diff --git a/django/contrib/gis/tests/geoadmin/tests.py b/django/contrib/gis/tests/geoadmin/tests.py
index 15874758be..c34964a2da 100644
--- a/django/contrib/gis/tests/geoadmin/tests.py
+++ b/django/contrib/gis/tests/geoadmin/tests.py
@@ -1,9 +1,10 @@
from __future__ import absolute_import
+from unittest import skipUnless
+
from django.test import TestCase
from django.contrib.gis.geos import HAS_GEOS
from django.contrib.gis.tests.utils import HAS_SPATIAL_DB
-from django.utils.unittest import skipUnless
if HAS_GEOS and HAS_SPATIAL_DB:
from django.contrib.gis import admin
diff --git a/django/contrib/gis/tests/geoapp/test_feeds.py b/django/contrib/gis/tests/geoapp/test_feeds.py
index 778cadc9d4..b2953b4a70 100644
--- a/django/contrib/gis/tests/geoapp/test_feeds.py
+++ b/django/contrib/gis/tests/geoapp/test_feeds.py
@@ -1,5 +1,6 @@
from __future__ import absolute_import
+from unittest import skipUnless
from xml.dom import minidom
from django.conf import settings
@@ -7,7 +8,6 @@ from django.contrib.sites.models import Site
from django.contrib.gis.geos import HAS_GEOS
from django.contrib.gis.tests.utils import HAS_SPATIAL_DB
from django.test import TestCase
-from django.utils.unittest import skipUnless
if HAS_GEOS:
from .models import City
diff --git a/django/contrib/gis/tests/geoapp/test_regress.py b/django/contrib/gis/tests/geoapp/test_regress.py
index 43dbcfd852..2ffbaec9a9 100644
--- a/django/contrib/gis/tests/geoapp/test_regress.py
+++ b/django/contrib/gis/tests/geoapp/test_regress.py
@@ -2,6 +2,7 @@
from __future__ import absolute_import, unicode_literals
from datetime import datetime
+from unittest import skipUnless
from django.contrib.gis.geos import HAS_GEOS
from django.contrib.gis.tests.utils import no_mysql, no_spatialite
@@ -9,7 +10,6 @@ from django.contrib.gis.shortcuts import render_to_kmz
from django.contrib.gis.tests.utils import HAS_SPATIAL_DB
from django.db.models import Count, Min
from django.test import TestCase
-from django.utils.unittest import skipUnless
if HAS_GEOS:
from .models import City, PennsylvaniaCity, State, Truth
diff --git a/django/contrib/gis/tests/geoapp/test_sitemaps.py b/django/contrib/gis/tests/geoapp/test_sitemaps.py
index 337b4b75c6..facd94c247 100644
--- a/django/contrib/gis/tests/geoapp/test_sitemaps.py
+++ b/django/contrib/gis/tests/geoapp/test_sitemaps.py
@@ -1,6 +1,7 @@
from __future__ import absolute_import
from io import BytesIO
+from unittest import skipUnless
from xml.dom import minidom
import zipfile
@@ -9,7 +10,6 @@ from django.contrib.gis.geos import HAS_GEOS
from django.contrib.gis.tests.utils import HAS_SPATIAL_DB
from django.contrib.sites.models import Site
from django.test import TestCase
-from django.utils.unittest import skipUnless
if HAS_GEOS:
from .models import City, Country
diff --git a/django/contrib/gis/tests/geoapp/tests.py b/django/contrib/gis/tests/geoapp/tests.py
index cf6e316919..89505ae1f2 100644
--- a/django/contrib/gis/tests/geoapp/tests.py
+++ b/django/contrib/gis/tests/geoapp/tests.py
@@ -1,6 +1,7 @@
from __future__ import absolute_import
import re
+from unittest import skipUnless
from django.db import connection
from django.contrib.gis import gdal
@@ -10,7 +11,6 @@ from django.contrib.gis.tests.utils import (
mysql, oracle, postgis, spatialite)
from django.test import TestCase
from django.utils import six, unittest
-from django.utils.unittest import skipUnless
if HAS_GEOS:
from django.contrib.gis.geos import (fromstr, GEOSGeometry,
diff --git a/django/contrib/gis/tests/geogapp/tests.py b/django/contrib/gis/tests/geogapp/tests.py
index ed54999f90..2a60f623fa 100644
--- a/django/contrib/gis/tests/geogapp/tests.py
+++ b/django/contrib/gis/tests/geogapp/tests.py
@@ -4,6 +4,7 @@ Tests for geography support in PostGIS 1.5+
from __future__ import absolute_import
import os
+from unittest import skipUnless
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.geos import HAS_GEOS
@@ -11,7 +12,6 @@ from django.contrib.gis.measure import D
from django.contrib.gis.tests.utils import postgis
from django.test import TestCase
from django.utils._os import upath
-from django.utils.unittest import skipUnless
if HAS_GEOS:
from .models import City, County, Zipcode
diff --git a/django/contrib/gis/tests/inspectapp/tests.py b/django/contrib/gis/tests/inspectapp/tests.py
index 668b87ba86..34dab1ab7d 100644
--- a/django/contrib/gis/tests/inspectapp/tests.py
+++ b/django/contrib/gis/tests/inspectapp/tests.py
@@ -1,13 +1,13 @@
from __future__ import absolute_import
import os
+from unittest import skipUnless
from django.db import connections
from django.test import TestCase
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.geometry.test_data import TEST_DATA
from django.contrib.gis.tests.utils import HAS_SPATIAL_DB
-from django.utils.unittest import skipUnless
if HAS_GDAL:
from django.contrib.gis.gdal import Driver
diff --git a/django/contrib/gis/tests/layermap/tests.py b/django/contrib/gis/tests/layermap/tests.py
index 8379311a2b..c4c27b353e 100644
--- a/django/contrib/gis/tests/layermap/tests.py
+++ b/django/contrib/gis/tests/layermap/tests.py
@@ -1,17 +1,17 @@
# coding: utf-8
from __future__ import absolute_import, unicode_literals
-import os
from copy import copy
from decimal import Decimal
+import os
+import unittest
+from unittest import skipUnless
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.tests.utils import HAS_SPATIAL_DB, mysql
from django.db import router
from django.conf import settings
from django.test import TestCase
-from django.utils import unittest
-from django.utils.unittest import skipUnless
from django.utils._os import upath
if HAS_GDAL:
diff --git a/django/contrib/gis/tests/relatedapp/tests.py b/django/contrib/gis/tests/relatedapp/tests.py
index d93adbcd4c..653bda8aaf 100644
--- a/django/contrib/gis/tests/relatedapp/tests.py
+++ b/django/contrib/gis/tests/relatedapp/tests.py
@@ -1,9 +1,10 @@
from __future__ import absolute_import
+from unittest import skipUnless
+
from django.contrib.gis.geos import HAS_GEOS
from django.contrib.gis.tests.utils import HAS_SPATIAL_DB, mysql, oracle, no_mysql, no_oracle, no_spatialite
from django.test import TestCase
-from django.utils.unittest import skipUnless
if HAS_GEOS:
from django.contrib.gis.db.models import Collect, Count, Extent, F, Union
diff --git a/django/contrib/gis/tests/test_geoforms.py b/django/contrib/gis/tests/test_geoforms.py
index 402d9b944b..b04bdea71d 100644
--- a/django/contrib/gis/tests/test_geoforms.py
+++ b/django/contrib/gis/tests/test_geoforms.py
@@ -1,15 +1,16 @@
+from unittest import skipUnless
+
from django.forms import ValidationError
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.tests.utils import HAS_SPATIALREFSYS
from django.test import SimpleTestCase
from django.utils import six
-from django.utils.unittest import skipUnless
-
if HAS_SPATIALREFSYS:
from django.contrib.gis import forms
from django.contrib.gis.geos import GEOSGeometry
+
@skipUnless(HAS_GDAL and HAS_SPATIALREFSYS, "GeometryFieldTest needs gdal support and a spatial database")
class GeometryFieldTest(SimpleTestCase):
@@ -143,7 +144,7 @@ class SpecializedFieldTest(SimpleTestCase):
def assertTextarea(self, geom, rendered):
"""Makes sure the wkt and a textarea are in the content"""
-
+
self.assertIn('<textarea ', rendered)
self.assertIn('required', rendered)
self.assertIn(geom.wkt, rendered)
diff --git a/django/contrib/gis/tests/test_measure.py b/django/contrib/gis/tests/test_measure.py
index 0428704d6c..8ce37994eb 100644
--- a/django/contrib/gis/tests/test_measure.py
+++ b/django/contrib/gis/tests/test_measure.py
@@ -3,8 +3,9 @@ Distance and Area objects to allow for sensible and convienient calculation
and conversions. Here are some tests.
"""
+import unittest
+
from django.contrib.gis.measure import Distance, Area, D, A
-from django.utils import unittest
class DistanceTest(unittest.TestCase):
diff --git a/django/contrib/gis/tests/test_spatialrefsys.py b/django/contrib/gis/tests/test_spatialrefsys.py
index f33883e9f1..8daa6acc23 100644
--- a/django/contrib/gis/tests/test_spatialrefsys.py
+++ b/django/contrib/gis/tests/test_spatialrefsys.py
@@ -1,8 +1,9 @@
+import unittest
+
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.tests.utils import (no_mysql, oracle, postgis,
spatialite, HAS_SPATIALREFSYS, SpatialRefSys)
from django.utils import six
-from django.utils import unittest
test_srs = ({'srid' : 4326,
diff --git a/django/contrib/humanize/tests.py b/django/contrib/humanize/tests.py
index 54a60f8fd6..f1fcbf2bb3 100644
--- a/django/contrib/humanize/tests.py
+++ b/django/contrib/humanize/tests.py
@@ -1,6 +1,7 @@
from __future__ import unicode_literals
import datetime
from decimal import Decimal
+from unittest import skipIf
try:
import pytz
@@ -17,7 +18,6 @@ from django.utils.timezone import utc
from django.utils import translation
from django.utils.translation import ugettext as _
from django.utils import tzinfo
-from django.utils.unittest import skipIf
from i18n import TransRealMixin
diff --git a/django/contrib/messages/tests/base.py b/django/contrib/messages/tests/base.py
index 0d689729aa..7011a5779a 100644
--- a/django/contrib/messages/tests/base.py
+++ b/django/contrib/messages/tests/base.py
@@ -1,3 +1,5 @@
+from unittest import skipIf
+
from django import http
from django.conf import settings, global_settings
from django.contrib.messages import constants, utils, get_level, set_level
@@ -7,7 +9,6 @@ from django.contrib.messages.storage.base import Message
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from django.utils.translation import ugettext_lazy
-from django.utils.unittest import skipIf
def skipUnlessAuthIsInstalled(func):
diff --git a/django/contrib/messages/tests/test_middleware.py b/django/contrib/messages/tests/test_middleware.py
index 5618c2d2b2..855f6b32a7 100644
--- a/django/contrib/messages/tests/test_middleware.py
+++ b/django/contrib/messages/tests/test_middleware.py
@@ -1,6 +1,7 @@
+import unittest
+
from django import http
from django.contrib.messages.middleware import MessageMiddleware
-from django.utils import unittest
class MiddlewareTest(unittest.TestCase):
diff --git a/django/contrib/sessions/tests.py b/django/contrib/sessions/tests.py
index cd8191a6a4..f2a35c544e 100644
--- a/django/contrib/sessions/tests.py
+++ b/django/contrib/sessions/tests.py
@@ -4,6 +4,7 @@ import os
import shutil
import string
import tempfile
+import unittest
import warnings
from django.conf import settings
@@ -22,7 +23,6 @@ from django.test import TestCase, RequestFactory
from django.test.utils import override_settings, patch_logger
from django.utils import six
from django.utils import timezone
-from django.utils import unittest
from django.contrib.sessions.exceptions import InvalidSessionKey
diff --git a/django/contrib/sitemaps/tests/test_flatpages.py b/django/contrib/sitemaps/tests/test_flatpages.py
index 930f24f22c..e034a457c2 100644
--- a/django/contrib/sitemaps/tests/test_flatpages.py
+++ b/django/contrib/sitemaps/tests/test_flatpages.py
@@ -1,7 +1,8 @@
from __future__ import unicode_literals
+from unittest import skipUnless
+
from django.conf import settings
-from django.utils.unittest import skipUnless
from .base import SitemapTestsBase
diff --git a/django/contrib/sitemaps/tests/test_http.py b/django/contrib/sitemaps/tests/test_http.py
index a99025e6e2..f68f345815 100644
--- a/django/contrib/sitemaps/tests/test_http.py
+++ b/django/contrib/sitemaps/tests/test_http.py
@@ -2,13 +2,13 @@ from __future__ import unicode_literals
import os
from datetime import date
+from unittest import skipUnless
from django.conf import settings
from django.contrib.sitemaps import Sitemap, GenericSitemap
from django.contrib.sites.models import Site
from django.core.exceptions import ImproperlyConfigured
from django.test.utils import override_settings
-from django.utils.unittest import skipUnless
from django.utils.formats import localize
from django.utils._os import upath
from django.utils.translation import activate, deactivate
diff --git a/django/test/runner.py b/django/test/runner.py
index e753e365fa..709b685de5 100644
--- a/django/test/runner.py
+++ b/django/test/runner.py
@@ -1,12 +1,12 @@
import os
from optparse import make_option
+import unittest
+from unittest import TestSuite, defaultTestLoader
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase
from django.test.utils import setup_test_environment, teardown_test_environment
-from django.utils import unittest
-from django.utils.unittest import TestSuite, defaultTestLoader
class DiscoverRunner(object):
diff --git a/django/test/testcases.py b/django/test/testcases.py
index 53b15158ca..c5299bdabc 100644
--- a/django/test/testcases.py
+++ b/django/test/testcases.py
@@ -8,13 +8,16 @@ import json
import os
import re
import sys
+import select
+import socket
+import threading
+import unittest
+from unittest import skipIf # Imported here for backward compatibility
+from unittest.util import safe_repr
try:
from urllib.parse import urlsplit, urlunsplit
except ImportError: # Python 2
from urlparse import urlsplit, urlunsplit
-import select
-import socket
-import threading
from django.conf import settings
from django.contrib.staticfiles.handlers import StaticFilesHandler
@@ -36,10 +39,8 @@ from django.test.html import HTMLParseError, parse_html
from django.test.signals import template_rendered
from django.test.utils import (CaptureQueriesContext, ContextList,
override_settings, compare_xml)
-from django.utils import six, unittest as ut2
+from django.utils import six
from django.utils.encoding import force_text
-from django.utils.unittest import skipIf # Imported here for backward compatibility
-from django.utils.unittest.util import safe_repr
from django.views.static import serve
@@ -155,7 +156,7 @@ class _AssertTemplateNotUsedContext(_AssertTemplateUsedContext):
return '%s was rendered.' % self.template_name
-class SimpleTestCase(ut2.TestCase):
+class SimpleTestCase(unittest.TestCase):
# The class we'll use for the test client self.client.
# Can be overridden in derived classes.
@@ -886,7 +887,7 @@ def _deferredSkip(condition, reason):
@wraps(test_func)
def skip_wrapper(*args, **kwargs):
if condition():
- raise ut2.SkipTest(reason)
+ raise unittest.SkipTest(reason)
return test_func(*args, **kwargs)
test_item = skip_wrapper
else: