Browse Source

Stopped using django.utils.unittest in the test suite.

Refs #20680.
Aymeric Augustin 11 years ago
parent
commit
cfcf4b3605
100 changed files with 174 additions and 135 deletions
  1. 1 1
      django/contrib/admin/tests.py
  2. 2 1
      django/contrib/admindocs/tests/test_fields.py
  3. 3 2
      django/contrib/auth/tests/test_hashers.py
  4. 2 2
      django/contrib/auth/tests/test_tokens.py
  5. 2 1
      django/contrib/auth/tests/utils.py
  6. 1 1
      django/contrib/formtools/tests/tests.py
  7. 3 2
      django/contrib/gis/gdal/tests/test_driver.py
  8. 2 2
      django/contrib/gis/gdal/tests/test_ds.py
  9. 4 3
      django/contrib/gis/gdal/tests/test_envelope.py
  10. 2 2
      django/contrib/gis/gdal/tests/test_geom.py
  11. 3 2
      django/contrib/gis/gdal/tests/test_srs.py
  12. 3 2
      django/contrib/gis/geoip/tests.py
  13. 2 2
      django/contrib/gis/geos/tests/test_geos.py
  14. 2 2
      django/contrib/gis/geos/tests/test_geos_mutation.py
  15. 1 1
      django/contrib/gis/geos/tests/test_io.py
  16. 3 1
      django/contrib/gis/geos/tests/test_mutable_list.py
  17. 2 1
      django/contrib/gis/tests/distapp/tests.py
  18. 1 1
      django/contrib/gis/tests/geo3d/tests.py
  19. 2 1
      django/contrib/gis/tests/geoadmin/tests.py
  20. 1 1
      django/contrib/gis/tests/geoapp/test_feeds.py
  21. 1 1
      django/contrib/gis/tests/geoapp/test_regress.py
  22. 1 1
      django/contrib/gis/tests/geoapp/test_sitemaps.py
  23. 1 1
      django/contrib/gis/tests/geoapp/tests.py
  24. 1 1
      django/contrib/gis/tests/geogapp/tests.py
  25. 1 1
      django/contrib/gis/tests/inspectapp/tests.py
  26. 3 3
      django/contrib/gis/tests/layermap/tests.py
  27. 2 1
      django/contrib/gis/tests/relatedapp/tests.py
  28. 4 3
      django/contrib/gis/tests/test_geoforms.py
  29. 2 1
      django/contrib/gis/tests/test_measure.py
  30. 2 1
      django/contrib/gis/tests/test_spatialrefsys.py
  31. 1 1
      django/contrib/humanize/tests.py
  32. 2 1
      django/contrib/messages/tests/base.py
  33. 2 1
      django/contrib/messages/tests/test_middleware.py
  34. 1 1
      django/contrib/sessions/tests.py
  35. 2 1
      django/contrib/sitemaps/tests/test_flatpages.py
  36. 1 1
      django/contrib/sitemaps/tests/test_http.py
  37. 2 2
      django/test/runner.py
  38. 9 8
      django/test/testcases.py
  39. 1 1
      docs/topics/testing/advanced.txt
  40. 2 2
      docs/topics/testing/overview.txt
  41. 2 2
      tests/admin_scripts/tests.py
  42. 1 1
      tests/admin_widgets/tests.py
  43. 0 1
      tests/aggregation_regress/tests.py
  44. 2 1
      tests/app_loading/tests.py
  45. 1 1
      tests/bash_completion/tests.py
  46. 1 1
      tests/bug639/tests.py
  47. 2 1
      tests/bug8245/tests.py
  48. 1 1
      tests/builtin_server/tests.py
  49. 1 1
      tests/db_typecasts/tests.py
  50. 1 1
      tests/decorators/tests.py
  51. 2 1
      tests/defaultfilters/tests.py
  52. 1 1
      tests/dispatch/tests/test_dispatcher.py
  53. 2 1
      tests/dispatch/tests/test_saferef.py
  54. 1 1
      tests/file_storage/tests.py
  55. 1 1
      tests/file_uploads/tests.py
  56. 1 1
      tests/files/tests.py
  57. 2 1
      tests/forms_tests/tests/test_validators.py
  58. 1 1
      tests/generic_views/test_base.py
  59. 1 1
      tests/generic_views/test_dates.py
  60. 1 1
      tests/generic_views/test_edit.py
  61. 1 1
      tests/httpwrappers/tests.py
  62. 2 1
      tests/indexes/tests.py
  63. 1 1
      tests/inspectdb/tests.py
  64. 2 1
      tests/introspection/tests.py
  65. 1 2
      tests/invalid_models/tests.py
  66. 1 1
      tests/logging_tests/tests.py
  67. 2 2
      tests/max_lengths/tests.py
  68. 1 1
      tests/middleware/tests.py
  69. 1 1
      tests/model_fields/test_imagefield.py
  70. 1 1
      tests/model_fields/tests.py
  71. 1 1
      tests/model_forms/tests.py
  72. 1 1
      tests/model_forms_regress/tests.py
  73. 2 2
      tests/model_inheritance_regress/tests.py
  74. 1 1
      tests/model_regress/tests.py
  75. 2 1
      tests/modeladmin/tests.py
  76. 1 1
      tests/pagination/tests.py
  77. 1 1
      tests/queries/tests.py
  78. 3 3
      tests/requests/tests.py
  79. 2 1
      tests/resolve_url/tests.py
  80. 1 1
      tests/select_for_update/tests.py
  81. 2 1
      tests/select_related_onetoone/tests.py
  82. 1 1
      tests/serializers/tests.py
  83. 2 2
      tests/serializers_regress/tests.py
  84. 2 1
      tests/settings_tests/tests.py
  85. 1 1
      tests/str/tests.py
  86. 4 3
      tests/template_tests/loaders.py
  87. 2 1
      tests/template_tests/test_callables.py
  88. 3 1
      tests/template_tests/test_context.py
  89. 2 1
      tests/template_tests/test_custom.py
  90. 2 1
      tests/template_tests/test_nodelist.py
  91. 2 1
      tests/template_tests/test_parser.py
  92. 2 1
      tests/template_tests/test_smartif.py
  93. 2 1
      tests/template_tests/test_unicode.py
  94. 1 1
      tests/template_tests/tests.py
  95. 1 1
      tests/test_runner/test_discover_runner.py
  96. 2 2
      tests/test_runner/tests.py
  97. 2 1
      tests/test_suite_override/tests.py
  98. 3 2
      tests/test_utils/tests.py
  99. 1 1
      tests/timezones/tests.py
  100. 1 1
      tests/transactions/tests.py

+ 1 - 1
django/contrib/admin/tests.py

@@ -1,8 +1,8 @@
 import os
 import os
+from unittest import SkipTest
 
 
 from django.test import LiveServerTestCase
 from django.test import LiveServerTestCase
 from django.utils.module_loading import import_by_path
 from django.utils.module_loading import import_by_path
-from django.utils.unittest import SkipTest
 from django.utils.translation import ugettext as _
 from django.utils.translation import ugettext as _
 
 
 
 

+ 2 - 1
django/contrib/admindocs/tests/test_fields.py

@@ -1,9 +1,10 @@
 from __future__ import absolute_import, unicode_literals
 from __future__ import absolute_import, unicode_literals
 
 
+import unittest
+
 from django.contrib.admindocs import views
 from django.contrib.admindocs import views
 from django.db import models
 from django.db import models
 from django.db.models import fields
 from django.db.models import fields
-from django.utils import unittest
 from django.utils.translation import ugettext as _
 from django.utils.translation import ugettext as _
 
 
 
 

+ 3 - 2
django/contrib/auth/tests/test_hashers.py

@@ -1,13 +1,14 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 from __future__ import unicode_literals
 from __future__ import unicode_literals
 
 
+import unittest
+from unittest import skipUnless
+
 from django.conf.global_settings import PASSWORD_HASHERS as default_hashers
 from django.conf.global_settings import PASSWORD_HASHERS as default_hashers
 from django.contrib.auth.hashers import (is_password_usable, BasePasswordHasher,
 from django.contrib.auth.hashers import (is_password_usable, BasePasswordHasher,
     check_password, make_password, PBKDF2PasswordHasher, load_hashers, PBKDF2SHA1PasswordHasher,
     check_password, make_password, PBKDF2PasswordHasher, load_hashers, PBKDF2SHA1PasswordHasher,
     get_hasher, identify_hasher, UNUSABLE_PASSWORD_PREFIX, UNUSABLE_PASSWORD_SUFFIX_LENGTH)
     get_hasher, identify_hasher, UNUSABLE_PASSWORD_PREFIX, UNUSABLE_PASSWORD_SUFFIX_LENGTH)
 from django.utils import six
 from django.utils import six
-from django.utils import unittest
-from django.utils.unittest import skipUnless
 
 
 
 
 try:
 try:

+ 2 - 2
django/contrib/auth/tests/test_tokens.py

@@ -1,12 +1,12 @@
-import sys
 from datetime import date, timedelta
 from datetime import date, timedelta
+import sys
+import unittest
 
 
 from django.conf import settings
 from django.conf import settings
 from django.contrib.auth.models import User
 from django.contrib.auth.models import User
 from django.contrib.auth.tokens import PasswordResetTokenGenerator
 from django.contrib.auth.tokens import PasswordResetTokenGenerator
 from django.contrib.auth.tests.utils import skipIfCustomUser
 from django.contrib.auth.tests.utils import skipIfCustomUser
 from django.test import TestCase
 from django.test import TestCase
-from django.utils import unittest
 
 
 
 
 @skipIfCustomUser
 @skipIfCustomUser

+ 2 - 1
django/contrib/auth/tests/utils.py

@@ -1,5 +1,6 @@
+from unittest import skipIf
+
 from django.conf import settings
 from django.conf import settings
-from django.utils.unittest import skipIf
 
 
 
 
 def skipIfCustomUser(test_func):
 def skipIfCustomUser(test_func):

+ 1 - 1
django/contrib/formtools/tests/tests.py

@@ -3,6 +3,7 @@ from __future__ import unicode_literals
 
 
 import datetime
 import datetime
 import os
 import os
+import unittest
 import warnings
 import warnings
 
 
 from django import http
 from django import http
@@ -10,7 +11,6 @@ from django.contrib.formtools import preview, utils
 from django.test import TestCase
 from django.test import TestCase
 from django.test.utils import override_settings
 from django.test.utils import override_settings
 from django.utils._os import upath
 from django.utils._os import upath
-from django.utils import unittest
 
 
 from django.contrib.formtools.tests.forms import *
 from django.contrib.formtools.tests.forms import *
 
 

+ 3 - 2
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.contrib.gis.gdal import HAS_GDAL
-from django.utils import unittest
-from django.utils.unittest import skipUnless
 
 
 if HAS_GDAL:
 if HAS_GDAL:
     from django.contrib.gis.gdal import Driver, OGRException
     from django.contrib.gis.gdal import Driver, OGRException

+ 2 - 2
django/contrib/gis/gdal/tests/test_ds.py

@@ -1,9 +1,9 @@
 import os
 import os
+import unittest
+from unittest import skipUnless
 
 
 from django.contrib.gis.gdal import HAS_GDAL
 from django.contrib.gis.gdal import HAS_GDAL
 from django.contrib.gis.geometry.test_data import get_ds_file, TestDS, TEST_DATA
 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:
 if HAS_GDAL:
     from django.contrib.gis.gdal import DataSource, Envelope, OGRGeometry, OGRException, OGRIndexError, GDAL_VERSION
     from django.contrib.gis.gdal import DataSource, Envelope, OGRGeometry, OGRException, OGRIndexError, GDAL_VERSION

+ 4 - 3
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.contrib.gis.gdal import HAS_GDAL
-from django.utils import unittest
-from django.utils.unittest import skipUnless
 
 
 if HAS_GDAL:
 if HAS_GDAL:
     from django.contrib.gis.gdal import Envelope, OGRException
     from django.contrib.gis.gdal import Envelope, OGRException
@@ -17,7 +18,7 @@ class EnvelopeTest(unittest.TestCase):
 
 
     def setUp(self):
     def setUp(self):
         self.e = Envelope(0, 0, 5, 5)
         self.e = Envelope(0, 0, 5, 5)
-    
+
     def test01_init(self):
     def test01_init(self):
         "Testing Envelope initilization."
         "Testing Envelope initilization."
         e1 = Envelope((0, 0, 5, 5))
         e1 = Envelope((0, 0, 5, 5))

+ 2 - 2
django/contrib/gis/gdal/tests/test_geom.py

@@ -4,12 +4,12 @@ try:
     from django.utils.six.moves import cPickle as pickle
     from django.utils.six.moves import cPickle as pickle
 except ImportError:
 except ImportError:
     import pickle
     import pickle
+import unittest
+from unittest import skipUnless
 
 
 from django.contrib.gis.gdal import HAS_GDAL
 from django.contrib.gis.gdal import HAS_GDAL
 from django.contrib.gis.geometry.test_data import TestDataMixin
 from django.contrib.gis.geometry.test_data import TestDataMixin
 from django.utils.six.moves import xrange
 from django.utils.six.moves import xrange
-from django.utils import unittest
-from django.utils.unittest import skipUnless
 
 
 if HAS_GDAL:
 if HAS_GDAL:
     from django.contrib.gis.gdal import (OGRGeometry, OGRGeomType,
     from django.contrib.gis.gdal import (OGRGeometry, OGRGeomType,

+ 3 - 2
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.contrib.gis.gdal import HAS_GDAL
-from django.utils import unittest
-from django.utils.unittest import skipUnless
 
 
 if HAS_GDAL:
 if HAS_GDAL:
     from django.contrib.gis.gdal import SpatialReference, CoordTransform, OGRException, SRSException
     from django.contrib.gis.gdal import SpatialReference, CoordTransform, OGRException, SRSException

+ 3 - 2
django/contrib/gis/geoip/tests.py

@@ -2,11 +2,12 @@
 from __future__ import unicode_literals
 from __future__ import unicode_literals
 
 
 import os
 import os
+import unittest
+from unittest import skipUnless
+
 from django.conf import settings
 from django.conf import settings
 from django.contrib.gis.geos import HAS_GEOS
 from django.contrib.gis.geos import HAS_GEOS
 from django.contrib.gis.geoip import HAS_GEOIP
 from django.contrib.gis.geoip import HAS_GEOIP
-from django.utils import unittest
-from django.utils.unittest import skipUnless
 
 
 from django.utils import six
 from django.utils import six
 
 

+ 2 - 2
django/contrib/gis/geos/tests/test_geos.py

@@ -3,6 +3,8 @@ from __future__ import unicode_literals
 import ctypes
 import ctypes
 import json
 import json
 import random
 import random
+import unittest
+from unittest import skipUnless
 from binascii import a2b_hex, b2a_hex
 from binascii import a2b_hex, b2a_hex
 from io import BytesIO
 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.encoding import force_bytes
 from django.utils import six
 from django.utils import six
 from django.utils.six.moves import xrange
 from django.utils.six.moves import xrange
-from django.utils import unittest
-from django.utils.unittest import skipUnless
 
 
 from .. import HAS_GEOS
 from .. import HAS_GEOS
 
 

+ 2 - 2
django/contrib/gis/geos/tests/test_geos_mutation.py

@@ -2,8 +2,8 @@
 # Modified from original contribution by Aryeh Leib Taurog, which was
 # Modified from original contribution by Aryeh Leib Taurog, which was
 # released under the New BSD license.
 # released under the New BSD license.
 
 
-from django.utils import unittest
+import unittest
-from django.utils.unittest import skipUnless
+from unittest import skipUnless
 
 
 from .. import HAS_GEOS
 from .. import HAS_GEOS
 
 

+ 1 - 1
django/contrib/gis/geos/tests/test_io.py

@@ -2,9 +2,9 @@ from __future__ import unicode_literals
 
 
 import binascii
 import binascii
 import unittest
 import unittest
+from unittest import skipUnless
 
 
 from django.contrib.gis import memoryview
 from django.contrib.gis import memoryview
-from django.utils.unittest import skipUnless
 
 
 from ..import HAS_GEOS
 from ..import HAS_GEOS
 
 

+ 3 - 1
django/contrib/gis/geos/tests/test_mutable_list.py

@@ -3,9 +3,11 @@
 #
 #
 # Modified from original contribution by Aryeh Leib Taurog, which was
 # Modified from original contribution by Aryeh Leib Taurog, which was
 # released under the New BSD license.
 # released under the New BSD license.
+
+import unittest
+
 from django.contrib.gis.geos.mutable_list import ListMixin
 from django.contrib.gis.geos.mutable_list import ListMixin
 from django.utils import six
 from django.utils import six
-from django.utils import unittest
 
 
 
 
 class UserListA(ListMixin):
 class UserListA(ListMixin):

+ 2 - 1
django/contrib/gis/tests/distapp/tests.py

@@ -1,5 +1,7 @@
 from __future__ import absolute_import
 from __future__ import absolute_import
 
 
+from unittest import skipUnless
+
 from django.db import connection
 from django.db import connection
 from django.db.models import Q
 from django.db.models import Q
 from django.contrib.gis.geos import HAS_GEOS
 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
     HAS_SPATIAL_DB, mysql, oracle, postgis, spatialite, no_oracle, no_spatialite
 )
 )
 from django.test import TestCase
 from django.test import TestCase
-from django.utils.unittest import skipUnless
 
 
 if HAS_GEOS and HAS_SPATIAL_DB:
 if HAS_GEOS and HAS_SPATIAL_DB:
     from django.contrib.gis.geos import GEOSGeometry, LineString
     from django.contrib.gis.geos import GEOSGeometry, LineString

+ 1 - 1
django/contrib/gis/tests/geo3d/tests.py

@@ -2,13 +2,13 @@ from __future__ import absolute_import, unicode_literals
 
 
 import os
 import os
 import re
 import re
+from unittest import skipUnless
 
 
 from django.contrib.gis.gdal import HAS_GDAL
 from django.contrib.gis.gdal import HAS_GDAL
 from django.contrib.gis.geos import HAS_GEOS
 from django.contrib.gis.geos import HAS_GEOS
 from django.contrib.gis.tests.utils import postgis
 from django.contrib.gis.tests.utils import postgis
 from django.test import TestCase
 from django.test import TestCase
 from django.utils._os import upath
 from django.utils._os import upath
-from django.utils.unittest import skipUnless
 
 
 if HAS_GEOS:
 if HAS_GEOS:
     from django.contrib.gis.db.models import Union, Extent3D
     from django.contrib.gis.db.models import Union, Extent3D

+ 2 - 1
django/contrib/gis/tests/geoadmin/tests.py

@@ -1,9 +1,10 @@
 from __future__ import absolute_import
 from __future__ import absolute_import
 
 
+from unittest import skipUnless
+
 from django.test import TestCase
 from django.test import TestCase
 from django.contrib.gis.geos import HAS_GEOS
 from django.contrib.gis.geos import HAS_GEOS
 from django.contrib.gis.tests.utils import HAS_SPATIAL_DB
 from django.contrib.gis.tests.utils import HAS_SPATIAL_DB
-from django.utils.unittest import skipUnless
 
 
 if HAS_GEOS and HAS_SPATIAL_DB:
 if HAS_GEOS and HAS_SPATIAL_DB:
     from django.contrib.gis import admin
     from django.contrib.gis import admin

+ 1 - 1
django/contrib/gis/tests/geoapp/test_feeds.py

@@ -1,5 +1,6 @@
 from __future__ import absolute_import
 from __future__ import absolute_import
 
 
+from unittest import skipUnless
 from xml.dom import minidom
 from xml.dom import minidom
 
 
 from django.conf import settings
 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.geos import HAS_GEOS
 from django.contrib.gis.tests.utils import HAS_SPATIAL_DB
 from django.contrib.gis.tests.utils import HAS_SPATIAL_DB
 from django.test import TestCase
 from django.test import TestCase
-from django.utils.unittest import skipUnless
 
 
 if HAS_GEOS:
 if HAS_GEOS:
     from .models import City
     from .models import City

+ 1 - 1
django/contrib/gis/tests/geoapp/test_regress.py

@@ -2,6 +2,7 @@
 from __future__ import absolute_import, unicode_literals
 from __future__ import absolute_import, unicode_literals
 
 
 from datetime import datetime
 from datetime import datetime
+from unittest import skipUnless
 
 
 from django.contrib.gis.geos import HAS_GEOS
 from django.contrib.gis.geos import HAS_GEOS
 from django.contrib.gis.tests.utils import no_mysql, no_spatialite
 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.contrib.gis.tests.utils import HAS_SPATIAL_DB
 from django.db.models import Count, Min
 from django.db.models import Count, Min
 from django.test import TestCase
 from django.test import TestCase
-from django.utils.unittest import skipUnless
 
 
 if HAS_GEOS:
 if HAS_GEOS:
     from .models import City, PennsylvaniaCity, State, Truth
     from .models import City, PennsylvaniaCity, State, Truth

+ 1 - 1
django/contrib/gis/tests/geoapp/test_sitemaps.py

@@ -1,6 +1,7 @@
 from __future__ import absolute_import
 from __future__ import absolute_import
 
 
 from io import BytesIO
 from io import BytesIO
+from unittest import skipUnless
 from xml.dom import minidom
 from xml.dom import minidom
 import zipfile
 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.gis.tests.utils import HAS_SPATIAL_DB
 from django.contrib.sites.models import Site
 from django.contrib.sites.models import Site
 from django.test import TestCase
 from django.test import TestCase
-from django.utils.unittest import skipUnless
 
 
 if HAS_GEOS:
 if HAS_GEOS:
     from .models import City, Country
     from .models import City, Country

+ 1 - 1
django/contrib/gis/tests/geoapp/tests.py

@@ -1,6 +1,7 @@
 from __future__ import absolute_import
 from __future__ import absolute_import
 
 
 import re
 import re
+from unittest import skipUnless
 
 
 from django.db import connection
 from django.db import connection
 from django.contrib.gis import gdal
 from django.contrib.gis import gdal
@@ -10,7 +11,6 @@ from django.contrib.gis.tests.utils import (
     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, unittest
-from django.utils.unittest import skipUnless
 
 
 if HAS_GEOS:
 if HAS_GEOS:
     from django.contrib.gis.geos import (fromstr, GEOSGeometry,
     from django.contrib.gis.geos import (fromstr, GEOSGeometry,

+ 1 - 1
django/contrib/gis/tests/geogapp/tests.py

@@ -4,6 +4,7 @@ Tests for geography support in PostGIS 1.5+
 from __future__ import absolute_import
 from __future__ import absolute_import
 
 
 import os
 import os
+from unittest import skipUnless
 
 
 from django.contrib.gis.gdal import HAS_GDAL
 from django.contrib.gis.gdal import HAS_GDAL
 from django.contrib.gis.geos import HAS_GEOS
 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.contrib.gis.tests.utils import postgis
 from django.test import TestCase
 from django.test import TestCase
 from django.utils._os import upath
 from django.utils._os import upath
-from django.utils.unittest import skipUnless
 
 
 if HAS_GEOS:
 if HAS_GEOS:
     from .models import City, County, Zipcode
     from .models import City, County, Zipcode

+ 1 - 1
django/contrib/gis/tests/inspectapp/tests.py

@@ -1,13 +1,13 @@
 from __future__ import absolute_import
 from __future__ import absolute_import
 
 
 import os
 import os
+from unittest import skipUnless
 
 
 from django.db import connections
 from django.db import connections
 from django.test import TestCase
 from django.test import TestCase
 from django.contrib.gis.gdal import HAS_GDAL
 from django.contrib.gis.gdal import HAS_GDAL
 from django.contrib.gis.geometry.test_data import TEST_DATA
 from django.contrib.gis.geometry.test_data import TEST_DATA
 from django.contrib.gis.tests.utils import HAS_SPATIAL_DB
 from django.contrib.gis.tests.utils import HAS_SPATIAL_DB
-from django.utils.unittest import skipUnless
 
 
 if HAS_GDAL:
 if HAS_GDAL:
     from django.contrib.gis.gdal import Driver
     from django.contrib.gis.gdal import Driver

+ 3 - 3
django/contrib/gis/tests/layermap/tests.py

@@ -1,17 +1,17 @@
 # coding: utf-8
 # coding: utf-8
 from __future__ import absolute_import, unicode_literals
 from __future__ import absolute_import, unicode_literals
 
 
-import os
 from copy import copy
 from copy import copy
 from decimal import Decimal
 from decimal import Decimal
+import os
+import unittest
+from unittest import skipUnless
 
 
 from django.contrib.gis.gdal import HAS_GDAL
 from django.contrib.gis.gdal import HAS_GDAL
 from django.contrib.gis.tests.utils import HAS_SPATIAL_DB, mysql
 from django.contrib.gis.tests.utils import HAS_SPATIAL_DB, mysql
 from django.db import router
 from django.db import router
 from django.conf import settings
 from django.conf import settings
 from django.test import TestCase
 from django.test import TestCase
-from django.utils import unittest
-from django.utils.unittest import skipUnless
 from django.utils._os import upath
 from django.utils._os import upath
 
 
 if HAS_GDAL:
 if HAS_GDAL:

+ 2 - 1
django/contrib/gis/tests/relatedapp/tests.py

@@ -1,9 +1,10 @@
 from __future__ import absolute_import
 from __future__ import absolute_import
 
 
+from unittest import skipUnless
+
 from django.contrib.gis.geos import HAS_GEOS
 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.contrib.gis.tests.utils import HAS_SPATIAL_DB, mysql, oracle, no_mysql, no_oracle, no_spatialite
 from django.test import TestCase
 from django.test import TestCase
-from django.utils.unittest import skipUnless
 
 
 if HAS_GEOS:
 if HAS_GEOS:
     from django.contrib.gis.db.models import Collect, Count, Extent, F, Union
     from django.contrib.gis.db.models import Collect, Count, Extent, F, Union

+ 4 - 3
django/contrib/gis/tests/test_geoforms.py

@@ -1,15 +1,16 @@
+from unittest import skipUnless
+
 from django.forms import ValidationError
 from django.forms import ValidationError
 from django.contrib.gis.gdal import HAS_GDAL
 from django.contrib.gis.gdal import HAS_GDAL
 from django.contrib.gis.tests.utils import HAS_SPATIALREFSYS
 from django.contrib.gis.tests.utils import HAS_SPATIALREFSYS
 from django.test import SimpleTestCase
 from django.test import SimpleTestCase
 from django.utils import six
 from django.utils import six
-from django.utils.unittest import skipUnless
-
 
 
 if HAS_SPATIALREFSYS:
 if HAS_SPATIALREFSYS:
     from django.contrib.gis import forms
     from django.contrib.gis import forms
     from django.contrib.gis.geos import GEOSGeometry
     from django.contrib.gis.geos import GEOSGeometry
 
 
+
 @skipUnless(HAS_GDAL and HAS_SPATIALREFSYS, "GeometryFieldTest needs gdal support and a spatial database")
 @skipUnless(HAS_GDAL and HAS_SPATIALREFSYS, "GeometryFieldTest needs gdal support and a spatial database")
 class GeometryFieldTest(SimpleTestCase):
 class GeometryFieldTest(SimpleTestCase):
 
 
@@ -143,7 +144,7 @@ class SpecializedFieldTest(SimpleTestCase):
 
 
     def assertTextarea(self, geom, rendered):
     def assertTextarea(self, geom, rendered):
         """Makes sure the wkt and a textarea are in the content"""
         """Makes sure the wkt and a textarea are in the content"""
-        
+
         self.assertIn('<textarea ', rendered)
         self.assertIn('<textarea ', rendered)
         self.assertIn('required', rendered)
         self.assertIn('required', rendered)
         self.assertIn(geom.wkt, rendered)
         self.assertIn(geom.wkt, rendered)

+ 2 - 1
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.
 and conversions. Here are some tests.
 """
 """
 
 
+import unittest
+
 from django.contrib.gis.measure import Distance, Area, D, A
 from django.contrib.gis.measure import Distance, Area, D, A
-from django.utils import unittest
 
 
 
 
 class DistanceTest(unittest.TestCase):
 class DistanceTest(unittest.TestCase):

+ 2 - 1
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.gdal import HAS_GDAL
 from django.contrib.gis.tests.utils import (no_mysql, oracle, postgis,
 from django.contrib.gis.tests.utils import (no_mysql, oracle, postgis,
     spatialite, HAS_SPATIALREFSYS, SpatialRefSys)
     spatialite, HAS_SPATIALREFSYS, SpatialRefSys)
 from django.utils import six
 from django.utils import six
-from django.utils import unittest
 
 
 
 
 test_srs = ({'srid' : 4326,
 test_srs = ({'srid' : 4326,

+ 1 - 1
django/contrib/humanize/tests.py

@@ -1,6 +1,7 @@
 from __future__ import unicode_literals
 from __future__ import unicode_literals
 import datetime
 import datetime
 from decimal import Decimal
 from decimal import Decimal
+from unittest import skipIf
 
 
 try:
 try:
     import pytz
     import pytz
@@ -17,7 +18,6 @@ from django.utils.timezone import utc
 from django.utils import translation
 from django.utils import translation
 from django.utils.translation import ugettext as _
 from django.utils.translation import ugettext as _
 from django.utils import tzinfo
 from django.utils import tzinfo
-from django.utils.unittest import skipIf
 
 
 from i18n import TransRealMixin
 from i18n import TransRealMixin
 
 

+ 2 - 1
django/contrib/messages/tests/base.py

@@ -1,3 +1,5 @@
+from unittest import skipIf
+
 from django import http
 from django import http
 from django.conf import settings, global_settings
 from django.conf import settings, global_settings
 from django.contrib.messages import constants, utils, get_level, set_level
 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.core.urlresolvers import reverse
 from django.test.utils import override_settings
 from django.test.utils import override_settings
 from django.utils.translation import ugettext_lazy
 from django.utils.translation import ugettext_lazy
-from django.utils.unittest import skipIf
 
 
 
 
 def skipUnlessAuthIsInstalled(func):
 def skipUnlessAuthIsInstalled(func):

+ 2 - 1
django/contrib/messages/tests/test_middleware.py

@@ -1,6 +1,7 @@
+import unittest
+
 from django import http
 from django import http
 from django.contrib.messages.middleware import MessageMiddleware
 from django.contrib.messages.middleware import MessageMiddleware
-from django.utils import unittest
 
 
 
 
 class MiddlewareTest(unittest.TestCase):
 class MiddlewareTest(unittest.TestCase):

+ 1 - 1
django/contrib/sessions/tests.py

@@ -4,6 +4,7 @@ import os
 import shutil
 import shutil
 import string
 import string
 import tempfile
 import tempfile
+import unittest
 import warnings
 import warnings
 
 
 from django.conf import settings
 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.test.utils import override_settings, patch_logger
 from django.utils import six
 from django.utils import six
 from django.utils import timezone
 from django.utils import timezone
-from django.utils import unittest
 
 
 from django.contrib.sessions.exceptions import InvalidSessionKey
 from django.contrib.sessions.exceptions import InvalidSessionKey
 
 

+ 2 - 1
django/contrib/sitemaps/tests/test_flatpages.py

@@ -1,7 +1,8 @@
 from __future__ import unicode_literals
 from __future__ import unicode_literals
 
 
+from unittest import skipUnless
+
 from django.conf import settings
 from django.conf import settings
-from django.utils.unittest import skipUnless
 
 
 from .base import SitemapTestsBase
 from .base import SitemapTestsBase
 
 

+ 1 - 1
django/contrib/sitemaps/tests/test_http.py

@@ -2,13 +2,13 @@ from __future__ import unicode_literals
 
 
 import os
 import os
 from datetime import date
 from datetime import date
+from unittest import skipUnless
 
 
 from django.conf import settings
 from django.conf import settings
 from django.contrib.sitemaps import Sitemap, GenericSitemap
 from django.contrib.sitemaps import Sitemap, GenericSitemap
 from django.contrib.sites.models import Site
 from django.contrib.sites.models import Site
 from django.core.exceptions import ImproperlyConfigured
 from django.core.exceptions import ImproperlyConfigured
 from django.test.utils import override_settings
 from django.test.utils import override_settings
-from django.utils.unittest import skipUnless
 from django.utils.formats import localize
 from django.utils.formats import localize
 from django.utils._os import upath
 from django.utils._os import upath
 from django.utils.translation import activate, deactivate
 from django.utils.translation import activate, deactivate

+ 2 - 2
django/test/runner.py

@@ -1,12 +1,12 @@
 import os
 import os
 from optparse import make_option
 from optparse import make_option
+import unittest
+from unittest import TestSuite, defaultTestLoader
 
 
 from django.conf import settings
 from django.conf import settings
 from django.core.exceptions import ImproperlyConfigured
 from django.core.exceptions import ImproperlyConfigured
 from django.test import TestCase
 from django.test import TestCase
 from django.test.utils import setup_test_environment, teardown_test_environment
 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):
 class DiscoverRunner(object):

+ 9 - 8
django/test/testcases.py

@@ -8,13 +8,16 @@ import json
 import os
 import os
 import re
 import re
 import sys
 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:
 try:
     from urllib.parse import urlsplit, urlunsplit
     from urllib.parse import urlsplit, urlunsplit
 except ImportError:     # Python 2
 except ImportError:     # Python 2
     from urlparse import urlsplit, urlunsplit
     from urlparse import urlsplit, urlunsplit
-import select
-import socket
-import threading
 
 
 from django.conf import settings
 from django.conf import settings
 from django.contrib.staticfiles.handlers import StaticFilesHandler
 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.signals import template_rendered
 from django.test.utils import (CaptureQueriesContext, ContextList,
 from django.test.utils import (CaptureQueriesContext, ContextList,
     override_settings, compare_xml)
     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.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
 from django.views.static import serve
 
 
 
 
@@ -155,7 +156,7 @@ class _AssertTemplateNotUsedContext(_AssertTemplateUsedContext):
         return '%s was rendered.' % self.template_name
         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.
     # The class we'll use for the test client self.client.
     # Can be overridden in derived classes.
     # Can be overridden in derived classes.
@@ -886,7 +887,7 @@ def _deferredSkip(condition, reason):
             @wraps(test_func)
             @wraps(test_func)
             def skip_wrapper(*args, **kwargs):
             def skip_wrapper(*args, **kwargs):
                 if condition():
                 if condition():
-                    raise ut2.SkipTest(reason)
+                    raise unittest.SkipTest(reason)
                 return test_func(*args, **kwargs)
                 return test_func(*args, **kwargs)
             test_item = skip_wrapper
             test_item = skip_wrapper
         else:
         else:

+ 1 - 1
docs/topics/testing/advanced.txt

@@ -37,7 +37,7 @@ Example
 
 
 The following is a simple unit test using the request factory::
 The following is a simple unit test using the request factory::
 
 
-    from django.utils import unittest
+    import unittest
     from django.test.client import RequestFactory
     from django.test.client import RequestFactory
 
 
     class SimpleTest(unittest.TestCase):
     class SimpleTest(unittest.TestCase):

+ 2 - 2
docs/topics/testing/overview.txt

@@ -800,7 +800,7 @@ Example
 
 
 The following is a simple unit test using the test client::
 The following is a simple unit test using the test client::
 
 
-    from django.utils import unittest
+    import unittest
     from django.test.client import Client
     from django.test.client import Client
 
 
     class SimpleTest(unittest.TestCase):
     class SimpleTest(unittest.TestCase):
@@ -1143,7 +1143,7 @@ worry about state (such as cookies) carrying over from one test to another.
 
 
 This means, instead of instantiating a ``Client`` in each test::
 This means, instead of instantiating a ``Client`` in each test::
 
 
-    from django.utils import unittest
+    import unittest
     from django.test.client import Client
     from django.test.client import Client
 
 
     class SimpleTest(unittest.TestCase):
     class SimpleTest(unittest.TestCase):

+ 2 - 2
tests/admin_scripts/tests.py

@@ -6,13 +6,14 @@ and default settings.py files.
 """
 """
 from __future__ import unicode_literals
 from __future__ import unicode_literals
 
 
+import codecs
 import os
 import os
 import re
 import re
 import shutil
 import shutil
 import socket
 import socket
 import subprocess
 import subprocess
 import sys
 import sys
-import codecs
+import unittest
 
 
 import django
 import django
 from django import conf, get_version
 from django import conf, get_version
@@ -20,7 +21,6 @@ from django.conf import settings
 from django.core.management import BaseCommand, CommandError
 from django.core.management import BaseCommand, CommandError
 from django.db import connection
 from django.db import connection
 from django.test.runner import DiscoverRunner
 from django.test.runner import DiscoverRunner
-from django.utils import unittest
 from django.utils.encoding import force_text
 from django.utils.encoding import force_text
 from django.utils._os import upath
 from django.utils._os import upath
 from django.utils.six import StringIO
 from django.utils.six import StringIO

+ 1 - 1
tests/admin_widgets/tests.py

@@ -2,6 +2,7 @@
 from __future__ import absolute_import, unicode_literals
 from __future__ import absolute_import, unicode_literals
 
 
 from datetime import datetime
 from datetime import datetime
+from unittest import TestCase
 
 
 from django import forms
 from django import forms
 from django.conf import settings
 from django.conf import settings
@@ -16,7 +17,6 @@ from django.test.utils import override_settings
 from django.utils import six
 from django.utils import six
 from django.utils import translation
 from django.utils import translation
 from django.utils.html import conditional_escape
 from django.utils.html import conditional_escape
-from django.utils.unittest import TestCase
 
 
 from . import models
 from . import models
 from .widgetadmin import site as widget_admin_site
 from .widgetadmin import site as widget_admin_site

+ 0 - 1
tests/aggregation_regress/tests.py

@@ -10,7 +10,6 @@ from django.contrib.contenttypes.models import ContentType
 from django.db.models import Count, Max, Avg, Sum, StdDev, Variance, F, Q
 from django.db.models import Count, Max, Avg, Sum, StdDev, Variance, F, Q
 from django.test import TestCase, Approximate, skipUnlessDBFeature
 from django.test import TestCase, Approximate, skipUnlessDBFeature
 from django.utils import six
 from django.utils import six
-from django.utils.unittest import expectedFailure
 
 
 from .models import (Author, Book, Publisher, Clues, Entries, HardbackBook,
 from .models import (Author, Book, Publisher, Clues, Entries, HardbackBook,
         ItemTag, WithManualPK)
         ItemTag, WithManualPK)

+ 2 - 1
tests/app_loading/tests.py

@@ -4,11 +4,12 @@ import copy
 import os
 import os
 import sys
 import sys
 import time
 import time
+from unittest import TestCase
 
 
 from django.conf import Settings
 from django.conf import Settings
 from django.db.models.loading import cache, load_app, get_model, get_models
 from django.db.models.loading import cache, load_app, get_model, get_models
 from django.utils._os import upath
 from django.utils._os import upath
-from django.utils.unittest import TestCase
+
 
 
 class EggLoadingTest(TestCase):
 class EggLoadingTest(TestCase):
 
 

+ 1 - 1
tests/bash_completion/tests.py

@@ -3,10 +3,10 @@ A series of tests to establish that the command-line bash completion works.
 """
 """
 import os
 import os
 import sys
 import sys
+import unittest
 
 
 from django.conf import settings
 from django.conf import settings
 from django.core.management import ManagementUtility
 from django.core.management import ManagementUtility
-from django.utils import unittest
 from django.utils.six import StringIO
 from django.utils.six import StringIO
 
 
 
 

+ 1 - 1
tests/bug639/tests.py

@@ -8,9 +8,9 @@ from __future__ import absolute_import
 
 
 import os
 import os
 import shutil
 import shutil
+import unittest
 
 
 from django.core.files.uploadedfile import SimpleUploadedFile
 from django.core.files.uploadedfile import SimpleUploadedFile
-from django.utils import unittest
 from django.utils._os import upath
 from django.utils._os import upath
 
 
 from .models import Photo, PhotoForm, temp_storage_dir
 from .models import Photo, PhotoForm, temp_storage_dir

+ 2 - 1
tests/bug8245/tests.py

@@ -1,5 +1,6 @@
+from unittest import TestCase
+
 from django.contrib import admin
 from django.contrib import admin
-from django.utils.unittest import TestCase
 
 
 
 
 class Bug8245Test(TestCase):
 class Bug8245Test(TestCase):

+ 1 - 1
tests/builtin_server/tests.py

@@ -1,9 +1,9 @@
 from __future__ import unicode_literals
 from __future__ import unicode_literals
 
 
 from io import BytesIO
 from io import BytesIO
+from unittest import TestCase
 
 
 from django.core.servers.basehttp import ServerHandler, MAX_SOCKET_CHUNK_SIZE
 from django.core.servers.basehttp import ServerHandler, MAX_SOCKET_CHUNK_SIZE
-from django.utils.unittest import TestCase
 
 
 
 
 class DummyHandler(object):
 class DummyHandler(object):

+ 1 - 1
tests/db_typecasts/tests.py

@@ -1,10 +1,10 @@
 # Unit tests for typecast functions in django.db.backends.util
 # Unit tests for typecast functions in django.db.backends.util
 
 
 import datetime
 import datetime
+import unittest
 
 
 from django.db.backends import util as typecasts
 from django.db.backends import util as typecasts
 from django.utils import six
 from django.utils import six
-from django.utils import unittest
 
 
 
 
 TEST_CASES = {
 TEST_CASES = {

+ 1 - 1
tests/decorators/tests.py

@@ -1,4 +1,5 @@
 from functools import wraps
 from functools import wraps
+from unittest import TestCase
 
 
 from django.contrib.admin.views.decorators import staff_member_required
 from django.contrib.admin.views.decorators import staff_member_required
 from django.contrib.auth.decorators import login_required, permission_required, user_passes_test
 from django.contrib.auth.decorators import login_required, permission_required, user_passes_test
@@ -6,7 +7,6 @@ from django.http import HttpResponse, HttpRequest, HttpResponseNotAllowed
 from django.middleware.clickjacking import XFrameOptionsMiddleware
 from django.middleware.clickjacking import XFrameOptionsMiddleware
 from django.utils.decorators import method_decorator
 from django.utils.decorators import method_decorator
 from django.utils.functional import allow_lazy, lazy, memoize
 from django.utils.functional import allow_lazy, lazy, memoize
-from django.utils.unittest import TestCase
 from django.views.decorators.cache import cache_page, never_cache, cache_control
 from django.views.decorators.cache import cache_page, never_cache, cache_control
 from django.views.decorators.clickjacking import xframe_options_deny, xframe_options_sameorigin, xframe_options_exempt
 from django.views.decorators.clickjacking import xframe_options_deny, xframe_options_sameorigin, xframe_options_exempt
 from django.views.decorators.http import require_http_methods, require_GET, require_POST, require_safe, condition
 from django.views.decorators.http import require_http_methods, require_GET, require_POST, require_safe, condition

+ 2 - 1
tests/defaultfilters/tests.py

@@ -3,11 +3,12 @@ from __future__ import unicode_literals
 
 
 import datetime
 import datetime
 import decimal
 import decimal
+import unittest
 
 
 from django.template.defaultfilters import *
 from django.template.defaultfilters import *
 from django.test import TestCase
 from django.test import TestCase
 from django.utils import six
 from django.utils import six
-from django.utils import unittest, translation
+from django.utils import translation
 from django.utils.safestring import SafeData
 from django.utils.safestring import SafeData
 from django.utils.encoding import python_2_unicode_compatible
 from django.utils.encoding import python_2_unicode_compatible
 
 

+ 1 - 1
tests/dispatch/tests/test_dispatcher.py

@@ -1,9 +1,9 @@
 import gc
 import gc
 import sys
 import sys
 import time
 import time
+import unittest
 
 
 from django.dispatch import Signal, receiver
 from django.dispatch import Signal, receiver
-from django.utils import unittest
 
 
 
 
 if sys.platform.startswith('java'):
 if sys.platform.startswith('java'):

+ 2 - 1
tests/dispatch/tests/test_saferef.py

@@ -1,6 +1,7 @@
+import unittest
+
 from django.dispatch.saferef import safeRef
 from django.dispatch.saferef import safeRef
 from django.utils.six.moves import xrange
 from django.utils.six.moves import xrange
-from django.utils import unittest
 
 
 class Test1(object):
 class Test1(object):
     def x(self):
     def x(self):

+ 1 - 1
tests/file_storage/tests.py

@@ -7,6 +7,7 @@ import shutil
 import sys
 import sys
 import tempfile
 import tempfile
 import time
 import time
+import unittest
 try:
 try:
     from urllib.request import urlopen
     from urllib.request import urlopen
 except ImportError:     # Python 2
 except ImportError:     # Python 2
@@ -28,7 +29,6 @@ from django.core.files.storage import FileSystemStorage, get_storage_class
 from django.core.files.uploadedfile import UploadedFile
 from django.core.files.uploadedfile import UploadedFile
 from django.test import LiveServerTestCase, SimpleTestCase
 from django.test import LiveServerTestCase, SimpleTestCase
 from django.utils import six
 from django.utils import six
-from django.utils import unittest
 from django.utils._os import upath
 from django.utils._os import upath
 from django.test.utils import override_settings
 from django.test.utils import override_settings
 
 

+ 1 - 1
tests/file_uploads/tests.py

@@ -8,6 +8,7 @@ import json
 import os
 import os
 import shutil
 import shutil
 import tempfile as sys_tempfile
 import tempfile as sys_tempfile
+import unittest
 
 
 from django.core.files import temp as tempfile
 from django.core.files import temp as tempfile
 from django.core.files.uploadedfile import SimpleUploadedFile
 from django.core.files.uploadedfile import SimpleUploadedFile
@@ -16,7 +17,6 @@ from django.test import TestCase, client
 from django.test.utils import override_settings
 from django.test.utils import override_settings
 from django.utils.encoding import force_bytes
 from django.utils.encoding import force_bytes
 from django.utils.six import StringIO
 from django.utils.six import StringIO
-from django.utils import unittest
 
 
 from . import uploadhandler
 from . import uploadhandler
 from .models import FileModel
 from .models import FileModel

+ 1 - 1
tests/files/tests.py

@@ -4,6 +4,7 @@ import os
 import gzip
 import gzip
 import shutil
 import shutil
 import tempfile
 import tempfile
+import unittest
 
 
 from django.core.cache import cache
 from django.core.cache import cache
 from django.core.files import File
 from django.core.files import File
@@ -11,7 +12,6 @@ from django.core.files.move import file_move_safe
 from django.core.files.base import ContentFile
 from django.core.files.base import ContentFile
 from django.core.files.uploadedfile import SimpleUploadedFile
 from django.core.files.uploadedfile import SimpleUploadedFile
 from django.test import TestCase
 from django.test import TestCase
-from django.utils import unittest
 from django.utils.six import StringIO
 from django.utils.six import StringIO
 
 
 from .models import Storage, temp_storage, temp_storage_location
 from .models import Storage, temp_storage, temp_storage_location

+ 2 - 1
tests/forms_tests/tests/test_validators.py

@@ -1,9 +1,10 @@
 from __future__ import unicode_literals
 from __future__ import unicode_literals
 
 
+from unittest import TestCase
+
 from django import forms
 from django import forms
 from django.core import validators
 from django.core import validators
 from django.core.exceptions import ValidationError
 from django.core.exceptions import ValidationError
-from django.utils.unittest import TestCase
 
 
 
 
 class UserForm(forms.Form):
 class UserForm(forms.Form):

+ 1 - 1
tests/generic_views/test_base.py

@@ -1,11 +1,11 @@
 from __future__ import absolute_import
 from __future__ import absolute_import
 
 
 import time
 import time
+import unittest
 
 
 from django.core.exceptions import ImproperlyConfigured
 from django.core.exceptions import ImproperlyConfigured
 from django.http import HttpResponse
 from django.http import HttpResponse
 from django.test import TestCase, RequestFactory
 from django.test import TestCase, RequestFactory
-from django.utils import unittest
 from django.views.generic import View, TemplateView, RedirectView
 from django.views.generic import View, TemplateView, RedirectView
 
 
 from . import views
 from . import views

+ 1 - 1
tests/generic_views/test_dates.py

@@ -2,12 +2,12 @@ from __future__ import absolute_import
 
 
 import time
 import time
 import datetime
 import datetime
+from unittest import skipUnless
 
 
 from django.core.exceptions import ImproperlyConfigured
 from django.core.exceptions import ImproperlyConfigured
 from django.test import TestCase, skipUnlessDBFeature
 from django.test import TestCase, skipUnlessDBFeature
 from django.test.utils import override_settings
 from django.test.utils import override_settings
 from django.utils import timezone
 from django.utils import timezone
-from django.utils.unittest import skipUnless
 
 
 from .models import Book, BookSigning
 from .models import Book, BookSigning
 
 

+ 1 - 1
tests/generic_views/test_edit.py

@@ -1,12 +1,12 @@
 from __future__ import absolute_import
 from __future__ import absolute_import
 
 
 import warnings
 import warnings
+from unittest import expectedFailure
 
 
 from django.core.exceptions import ImproperlyConfigured
 from django.core.exceptions import ImproperlyConfigured
 from django.core.urlresolvers import reverse
 from django.core.urlresolvers import reverse
 from django import forms
 from django import forms
 from django.test import TestCase
 from django.test import TestCase
-from django.utils.unittest import expectedFailure
 from django.test.client import RequestFactory
 from django.test.client import RequestFactory
 from django.views.generic.base import View
 from django.views.generic.base import View
 from django.views.generic.edit import FormMixin, CreateView
 from django.views.generic.edit import FormMixin, CreateView

+ 1 - 1
tests/httpwrappers/tests.py

@@ -4,6 +4,7 @@ from __future__ import unicode_literals
 import copy
 import copy
 import os
 import os
 import pickle
 import pickle
+import unittest
 import warnings
 import warnings
 
 
 from django.core.exceptions import SuspiciousOperation
 from django.core.exceptions import SuspiciousOperation
@@ -18,7 +19,6 @@ from django.test import TestCase
 from django.utils.encoding import smart_str
 from django.utils.encoding import smart_str
 from django.utils._os import upath
 from django.utils._os import upath
 from django.utils import six
 from django.utils import six
-from django.utils import unittest
 
 
 
 
 class QueryDictTests(unittest.TestCase):
 class QueryDictTests(unittest.TestCase):

+ 2 - 1
tests/indexes/tests.py

@@ -1,7 +1,8 @@
+from unittest import skipUnless
+
 from django.core.management.color import no_style
 from django.core.management.color import no_style
 from django.db import connections, DEFAULT_DB_ALIAS
 from django.db import connections, DEFAULT_DB_ALIAS
 from django.test import TestCase
 from django.test import TestCase
-from django.utils.unittest import skipUnless
 
 
 from .models import Article
 from .models import Article
 
 

+ 1 - 1
tests/inspectdb/tests.py

@@ -2,11 +2,11 @@
 from __future__ import unicode_literals
 from __future__ import unicode_literals
 
 
 import re
 import re
+from unittest import expectedFailure
 
 
 from django.core.management import call_command
 from django.core.management import call_command
 from django.db import connection
 from django.db import connection
 from django.test import TestCase, skipUnlessDBFeature
 from django.test import TestCase, skipUnlessDBFeature
-from django.utils.unittest import expectedFailure
 from django.utils.six import PY3, StringIO
 from django.utils.six import PY3, StringIO
 
 
 if connection.vendor == 'oracle':
 if connection.vendor == 'oracle':

+ 2 - 1
tests/introspection/tests.py

@@ -1,8 +1,9 @@
 from __future__ import absolute_import, unicode_literals
 from __future__ import absolute_import, unicode_literals
 
 
+import unittest
+
 from django.db import connection
 from django.db import connection
 from django.test import TestCase, skipUnlessDBFeature, skipIfDBFeature
 from django.test import TestCase, skipUnlessDBFeature, skipIfDBFeature
-from django.utils import unittest
 
 
 from .models import Reporter, Article
 from .models import Reporter, Article
 
 

+ 1 - 2
tests/invalid_models/tests.py

@@ -1,11 +1,10 @@
 import copy
 import copy
 import sys
 import sys
+import unittest
 
 
 from django.core.management.validation import get_validation_errors
 from django.core.management.validation import get_validation_errors
 from django.db.models.loading import cache, load_app
 from django.db.models.loading import cache, load_app
-
 from django.test.utils import override_settings
 from django.test.utils import override_settings
-from django.utils import unittest
 from django.utils.six import StringIO
 from django.utils.six import StringIO
 
 
 
 

+ 1 - 1
tests/logging_tests/tests.py

@@ -3,6 +3,7 @@ from __future__ import unicode_literals
 import copy
 import copy
 import logging
 import logging
 import sys
 import sys
+from unittest import skipUnless
 import warnings
 import warnings
 
 
 from django.conf import LazySettings
 from django.conf import LazySettings
@@ -13,7 +14,6 @@ from django.utils.encoding import force_text
 from django.utils.log import (CallbackFilter, RequireDebugFalse,
 from django.utils.log import (CallbackFilter, RequireDebugFalse,
     RequireDebugTrue)
     RequireDebugTrue)
 from django.utils.six import StringIO
 from django.utils.six import StringIO
-from django.utils.unittest import skipUnless
 
 
 from admin_scripts.tests import AdminScriptTestCase
 from admin_scripts.tests import AdminScriptTestCase
 
 

+ 2 - 2
tests/max_lengths/tests.py

@@ -1,6 +1,6 @@
 from __future__ import absolute_import
 from __future__ import absolute_import
 
 
-from django.utils import unittest
+import unittest
 
 
 from .models import PersonWithDefaultMaxLengths, PersonWithCustomMaxLengths
 from .models import PersonWithDefaultMaxLengths, PersonWithCustomMaxLengths
 
 
@@ -36,4 +36,4 @@ class MaxLengthORMTests(unittest.TestCase):
             new_args = args.copy()
             new_args = args.copy()
             new_args[field] = "X" * 250 # a value longer than any of the default fields could hold.
             new_args[field] = "X" * 250 # a value longer than any of the default fields could hold.
             p = PersonWithCustomMaxLengths.objects.create(**new_args)
             p = PersonWithCustomMaxLengths.objects.create(**new_args)
-            self.assertEqual(getattr(p, field), ("X" * 250))
+            self.assertEqual(getattr(p, field), ("X" * 250))

+ 1 - 1
tests/middleware/tests.py

@@ -5,6 +5,7 @@ import gzip
 from io import BytesIO
 from io import BytesIO
 import random
 import random
 import re
 import re
+from unittest import expectedFailure, skipIf
 import warnings
 import warnings
 
 
 from django.conf import settings
 from django.conf import settings
@@ -22,7 +23,6 @@ from django.test.utils import override_settings, IgnoreDeprecationWarningsMixin
 from django.utils import six
 from django.utils import six
 from django.utils.encoding import force_str
 from django.utils.encoding import force_str
 from django.utils.six.moves import xrange
 from django.utils.six.moves import xrange
-from django.utils.unittest import expectedFailure, skipIf
 
 
 from .models import Band
 from .models import Band
 
 

+ 1 - 1
tests/model_fields/test_imagefield.py

@@ -2,13 +2,13 @@ from __future__ import absolute_import
 
 
 import os
 import os
 import shutil
 import shutil
+from unittest import skipIf
 
 
 from django.core.exceptions import ImproperlyConfigured
 from django.core.exceptions import ImproperlyConfigured
 from django.core.files import File
 from django.core.files import File
 from django.core.files.images import ImageFile
 from django.core.files.images import ImageFile
 from django.test import TestCase
 from django.test import TestCase
 from django.utils._os import upath
 from django.utils._os import upath
-from django.utils.unittest import skipIf
 
 
 try:
 try:
     from .models import Image
     from .models import Image

+ 1 - 1
tests/model_fields/tests.py

@@ -2,6 +2,7 @@ from __future__ import absolute_import, unicode_literals
 
 
 import datetime
 import datetime
 from decimal import Decimal
 from decimal import Decimal
+import unittest
 
 
 from django import test
 from django import test
 from django import forms
 from django import forms
@@ -9,7 +10,6 @@ from django.core.exceptions import ValidationError
 from django.db import connection, models, IntegrityError
 from django.db import connection, models, IntegrityError
 from django.db.models.fields.files import FieldFile
 from django.db.models.fields.files import FieldFile
 from django.utils import six
 from django.utils import six
-from django.utils import unittest
 
 
 from .models import (Foo, Bar, Whiz, BigD, BigS, Image, BigInt, Post,
 from .models import (Foo, Bar, Whiz, BigD, BigS, Image, BigInt, Post,
     NullBooleanModel, BooleanModel, DataModel, Document, RenamedField,
     NullBooleanModel, BooleanModel, DataModel, Document, RenamedField,

+ 1 - 1
tests/model_forms/tests.py

@@ -3,6 +3,7 @@ from __future__ import absolute_import, unicode_literals
 import datetime
 import datetime
 import os
 import os
 from decimal import Decimal
 from decimal import Decimal
+from unittest import skipUnless
 import warnings
 import warnings
 
 
 from django import forms
 from django import forms
@@ -13,7 +14,6 @@ from django.db import connection
 from django.db.models.query import EmptyQuerySet
 from django.db.models.query import EmptyQuerySet
 from django.forms.models import model_to_dict
 from django.forms.models import model_to_dict
 from django.utils._os import upath
 from django.utils._os import upath
-from django.utils.unittest import skipUnless
 from django.test import TestCase
 from django.test import TestCase
 from django.utils import six
 from django.utils import six
 
 

+ 1 - 1
tests/model_forms_regress/tests.py

@@ -1,6 +1,7 @@
 from __future__ import absolute_import, unicode_literals
 from __future__ import absolute_import, unicode_literals
 
 
 from datetime import date
 from datetime import date
+import unittest
 import warnings
 import warnings
 
 
 from django import forms
 from django import forms
@@ -9,7 +10,6 @@ from django.core.files.uploadedfile import SimpleUploadedFile
 from django.forms.models import (modelform_factory, ModelChoiceField,
 from django.forms.models import (modelform_factory, ModelChoiceField,
     fields_for_model, construct_instance, ModelFormMetaclass)
     fields_for_model, construct_instance, ModelFormMetaclass)
 from django.utils import six
 from django.utils import six
-from django.utils import unittest
 from django.test import TestCase
 from django.test import TestCase
 
 
 from .models import (Person, RealPerson, Triple, FilePathModel, Article,
 from .models import (Person, RealPerson, Triple, FilePathModel, Article,

+ 2 - 2
tests/model_inheritance_regress/tests.py

@@ -5,10 +5,10 @@ from __future__ import absolute_import, unicode_literals
 
 
 import datetime
 import datetime
 from operator import attrgetter
 from operator import attrgetter
-from django import forms
+from unittest import expectedFailure
 
 
+from django import forms
 from django.test import TestCase
 from django.test import TestCase
-from django.utils.unittest import expectedFailure
 
 
 from .models import (Place, Restaurant, ItalianRestaurant, ParkingLot,
 from .models import (Place, Restaurant, ItalianRestaurant, ParkingLot,
     ParkingLot2, ParkingLot3, Supplier, Wholesaler, Child, SelfRefParent,
     ParkingLot2, ParkingLot3, Supplier, Wholesaler, Child, SelfRefParent,

+ 1 - 1
tests/model_regress/tests.py

@@ -3,12 +3,12 @@ from __future__ import absolute_import, unicode_literals
 import datetime
 import datetime
 from operator import attrgetter
 from operator import attrgetter
 import sys
 import sys
+import unittest
 
 
 from django.core.exceptions import ValidationError
 from django.core.exceptions import ValidationError
 from django.test import TestCase, skipUnlessDBFeature
 from django.test import TestCase, skipUnlessDBFeature
 from django.utils import six
 from django.utils import six
 from django.utils import tzinfo
 from django.utils import tzinfo
-from django.utils import unittest
 from django.db import connection, router
 from django.db import connection, router
 from django.db.models.sql import InsertQuery
 from django.db.models.sql import InsertQuery
 
 

+ 2 - 1
tests/modeladmin/tests.py

@@ -1,6 +1,7 @@
 from __future__ import absolute_import, unicode_literals
 from __future__ import absolute_import, unicode_literals
 
 
 from datetime import date
 from datetime import date
+import unittest
 
 
 from django import forms
 from django import forms
 from django.conf import settings
 from django.conf import settings
@@ -15,7 +16,7 @@ from django.forms.models import BaseModelFormSet
 from django.forms.widgets import Select
 from django.forms.widgets import Select
 from django.test import TestCase
 from django.test import TestCase
 from django.test.utils import str_prefix
 from django.test.utils import str_prefix
-from django.utils import unittest, six
+from django.utils import six
 
 
 from .models import Band, Concert, ValidationTestModel, ValidationTestInlineModel
 from .models import Band, Concert, ValidationTestModel, ValidationTestInlineModel
 
 

+ 1 - 1
tests/pagination/tests.py

@@ -1,12 +1,12 @@
 from __future__ import absolute_import, unicode_literals
 from __future__ import absolute_import, unicode_literals
 
 
 from datetime import datetime
 from datetime import datetime
+import unittest
 
 
 from django.core.paginator import (Paginator, EmptyPage, InvalidPage,
 from django.core.paginator import (Paginator, EmptyPage, InvalidPage,
     PageNotAnInteger)
     PageNotAnInteger)
 from django.test import TestCase
 from django.test import TestCase
 from django.utils import six
 from django.utils import six
-from django.utils import unittest
 
 
 from .models import Article
 from .models import Article
 from .custom import ValidAdjacentNumsPaginator
 from .custom import ValidAdjacentNumsPaginator

+ 1 - 1
tests/queries/tests.py

@@ -4,6 +4,7 @@ import datetime
 from operator import attrgetter
 from operator import attrgetter
 import pickle
 import pickle
 import sys
 import sys
+import unittest
 
 
 from django.conf import settings
 from django.conf import settings
 from django.core.exceptions import FieldError
 from django.core.exceptions import FieldError
@@ -13,7 +14,6 @@ from django.db.models.sql.where import WhereNode, EverythingNode, NothingNode
 from django.db.models.sql.datastructures import EmptyResultSet
 from django.db.models.sql.datastructures import EmptyResultSet
 from django.test import TestCase, skipUnlessDBFeature
 from django.test import TestCase, skipUnlessDBFeature
 from django.test.utils import str_prefix
 from django.test.utils import str_prefix
-from django.utils import unittest
 from django.utils.datastructures import SortedDict
 from django.utils.datastructures import SortedDict
 
 
 from .models import (
 from .models import (

+ 3 - 3
tests/requests/tests.py

@@ -1,10 +1,11 @@
 # -*- encoding: utf-8 -*-
 # -*- encoding: utf-8 -*-
 from __future__ import unicode_literals
 from __future__ import unicode_literals
 
 
-import time
-import warnings
 from datetime import datetime, timedelta
 from datetime import datetime, timedelta
 from io import BytesIO
 from io import BytesIO
+import time
+from unittest import skipIf
+import warnings
 
 
 from django.db import connection, connections, DEFAULT_DB_ALIAS
 from django.db import connection, connections, DEFAULT_DB_ALIAS
 from django.core import signals
 from django.core import signals
@@ -15,7 +16,6 @@ from django.test import SimpleTestCase, TransactionTestCase
 from django.test.client import FakePayload
 from django.test.client import FakePayload
 from django.test.utils import override_settings, str_prefix
 from django.test.utils import override_settings, str_prefix
 from django.utils import six
 from django.utils import six
-from django.utils.unittest import skipIf
 from django.utils.http import cookie_date, urlencode
 from django.utils.http import cookie_date, urlencode
 from django.utils.timezone import utc
 from django.utils.timezone import utc
 
 

+ 2 - 1
tests/resolve_url/tests.py

@@ -1,8 +1,9 @@
 from __future__ import unicode_literals
 from __future__ import unicode_literals
 
 
+from unittest import TestCase
+
 from django.core.urlresolvers import NoReverseMatch
 from django.core.urlresolvers import NoReverseMatch
 from django.contrib.auth.views import logout
 from django.contrib.auth.views import logout
-from django.utils.unittest import TestCase
 from django.shortcuts import resolve_url
 from django.shortcuts import resolve_url
 
 
 from .models import UnimportantThing
 from .models import UnimportantThing

+ 1 - 1
tests/select_for_update/tests.py

@@ -2,13 +2,13 @@ from __future__ import absolute_import
 
 
 import sys
 import sys
 import time
 import time
+import unittest
 
 
 from django.conf import settings
 from django.conf import settings
 from django.db import transaction, connection
 from django.db import transaction, connection
 from django.db.utils import ConnectionHandler, DEFAULT_DB_ALIAS, DatabaseError
 from django.db.utils import ConnectionHandler, DEFAULT_DB_ALIAS, DatabaseError
 from django.test import (TransactionTestCase, skipIfDBFeature,
 from django.test import (TransactionTestCase, skipIfDBFeature,
     skipUnlessDBFeature)
     skipUnlessDBFeature)
-from django.utils import unittest
 
 
 from .models import Person
 from .models import Person
 
 

+ 2 - 1
tests/select_related_onetoone/tests.py

@@ -1,7 +1,8 @@
 from __future__ import absolute_import
 from __future__ import absolute_import
 
 
+import unittest
+
 from django.test import TestCase
 from django.test import TestCase
-from django.utils import unittest
 
 
 from .models import (User, UserProfile, UserStat, UserStatResult, StatDetails,
 from .models import (User, UserProfile, UserStat, UserStatResult, StatDetails,
     AdvancedUserStat, Image, Product, Parent1, Parent2, Child1, Child2, Child3,
     AdvancedUserStat, Image, Product, Parent1, Parent2, Child1, Child2, Child3,

+ 1 - 1
tests/serializers/tests.py

@@ -3,6 +3,7 @@ from __future__ import absolute_import, unicode_literals
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 import json
 import json
 from datetime import datetime
 from datetime import datetime
+import unittest
 from xml.dom import minidom
 from xml.dom import minidom
 
 
 from django.conf import settings
 from django.conf import settings
@@ -11,7 +12,6 @@ from django.db import transaction, connection
 from django.test import TestCase, TransactionTestCase, Approximate
 from django.test import TestCase, TransactionTestCase, Approximate
 from django.utils import six
 from django.utils import six
 from django.utils.six import StringIO
 from django.utils.six import StringIO
-from django.utils import unittest
 
 
 from .models import (Category, Author, Article, AuthorProfile, Actor, Movie,
 from .models import (Category, Author, Article, AuthorProfile, Actor, Movie,
     Score, Player, Team)
     Score, Player, Team)

+ 2 - 2
tests/serializers_regress/tests.py

@@ -10,7 +10,7 @@ from __future__ import absolute_import, unicode_literals
 
 
 import datetime
 import datetime
 import decimal
 import decimal
-from django.core.serializers.xml_serializer import DTDForbidden
+from unittest import expectedFailure, skipUnless
 
 
 try:
 try:
     import yaml
     import yaml
@@ -20,13 +20,13 @@ except ImportError:
 from django.core import serializers
 from django.core import serializers
 from django.core.serializers import SerializerDoesNotExist
 from django.core.serializers import SerializerDoesNotExist
 from django.core.serializers.base import DeserializationError
 from django.core.serializers.base import DeserializationError
+from django.core.serializers.xml_serializer import DTDForbidden
 from django.db import connection, models
 from django.db import connection, models
 from django.http import HttpResponse
 from django.http import HttpResponse
 from django.test import TestCase
 from django.test import TestCase
 from django.utils import six
 from django.utils import six
 from django.utils.encoding import force_text
 from django.utils.encoding import force_text
 from django.utils.functional import curry
 from django.utils.functional import curry
-from django.utils.unittest import expectedFailure, skipUnless
 
 
 from .models import (BinaryData, BooleanData, CharData, DateData, DateTimeData, EmailData,
 from .models import (BinaryData, BooleanData, CharData, DateData, DateTimeData, EmailData,
     FileData, FilePathData, DecimalData, FloatData, IntegerData, IPAddressData,
     FileData, FilePathData, DecimalData, FloatData, IntegerData, IPAddressData,

+ 2 - 1
tests/settings_tests/tests.py

@@ -1,4 +1,5 @@
 import os
 import os
+import unittest
 import warnings
 import warnings
 
 
 from django.conf import settings, global_settings
 from django.conf import settings, global_settings
@@ -6,7 +7,7 @@ from django.core.exceptions import ImproperlyConfigured
 from django.http import HttpRequest
 from django.http import HttpRequest
 from django.test import SimpleTestCase, TransactionTestCase, TestCase, signals
 from django.test import SimpleTestCase, TransactionTestCase, TestCase, signals
 from django.test.utils import override_settings
 from django.test.utils import override_settings
-from django.utils import unittest, six
+from django.utils import six
 
 
 
 
 @override_settings(TEST='override', TEST_OUTER='outer')
 @override_settings(TEST='override', TEST_OUTER='outer')

+ 1 - 1
tests/str/tests.py

@@ -2,10 +2,10 @@
 from __future__ import absolute_import, unicode_literals
 from __future__ import absolute_import, unicode_literals
 
 
 import datetime
 import datetime
+from unittest import skipIf
 
 
 from django.test import TestCase
 from django.test import TestCase
 from django.utils import six
 from django.utils import six
-from django.utils.unittest import skipIf
 
 
 from .models import Article, BrokenArticle, InternationalArticle
 from .models import Article, BrokenArticle, InternationalArticle
 
 

+ 4 - 3
tests/template_tests/loaders.py

@@ -9,15 +9,16 @@ from django.conf import settings
 if __name__ == '__main__':
 if __name__ == '__main__':
     settings.configure()
     settings.configure()
 
 
-import sys
-import pkg_resources
 import imp
 import imp
 import os.path
 import os.path
+import pkg_resources
+import sys
+import unittest
 
 
 from django.template import TemplateDoesNotExist, Context
 from django.template import TemplateDoesNotExist, Context
 from django.template.loaders.eggs import Loader as EggLoader
 from django.template.loaders.eggs import Loader as EggLoader
 from django.template import loader
 from django.template import loader
-from django.utils import unittest, six
+from django.utils import six
 from django.utils._os import upath
 from django.utils._os import upath
 from django.utils.six import StringIO
 from django.utils.six import StringIO
 
 

+ 2 - 1
tests/template_tests/test_callables.py

@@ -1,7 +1,8 @@
 from __future__ import unicode_literals
 from __future__ import unicode_literals
 
 
+from unittest import TestCase
+
 from django import template
 from django import template
-from django.utils.unittest import TestCase
 
 
 class CallableVariablesTests(TestCase):
 class CallableVariablesTests(TestCase):
 
 

+ 3 - 1
tests/template_tests/test_context.py

@@ -1,6 +1,8 @@
 # coding: utf-8
 # coding: utf-8
+
+from unittest import TestCase
+
 from django.template import Context
 from django.template import Context
-from django.utils.unittest import TestCase
 
 
 
 
 class ContextTests(TestCase):
 class ContextTests(TestCase):

+ 2 - 1
tests/template_tests/test_custom.py

@@ -1,8 +1,9 @@
 from __future__ import absolute_import, unicode_literals
 from __future__ import absolute_import, unicode_literals
 
 
+from unittest import TestCase
+
 from django import template
 from django import template
 from django.utils import six
 from django.utils import six
-from django.utils.unittest import TestCase
 
 
 from .templatetags import custom
 from .templatetags import custom
 
 

+ 2 - 1
tests/template_tests/test_nodelist.py

@@ -1,6 +1,7 @@
+from unittest import TestCase
+
 from django.template import VariableNode, Context
 from django.template import VariableNode, Context
 from django.template.loader import get_template_from_string
 from django.template.loader import get_template_from_string
-from django.utils.unittest import TestCase
 from django.test.utils import override_settings
 from django.test.utils import override_settings
 
 
 class NodelistTest(TestCase):
 class NodelistTest(TestCase):

+ 2 - 1
tests/template_tests/test_parser.py

@@ -3,10 +3,11 @@ Testing some internals of the template processing. These are *not* examples to b
 """
 """
 from __future__ import unicode_literals
 from __future__ import unicode_literals
 
 
+from unittest import TestCase
+
 from django.template import (TokenParser, FilterExpression, Parser, Variable,
 from django.template import (TokenParser, FilterExpression, Parser, Variable,
     Template, TemplateSyntaxError)
     Template, TemplateSyntaxError)
 from django.test.utils import override_settings
 from django.test.utils import override_settings
-from django.utils.unittest import TestCase
 from django.utils import six
 from django.utils import six
 
 
 
 

+ 2 - 1
tests/template_tests/test_smartif.py

@@ -1,5 +1,6 @@
+import unittest
+
 from django.template.smartif import IfParser
 from django.template.smartif import IfParser
-from django.utils import unittest
 
 
 class SmartIfTests(unittest.TestCase):
 class SmartIfTests(unittest.TestCase):
 
 

+ 2 - 1
tests/template_tests/test_unicode.py

@@ -1,10 +1,11 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 from __future__ import unicode_literals
 from __future__ import unicode_literals
 
 
+from unittest import TestCase
+
 from django.template import Template, TemplateEncodingError, Context
 from django.template import Template, TemplateEncodingError, Context
 from django.utils.safestring import SafeData
 from django.utils.safestring import SafeData
 from django.utils import six
 from django.utils import six
-from django.utils.unittest import TestCase
 
 
 
 
 class UnicodeTests(TestCase):
 class UnicodeTests(TestCase):

+ 1 - 1
tests/template_tests/tests.py

@@ -13,6 +13,7 @@ import time
 import os
 import os
 import sys
 import sys
 import traceback
 import traceback
+import unittest
 try:
 try:
     from urllib.parse import urljoin
     from urllib.parse import urljoin
 except ImportError:     # Python 2
 except ImportError:     # Python 2
@@ -27,7 +28,6 @@ from django.template.loaders import app_directories, filesystem, cached
 from django.test import RequestFactory, TestCase
 from django.test import RequestFactory, TestCase
 from django.test.utils import (setup_test_template_loader,
 from django.test.utils import (setup_test_template_loader,
     restore_template_loaders, override_settings)
     restore_template_loaders, override_settings)
-from django.utils import unittest
 from django.utils.encoding import python_2_unicode_compatible
 from django.utils.encoding import python_2_unicode_compatible
 from django.utils.formats import date_format
 from django.utils.formats import date_format
 from django.utils._os import upath
 from django.utils._os import upath

+ 1 - 1
tests/test_runner/test_discover_runner.py

@@ -1,10 +1,10 @@
 from contextlib import contextmanager
 from contextlib import contextmanager
 import os
 import os
 import sys
 import sys
+from unittest import expectedFailure
 
 
 from django.test import TestCase
 from django.test import TestCase
 from django.test.runner import DiscoverRunner
 from django.test.runner import DiscoverRunner
-from django.utils.unittest import expectedFailure
 
 
 try:
 try:
     import unittest2
     import unittest2

+ 2 - 2
tests/test_runner/tests.py

@@ -3,8 +3,9 @@ Tests for django test runner
 """
 """
 from __future__ import absolute_import, unicode_literals
 from __future__ import absolute_import, unicode_literals
 
 
-import sys
 from optparse import make_option
 from optparse import make_option
+import sys
+import unittest
 
 
 from django.core.exceptions import ImproperlyConfigured
 from django.core.exceptions import ImproperlyConfigured
 from django.core.management import call_command
 from django.core.management import call_command
@@ -12,7 +13,6 @@ from django import db
 from django.test import runner, TestCase, TransactionTestCase, skipUnlessDBFeature
 from django.test import runner, TestCase, TransactionTestCase, skipUnlessDBFeature
 from django.test.testcases import connections_support_transactions
 from django.test.testcases import connections_support_transactions
 from django.test.utils import IgnoreDeprecationWarningsMixin
 from django.test.utils import IgnoreDeprecationWarningsMixin
-from django.utils import unittest
 from django.utils.importlib import import_module
 from django.utils.importlib import import_module
 
 
 from admin_scripts.tests import AdminScriptTestCase
 from admin_scripts.tests import AdminScriptTestCase

+ 2 - 1
tests/test_suite_override/tests.py

@@ -1,6 +1,7 @@
+import unittest
+
 from django.db.models import get_app
 from django.db.models import get_app
 from django.test.utils import IgnoreDeprecationWarningsMixin
 from django.test.utils import IgnoreDeprecationWarningsMixin
-from django.utils import unittest
 
 
 
 
 def suite():
 def suite():

+ 3 - 2
tests/test_utils/tests.py

@@ -1,6 +1,9 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
 from __future__ import absolute_import, unicode_literals
 from __future__ import absolute_import, unicode_literals
 
 
+import unittest
+from unittest import skip
+
 from django.db import connection
 from django.db import connection
 from django.forms import EmailField, IntegerField
 from django.forms import EmailField, IntegerField
 from django.http import HttpResponse
 from django.http import HttpResponse
@@ -9,8 +12,6 @@ from django.test import SimpleTestCase, TestCase, skipUnlessDBFeature
 from django.test.html import HTMLParseError, parse_html
 from django.test.html import HTMLParseError, parse_html
 from django.test.utils import CaptureQueriesContext, IgnoreDeprecationWarningsMixin
 from django.test.utils import CaptureQueriesContext, IgnoreDeprecationWarningsMixin
 from django.utils import six
 from django.utils import six
-from django.utils import unittest
-from django.utils.unittest import skip
 
 
 from .models import Person
 from .models import Person
 
 

+ 1 - 1
tests/timezones/tests.py

@@ -5,6 +5,7 @@ import os
 import re
 import re
 import sys
 import sys
 import time
 import time
+from unittest import skipIf, skipUnless
 import warnings
 import warnings
 from xml.dom.minidom import parseString
 from xml.dom.minidom import parseString
 
 
@@ -25,7 +26,6 @@ from django.test.utils import override_settings
 from django.utils import six
 from django.utils import six
 from django.utils import timezone
 from django.utils import timezone
 from django.utils.tzinfo import FixedOffset
 from django.utils.tzinfo import FixedOffset
-from django.utils.unittest import skipIf, skipUnless
 
 
 from .forms import EventForm, EventSplitForm, EventModelForm
 from .forms import EventForm, EventSplitForm, EventModelForm
 from .models import Event, MaybeEvent, Session, SessionEvent, Timestamp, AllDayEvent
 from .models import Event, MaybeEvent, Session, SessionEvent, Timestamp, AllDayEvent

+ 1 - 1
tests/transactions/tests.py

@@ -1,12 +1,12 @@
 from __future__ import absolute_import
 from __future__ import absolute_import
 
 
 import sys
 import sys
+from unittest import skipIf, skipUnless
 
 
 from django.db import connection, transaction, DatabaseError, IntegrityError
 from django.db import connection, transaction, DatabaseError, IntegrityError
 from django.test import TransactionTestCase, skipUnlessDBFeature
 from django.test import TransactionTestCase, skipUnlessDBFeature
 from django.test.utils import IgnoreDeprecationWarningsMixin
 from django.test.utils import IgnoreDeprecationWarningsMixin
 from django.utils import six
 from django.utils import six
-from django.utils.unittest import skipIf, skipUnless
 
 
 from .models import Reporter
 from .models import Reporter
 
 

Some files were not shown because too many files changed in this diff