Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

Refs #20680.
  • Loading branch information...
commit cfcf4b3605f9653e4e056088d89932b2a0e4281b 1 parent 7f264e0
Aymeric Augustin authored July 01, 2013

Showing 123 changed files with 212 additions and 161 deletions. Show diff stats Hide diff stats

  1. 2  django/contrib/admin/tests.py
  2. 3  django/contrib/admindocs/tests/test_fields.py
  3. 5  django/contrib/auth/tests/test_hashers.py
  4. 4  django/contrib/auth/tests/test_tokens.py
  5. 3  django/contrib/auth/tests/utils.py
  6. 2  django/contrib/formtools/tests/tests.py
  7. 5  django/contrib/gis/gdal/tests/test_driver.py
  8. 4  django/contrib/gis/gdal/tests/test_ds.py
  9. 7  django/contrib/gis/gdal/tests/test_envelope.py
  10. 4  django/contrib/gis/gdal/tests/test_geom.py
  11. 5  django/contrib/gis/gdal/tests/test_srs.py
  12. 5  django/contrib/gis/geoip/tests.py
  13. 4  django/contrib/gis/geos/tests/test_geos.py
  14. 4  django/contrib/gis/geos/tests/test_geos_mutation.py
  15. 2  django/contrib/gis/geos/tests/test_io.py
  16. 4  django/contrib/gis/geos/tests/test_mutable_list.py
  17. 3  django/contrib/gis/tests/distapp/tests.py
  18. 2  django/contrib/gis/tests/geo3d/tests.py
  19. 3  django/contrib/gis/tests/geoadmin/tests.py
  20. 2  django/contrib/gis/tests/geoapp/test_feeds.py
  21. 2  django/contrib/gis/tests/geoapp/test_regress.py
  22. 2  django/contrib/gis/tests/geoapp/test_sitemaps.py
  23. 2  django/contrib/gis/tests/geoapp/tests.py
  24. 2  django/contrib/gis/tests/geogapp/tests.py
  25. 2  django/contrib/gis/tests/inspectapp/tests.py
  26. 6  django/contrib/gis/tests/layermap/tests.py
  27. 3  django/contrib/gis/tests/relatedapp/tests.py
  28. 7  django/contrib/gis/tests/test_geoforms.py
  29. 3  django/contrib/gis/tests/test_measure.py
  30. 3  django/contrib/gis/tests/test_spatialrefsys.py
  31. 2  django/contrib/humanize/tests.py
  32. 3  django/contrib/messages/tests/base.py
  33. 3  django/contrib/messages/tests/test_middleware.py
  34. 2  django/contrib/sessions/tests.py
  35. 3  django/contrib/sitemaps/tests/test_flatpages.py
  36. 2  django/contrib/sitemaps/tests/test_http.py
  37. 4  django/test/runner.py
  38. 17  django/test/testcases.py
  39. 2  docs/topics/testing/advanced.txt
  40. 4  docs/topics/testing/overview.txt
  41. 4  tests/admin_scripts/tests.py
  42. 2  tests/admin_widgets/tests.py
  43. 1  tests/aggregation_regress/tests.py
  44. 3  tests/app_loading/tests.py
  45. 2  tests/bash_completion/tests.py
  46. 2  tests/bug639/tests.py
  47. 3  tests/bug8245/tests.py
  48. 2  tests/builtin_server/tests.py
  49. 2  tests/db_typecasts/tests.py
  50. 2  tests/decorators/tests.py
  51. 3  tests/defaultfilters/tests.py
  52. 2  tests/dispatch/tests/test_dispatcher.py
  53. 3  tests/dispatch/tests/test_saferef.py
  54. 2  tests/file_storage/tests.py
  55. 2  tests/file_uploads/tests.py
  56. 2  tests/files/tests.py
  57. 3  tests/forms_tests/tests/test_validators.py
  58. 2  tests/generic_views/test_base.py
  59. 2  tests/generic_views/test_dates.py
  60. 2  tests/generic_views/test_edit.py
  61. 2  tests/httpwrappers/tests.py
  62. 3  tests/indexes/tests.py
  63. 2  tests/inspectdb/tests.py
  64. 3  tests/introspection/tests.py
  65. 3  tests/invalid_models/tests.py
  66. 2  tests/logging_tests/tests.py
  67. 4  tests/max_lengths/tests.py
  68. 2  tests/middleware/tests.py
  69. 2  tests/model_fields/test_imagefield.py
  70. 2  tests/model_fields/tests.py
  71. 2  tests/model_forms/tests.py
  72. 2  tests/model_forms_regress/tests.py
  73. 4  tests/model_inheritance_regress/tests.py
  74. 2  tests/model_regress/tests.py
  75. 3  tests/modeladmin/tests.py
  76. 2  tests/pagination/tests.py
  77. 2  tests/queries/tests.py
  78. 6  tests/requests/tests.py
  79. 3  tests/resolve_url/tests.py
  80. 2  tests/select_for_update/tests.py
  81. 3  tests/select_related_onetoone/tests.py
  82. 2  tests/serializers/tests.py
  83. 4  tests/serializers_regress/tests.py
  84. 3  tests/settings_tests/tests.py
  85. 2  tests/str/tests.py
  86. 7  tests/template_tests/loaders.py
  87. 3  tests/template_tests/test_callables.py
  88. 4  tests/template_tests/test_context.py
  89. 3  tests/template_tests/test_custom.py
  90. 3  tests/template_tests/test_nodelist.py
  91. 3  tests/template_tests/test_parser.py
  92. 3  tests/template_tests/test_smartif.py
  93. 3  tests/template_tests/test_unicode.py
  94. 2  tests/template_tests/tests.py
  95. 2  tests/test_runner/test_discover_runner.py
  96. 4  tests/test_runner/tests.py
  97. 3  tests/test_suite_override/tests.py
  98. 5  tests/test_utils/tests.py
  99. 2  tests/timezones/tests.py
  100. 2  tests/transactions/tests.py
  101. 3  tests/transactions_regress/tests.py
  102. 4  tests/urlpatterns_reverse/tests.py
  103. 2  tests/utils_tests/test_archive.py
  104. 3  tests/utils_tests/test_baseconv.py
  105. 4  tests/utils_tests/test_crypto.py
  106. 2  tests/utils_tests/test_dateparse.py
  107. 3  tests/utils_tests/test_encoding.py
  108. 3  tests/utils_tests/test_functional.py
  109. 2  tests/utils_tests/test_html.py
  110. 2  tests/utils_tests/test_http.py
  111. 3  tests/utils_tests/test_ipv6.py
  112. 4  tests/utils_tests/test_module_loading.py
  113. 2  tests/utils_tests/test_os_utils.py
  114. 3  tests/utils_tests/test_regex_helper.py
  115. 2  tests/utils_tests/test_simplelazyobject.py
  116. 3  tests/utils_tests/test_termcolors.py
  117. 3  tests/utils_tests/test_timezone.py
  118. 3  tests/utils_tests/test_tzinfo.py
  119. 3  tests/validation/test_error_messages.py
  120. 2  tests/validation/test_unique.py
  121. 4  tests/validators/tests.py
  122. 2  tests/version/tests.py
  123. 2  tests/view_tests/tests/test_debug.py
2  django/contrib/admin/tests.py
... ...
@@ -1,8 +1,8 @@
1 1
 import os
  2
+from unittest import SkipTest
2 3
 
3 4
 from django.test import LiveServerTestCase
4 5
 from django.utils.module_loading import import_by_path
5  
-from django.utils.unittest import SkipTest
6 6
 from django.utils.translation import ugettext as _
7 7
 
8 8
 
3  django/contrib/admindocs/tests/test_fields.py
... ...
@@ -1,9 +1,10 @@
1 1
 from __future__ import absolute_import, unicode_literals
2 2
 
  3
+import unittest
  4
+
3 5
 from django.contrib.admindocs import views
4 6
 from django.db import models
5 7
 from django.db.models import fields
6  
-from django.utils import unittest
7 8
 from django.utils.translation import ugettext as _
8 9
 
9 10
 
5  django/contrib/auth/tests/test_hashers.py
... ...
@@ -1,13 +1,14 @@
1 1
 # -*- coding: utf-8 -*-
2 2
 from __future__ import unicode_literals
3 3
 
  4
+import unittest
  5
+from unittest import skipUnless
  6
+
4 7
 from django.conf.global_settings import PASSWORD_HASHERS as default_hashers
5 8
 from django.contrib.auth.hashers import (is_password_usable, BasePasswordHasher,
6 9
     check_password, make_password, PBKDF2PasswordHasher, load_hashers, PBKDF2SHA1PasswordHasher,
7 10
     get_hasher, identify_hasher, UNUSABLE_PASSWORD_PREFIX, UNUSABLE_PASSWORD_SUFFIX_LENGTH)
8 11
 from django.utils import six
9  
-from django.utils import unittest
10  
-from django.utils.unittest import skipUnless
11 12
 
12 13
 
13 14
 try:
4  django/contrib/auth/tests/test_tokens.py
... ...
@@ -1,12 +1,12 @@
1  
-import sys
2 1
 from datetime import date, timedelta
  2
+import sys
  3
+import unittest
3 4
 
4 5
 from django.conf import settings
5 6
 from django.contrib.auth.models import User
6 7
 from django.contrib.auth.tokens import PasswordResetTokenGenerator
7 8
 from django.contrib.auth.tests.utils import skipIfCustomUser
8 9
 from django.test import TestCase
9  
-from django.utils import unittest
10 10
 
11 11
 
12 12
 @skipIfCustomUser
3  django/contrib/auth/tests/utils.py
... ...
@@ -1,5 +1,6 @@
  1
+from unittest import skipIf
  2
+
1 3
 from django.conf import settings
2  
-from django.utils.unittest import skipIf
3 4
 
4 5
 
5 6
 def skipIfCustomUser(test_func):
2  django/contrib/formtools/tests/tests.py
@@ -3,6 +3,7 @@
3 3
 
4 4
 import datetime
5 5
 import os
  6
+import unittest
6 7
 import warnings
7 8
 
8 9
 from django import http
@@ -10,7 +11,6 @@
10 11
 from django.test import TestCase
11 12
 from django.test.utils import override_settings
12 13
 from django.utils._os import upath
13  
-from django.utils import unittest
14 14
 
15 15
 from django.contrib.formtools.tests.forms import *
16 16
 
5  django/contrib/gis/gdal/tests/test_driver.py
... ...
@@ -1,6 +1,7 @@
  1
+import unittest
  2
+from unittest import skipUnless
  3
+
1 4
 from django.contrib.gis.gdal import HAS_GDAL
2  
-from django.utils import unittest
3  
-from django.utils.unittest import skipUnless
4 5
 
5 6
 if HAS_GDAL:
6 7
     from django.contrib.gis.gdal import Driver, OGRException
4  django/contrib/gis/gdal/tests/test_ds.py
... ...
@@ -1,9 +1,9 @@
1 1
 import os
  2
+import unittest
  3
+from unittest import skipUnless
2 4
 
3 5
 from django.contrib.gis.gdal import HAS_GDAL
4 6
 from django.contrib.gis.geometry.test_data import get_ds_file, TestDS, TEST_DATA
5  
-from django.utils import unittest
6  
-from django.utils.unittest import skipUnless
7 7
 
8 8
 if HAS_GDAL:
9 9
     from django.contrib.gis.gdal import DataSource, Envelope, OGRGeometry, OGRException, OGRIndexError, GDAL_VERSION
7  django/contrib/gis/gdal/tests/test_envelope.py
... ...
@@ -1,6 +1,7 @@
  1
+import unittest
  2
+from unittest import skipUnless
  3
+
1 4
 from django.contrib.gis.gdal import HAS_GDAL
2  
-from django.utils import unittest
3  
-from django.utils.unittest import skipUnless
4 5
 
5 6
 if HAS_GDAL:
6 7
     from django.contrib.gis.gdal import Envelope, OGRException
@@ -17,7 +18,7 @@ class EnvelopeTest(unittest.TestCase):
17 18
 
18 19
     def setUp(self):
19 20
         self.e = Envelope(0, 0, 5, 5)
20  
-    
  21
+
21 22
     def test01_init(self):
22 23
         "Testing Envelope initilization."
23 24
         e1 = Envelope((0, 0, 5, 5))
4  django/contrib/gis/gdal/tests/test_geom.py
@@ -4,12 +4,12 @@
4 4
     from django.utils.six.moves import cPickle as pickle
5 5
 except ImportError:
6 6
     import pickle
  7
+import unittest
  8
+from unittest import skipUnless
7 9
 
8 10
 from django.contrib.gis.gdal import HAS_GDAL
9 11
 from django.contrib.gis.geometry.test_data import TestDataMixin
10 12
 from django.utils.six.moves import xrange
11  
-from django.utils import unittest
12  
-from django.utils.unittest import skipUnless
13 13
 
14 14
 if HAS_GDAL:
15 15
     from django.contrib.gis.gdal import (OGRGeometry, OGRGeomType,
5  django/contrib/gis/gdal/tests/test_srs.py
... ...
@@ -1,6 +1,7 @@
  1
+import unittest
  2
+from unittest import skipUnless
  3
+
1 4
 from django.contrib.gis.gdal import HAS_GDAL
2  
-from django.utils import unittest
3  
-from django.utils.unittest import skipUnless
4 5
 
5 6
 if HAS_GDAL:
6 7
     from django.contrib.gis.gdal import SpatialReference, CoordTransform, OGRException, SRSException
5  django/contrib/gis/geoip/tests.py
@@ -2,11 +2,12 @@
2 2
 from __future__ import unicode_literals
3 3
 
4 4
 import os
  5
+import unittest
  6
+from unittest import skipUnless
  7
+
5 8
 from django.conf import settings
6 9
 from django.contrib.gis.geos import HAS_GEOS
7 10
 from django.contrib.gis.geoip import HAS_GEOIP
8  
-from django.utils import unittest
9  
-from django.utils.unittest import skipUnless
10 11
 
11 12
 from django.utils import six
12 13
 
4  django/contrib/gis/geos/tests/test_geos.py
@@ -3,6 +3,8 @@
3 3
 import ctypes
4 4
 import json
5 5
 import random
  6
+import unittest
  7
+from unittest import skipUnless
6 8
 from binascii import a2b_hex, b2a_hex
7 9
 from io import BytesIO
8 10
 
@@ -14,8 +16,6 @@
14 16
 from django.utils.encoding import force_bytes
15 17
 from django.utils import six
16 18
 from django.utils.six.moves import xrange
17  
-from django.utils import unittest
18  
-from django.utils.unittest import skipUnless
19 19
 
20 20
 from .. import HAS_GEOS
21 21
 
4  django/contrib/gis/geos/tests/test_geos_mutation.py
@@ -2,8 +2,8 @@
2 2
 # Modified from original contribution by Aryeh Leib Taurog, which was
3 3
 # released under the New BSD license.
4 4
 
5  
-from django.utils import unittest
6  
-from django.utils.unittest import skipUnless
  5
+import unittest
  6
+from unittest import skipUnless
7 7
 
8 8
 from .. import HAS_GEOS
9 9
 
2  django/contrib/gis/geos/tests/test_io.py
@@ -2,9 +2,9 @@
2 2
 
3 3
 import binascii
4 4
 import unittest
  5
+from unittest import skipUnless
5 6
 
6 7
 from django.contrib.gis import memoryview
7  
-from django.utils.unittest import skipUnless
8 8
 
9 9
 from ..import HAS_GEOS
10 10
 
4  django/contrib/gis/geos/tests/test_mutable_list.py
@@ -3,9 +3,11 @@
3 3
 #
4 4
 # Modified from original contribution by Aryeh Leib Taurog, which was
5 5
 # released under the New BSD license.
  6
+
  7
+import unittest
  8
+
6 9
 from django.contrib.gis.geos.mutable_list import ListMixin
7 10
 from django.utils import six
8  
-from django.utils import unittest
9 11
 
10 12
 
11 13
 class UserListA(ListMixin):
3  django/contrib/gis/tests/distapp/tests.py
... ...
@@ -1,5 +1,7 @@
1 1
 from __future__ import absolute_import
2 2
 
  3
+from unittest import skipUnless
  4
+
3 5
 from django.db import connection
4 6
 from django.db.models import Q
5 7
 from django.contrib.gis.geos import HAS_GEOS
@@ -8,7 +10,6 @@
8 10
     HAS_SPATIAL_DB, mysql, oracle, postgis, spatialite, no_oracle, no_spatialite
9 11
 )
10 12
 from django.test import TestCase
11  
-from django.utils.unittest import skipUnless
12 13
 
13 14
 if HAS_GEOS and HAS_SPATIAL_DB:
14 15
     from django.contrib.gis.geos import GEOSGeometry, LineString
2  django/contrib/gis/tests/geo3d/tests.py
@@ -2,13 +2,13 @@
2 2
 
3 3
 import os
4 4
 import re
  5
+from unittest import skipUnless
5 6
 
6 7
 from django.contrib.gis.gdal import HAS_GDAL
7 8
 from django.contrib.gis.geos import HAS_GEOS
8 9
 from django.contrib.gis.tests.utils import postgis
9 10
 from django.test import TestCase
10 11
 from django.utils._os import upath
11  
-from django.utils.unittest import skipUnless
12 12
 
13 13
 if HAS_GEOS:
14 14
     from django.contrib.gis.db.models import Union, Extent3D
3  django/contrib/gis/tests/geoadmin/tests.py
... ...
@@ -1,9 +1,10 @@
1 1
 from __future__ import absolute_import
2 2
 
  3
+from unittest import skipUnless
  4
+
3 5
 from django.test import TestCase
4 6
 from django.contrib.gis.geos import HAS_GEOS
5 7
 from django.contrib.gis.tests.utils import HAS_SPATIAL_DB
6  
-from django.utils.unittest import skipUnless
7 8
 
8 9
 if HAS_GEOS and HAS_SPATIAL_DB:
9 10
     from django.contrib.gis import admin
2  django/contrib/gis/tests/geoapp/test_feeds.py
... ...
@@ -1,5 +1,6 @@
1 1
 from __future__ import absolute_import
2 2
 
  3
+from unittest import skipUnless
3 4
 from xml.dom import minidom
4 5
 
5 6
 from django.conf import settings
@@ -7,7 +8,6 @@
7 8
 from django.contrib.gis.geos import HAS_GEOS
8 9
 from django.contrib.gis.tests.utils import HAS_SPATIAL_DB
9 10
 from django.test import TestCase
10  
-from django.utils.unittest import skipUnless
11 11
 
12 12
 if HAS_GEOS:
13 13
     from .models import City
2  django/contrib/gis/tests/geoapp/test_regress.py
@@ -2,6 +2,7 @@
2 2
 from __future__ import absolute_import, unicode_literals
3 3
 
4 4
 from datetime import datetime
  5
+from unittest import skipUnless
5 6
 
6 7
 from django.contrib.gis.geos import HAS_GEOS
7 8
 from django.contrib.gis.tests.utils import no_mysql, no_spatialite
@@ -9,7 +10,6 @@
9 10
 from django.contrib.gis.tests.utils import HAS_SPATIAL_DB
10 11
 from django.db.models import Count, Min
11 12
 from django.test import TestCase
12  
-from django.utils.unittest import skipUnless
13 13
 
14 14
 if HAS_GEOS:
15 15
     from .models import City, PennsylvaniaCity, State, Truth
2  django/contrib/gis/tests/geoapp/test_sitemaps.py
... ...
@@ -1,6 +1,7 @@
1 1
 from __future__ import absolute_import
2 2
 
3 3
 from io import BytesIO
  4
+from unittest import skipUnless
4 5
 from xml.dom import minidom
5 6
 import zipfile
6 7
 
@@ -9,7 +10,6 @@
9 10
 from django.contrib.gis.tests.utils import HAS_SPATIAL_DB
10 11
 from django.contrib.sites.models import Site
11 12
 from django.test import TestCase
12  
-from django.utils.unittest import skipUnless
13 13
 
14 14
 if HAS_GEOS:
15 15
     from .models import City, Country
2  django/contrib/gis/tests/geoapp/tests.py
... ...
@@ -1,6 +1,7 @@
1 1
 from __future__ import absolute_import
2 2
 
3 3
 import re
  4
+from unittest import skipUnless
4 5
 
5 6
 from django.db import connection
6 7
 from django.contrib.gis import gdal
@@ -10,7 +11,6 @@
10 11
     mysql, oracle, postgis, spatialite)
11 12
 from django.test import TestCase
12 13
 from django.utils import six, unittest
13  
-from django.utils.unittest import skipUnless
14 14
 
15 15
 if HAS_GEOS:
16 16
     from django.contrib.gis.geos import (fromstr, GEOSGeometry,
2  django/contrib/gis/tests/geogapp/tests.py
@@ -4,6 +4,7 @@
4 4
 from __future__ import absolute_import
5 5
 
6 6
 import os
  7
+from unittest import skipUnless
7 8
 
8 9
 from django.contrib.gis.gdal import HAS_GDAL
9 10
 from django.contrib.gis.geos import HAS_GEOS
@@ -11,7 +12,6 @@
11 12
 from django.contrib.gis.tests.utils import postgis
12 13
 from django.test import TestCase
13 14
 from django.utils._os import upath
14  
-from django.utils.unittest import skipUnless
15 15
 
16 16
 if HAS_GEOS:
17 17
     from .models import City, County, Zipcode
2  django/contrib/gis/tests/inspectapp/tests.py
... ...
@@ -1,13 +1,13 @@
1 1
 from __future__ import absolute_import
2 2
 
3 3
 import os
  4
+from unittest import skipUnless
4 5
 
5 6
 from django.db import connections
6 7
 from django.test import TestCase
7 8
 from django.contrib.gis.gdal import HAS_GDAL
8 9
 from django.contrib.gis.geometry.test_data import TEST_DATA
9 10
 from django.contrib.gis.tests.utils import HAS_SPATIAL_DB
10  
-from django.utils.unittest import skipUnless
11 11
 
12 12
 if HAS_GDAL:
13 13
     from django.contrib.gis.gdal import Driver
6  django/contrib/gis/tests/layermap/tests.py
... ...
@@ -1,17 +1,17 @@
1 1
 # coding: utf-8
2 2
 from __future__ import absolute_import, unicode_literals
3 3
 
4  
-import os
5 4
 from copy import copy
6 5
 from decimal import Decimal
  6
+import os
  7
+import unittest
  8
+from unittest import skipUnless
7 9
 
8 10
 from django.contrib.gis.gdal import HAS_GDAL
9 11
 from django.contrib.gis.tests.utils import HAS_SPATIAL_DB, mysql
10 12
 from django.db import router
11 13
 from django.conf import settings
12 14
 from django.test import TestCase
13  
-from django.utils import unittest
14  
-from django.utils.unittest import skipUnless
15 15
 from django.utils._os import upath
16 16
 
17 17
 if HAS_GDAL:
3  django/contrib/gis/tests/relatedapp/tests.py
... ...
@@ -1,9 +1,10 @@
1 1
 from __future__ import absolute_import
2 2
 
  3
+from unittest import skipUnless
  4
+
3 5
 from django.contrib.gis.geos import HAS_GEOS
4 6
 from django.contrib.gis.tests.utils import HAS_SPATIAL_DB, mysql, oracle, no_mysql, no_oracle, no_spatialite
5 7
 from django.test import TestCase
6  
-from django.utils.unittest import skipUnless
7 8
 
8 9
 if HAS_GEOS:
9 10
     from django.contrib.gis.db.models import Collect, Count, Extent, F, Union
7  django/contrib/gis/tests/test_geoforms.py
... ...
@@ -1,15 +1,16 @@
  1
+from unittest import skipUnless
  2
+
1 3
 from django.forms import ValidationError
2 4
 from django.contrib.gis.gdal import HAS_GDAL
3 5
 from django.contrib.gis.tests.utils import HAS_SPATIALREFSYS
4 6
 from django.test import SimpleTestCase
5 7
 from django.utils import six
6  
-from django.utils.unittest import skipUnless
7  
-
8 8
 
9 9
 if HAS_SPATIALREFSYS:
10 10
     from django.contrib.gis import forms
11 11
     from django.contrib.gis.geos import GEOSGeometry
12 12
 
  13
+
13 14
 @skipUnless(HAS_GDAL and HAS_SPATIALREFSYS, "GeometryFieldTest needs gdal support and a spatial database")
14 15
 class GeometryFieldTest(SimpleTestCase):
15 16
 
@@ -143,7 +144,7 @@ def assertMapWidget(self, form_instance):
143 144
 
144 145
     def assertTextarea(self, geom, rendered):
145 146
         """Makes sure the wkt and a textarea are in the content"""
146  
-        
  147
+
147 148
         self.assertIn('<textarea ', rendered)
148 149
         self.assertIn('required', rendered)
149 150
         self.assertIn(geom.wkt, rendered)
3  django/contrib/gis/tests/test_measure.py
@@ -3,8 +3,9 @@
3 3
 and conversions. Here are some tests.
4 4
 """
5 5
 
  6
+import unittest
  7
+
6 8
 from django.contrib.gis.measure import Distance, Area, D, A
7  
-from django.utils import unittest
8 9
 
9 10
 
10 11
 class DistanceTest(unittest.TestCase):
3  django/contrib/gis/tests/test_spatialrefsys.py
... ...
@@ -1,8 +1,9 @@
  1
+import unittest
  2
+
1 3
 from django.contrib.gis.gdal import HAS_GDAL
2 4
 from django.contrib.gis.tests.utils import (no_mysql, oracle, postgis,
3 5
     spatialite, HAS_SPATIALREFSYS, SpatialRefSys)
4 6
 from django.utils import six
5  
-from django.utils import unittest
6 7
 
7 8
 
8 9
 test_srs = ({'srid' : 4326,
2  django/contrib/humanize/tests.py
... ...
@@ -1,6 +1,7 @@
1 1
 from __future__ import unicode_literals
2 2
 import datetime
3 3
 from decimal import Decimal
  4
+from unittest import skipIf
4 5
 
5 6
 try:
6 7
     import pytz
@@ -17,7 +18,6 @@
17 18
 from django.utils import translation
18 19
 from django.utils.translation import ugettext as _
19 20
 from django.utils import tzinfo
20  
-from django.utils.unittest import skipIf
21 21
 
22 22
 from i18n import TransRealMixin
23 23
 
3  django/contrib/messages/tests/base.py
... ...
@@ -1,3 +1,5 @@
  1
+from unittest import skipIf
  2
+
1 3
 from django import http
2 4
 from django.conf import settings, global_settings
3 5
 from django.contrib.messages import constants, utils, get_level, set_level
@@ -7,7 +9,6 @@
7 9
 from django.core.urlresolvers import reverse
8 10
 from django.test.utils import override_settings
9 11
 from django.utils.translation import ugettext_lazy
10  
-from django.utils.unittest import skipIf
11 12
 
12 13
 
13 14
 def skipUnlessAuthIsInstalled(func):
3  django/contrib/messages/tests/test_middleware.py
... ...
@@ -1,6 +1,7 @@
  1
+import unittest
  2
+
1 3
 from django import http
2 4
 from django.contrib.messages.middleware import MessageMiddleware
3  
-from django.utils import unittest
4 5
 
5 6
 
6 7
 class MiddlewareTest(unittest.TestCase):
2  django/contrib/sessions/tests.py
@@ -4,6 +4,7 @@
4 4
 import shutil
5 5
 import string
6 6
 import tempfile
  7
+import unittest
7 8
 import warnings
8 9
 
9 10
 from django.conf import settings
@@ -22,7 +23,6 @@
22 23
 from django.test.utils import override_settings, patch_logger
23 24
 from django.utils import six
24 25
 from django.utils import timezone
25  
-from django.utils import unittest
26 26
 
27 27
 from django.contrib.sessions.exceptions import InvalidSessionKey
28 28
 
3  django/contrib/sitemaps/tests/test_flatpages.py
... ...
@@ -1,7 +1,8 @@
1 1
 from __future__ import unicode_literals
2 2
 
  3
+from unittest import skipUnless
  4
+
3 5
 from django.conf import settings
4  
-from django.utils.unittest import skipUnless
5 6
 
6 7
 from .base import SitemapTestsBase
7 8
 
2  django/contrib/sitemaps/tests/test_http.py
@@ -2,13 +2,13 @@
2 2
 
3 3
 import os
4 4
 from datetime import date
  5
+from unittest import skipUnless
5 6
 
6 7
 from django.conf import settings
7 8
 from django.contrib.sitemaps import Sitemap, GenericSitemap
8 9
 from django.contrib.sites.models import Site
9 10
 from django.core.exceptions import ImproperlyConfigured
10 11
 from django.test.utils import override_settings
11  
-from django.utils.unittest import skipUnless
12 12
 from django.utils.formats import localize
13 13
 from django.utils._os import upath
14 14
 from django.utils.translation import activate, deactivate
4  django/test/runner.py
... ...
@@ -1,12 +1,12 @@
1 1
 import os
2 2
 from optparse import make_option
  3
+import unittest
  4
+from unittest import TestSuite, defaultTestLoader
3 5
 
4 6
 from django.conf import settings
5 7
 from django.core.exceptions import ImproperlyConfigured
6 8
 from django.test import TestCase
7 9
 from django.test.utils import setup_test_environment, teardown_test_environment
8  
-from django.utils import unittest
9  
-from django.utils.unittest import TestSuite, defaultTestLoader
10 10
 
11 11
 
12 12
 class DiscoverRunner(object):
17  django/test/testcases.py
@@ -8,13 +8,16 @@
8 8
 import os
9 9
 import re
10 10
 import sys
  11
+import select
  12
+import socket
  13
+import threading
  14
+import unittest
  15
+from unittest import skipIf         # Imported here for backward compatibility
  16
+from unittest.util import safe_repr
11 17
 try:
12 18
     from urllib.parse import urlsplit, urlunsplit
13 19
 except ImportError:     # Python 2
14 20
     from urlparse import urlsplit, urlunsplit
15  
-import select
16  
-import socket
17  
-import threading
18 21
 
19 22
 from django.conf import settings
20 23
 from django.contrib.staticfiles.handlers import StaticFilesHandler
@@ -36,10 +39,8 @@
36 39
 from django.test.signals import template_rendered
37 40
 from django.test.utils import (CaptureQueriesContext, ContextList,
38 41
     override_settings, compare_xml)
39  
-from django.utils import six, unittest as ut2
  42
+from django.utils import six
40 43
 from django.utils.encoding import force_text
41  
-from django.utils.unittest import skipIf # Imported here for backward compatibility
42  
-from django.utils.unittest.util import safe_repr
43 44
 from django.views.static import serve
44 45
 
45 46
 
@@ -155,7 +156,7 @@ def message(self):
155 156
         return '%s was rendered.' % self.template_name
156 157
 
157 158
 
158  
-class SimpleTestCase(ut2.TestCase):
  159
+class SimpleTestCase(unittest.TestCase):
159 160
 
160 161
     # The class we'll use for the test client self.client.
161 162
     # Can be overridden in derived classes.
@@ -886,7 +887,7 @@ def decorator(test_func):
886 887
             @wraps(test_func)
887 888
             def skip_wrapper(*args, **kwargs):
888 889
                 if condition():
889  
-                    raise ut2.SkipTest(reason)
  890
+                    raise unittest.SkipTest(reason)
890 891
                 return test_func(*args, **kwargs)
891 892
             test_item = skip_wrapper
892 893
         else:
2  docs/topics/testing/advanced.txt
@@ -37,7 +37,7 @@ Example
37 37
 
38 38
 The following is a simple unit test using the request factory::
39 39
 
40  
-    from django.utils import unittest
  40
+    import unittest
41 41
     from django.test.client import RequestFactory
42 42
 
43 43
     class SimpleTest(unittest.TestCase):
4  docs/topics/testing/overview.txt
@@ -800,7 +800,7 @@ Example
800 800
 
801 801
 The following is a simple unit test using the test client::
802 802
 
803  
-    from django.utils import unittest
  803
+    import unittest
804 804
     from django.test.client import Client
805 805
 
806 806
     class SimpleTest(unittest.TestCase):
@@ -1143,7 +1143,7 @@ worry about state (such as cookies) carrying over from one test to another.
1143 1143
 
1144 1144
 This means, instead of instantiating a ``Client`` in each test::
1145 1145
 
1146  
-    from django.utils import unittest
  1146
+    import unittest
1147 1147
     from django.test.client import Client
1148 1148
 
1149 1149
     class SimpleTest(unittest.TestCase):
4  tests/admin_scripts/tests.py
@@ -6,13 +6,14 @@
6 6
 """
7 7
 from __future__ import unicode_literals
8 8
 
  9
+import codecs
9 10
 import os
10 11
 import re
11 12
 import shutil
12 13
 import socket
13 14
 import subprocess
14 15
 import sys
15  
-import codecs
  16
+import unittest
16 17
 
17 18
 import django
18 19
 from django import conf, get_version
@@ -20,7 +21,6 @@
20 21
 from django.core.management import BaseCommand, CommandError
21 22
 from django.db import connection
22 23
 from django.test.runner import DiscoverRunner
23  
-from django.utils import unittest
24 24
 from django.utils.encoding import force_text
25 25
 from django.utils._os import upath
26 26
 from django.utils.six import StringIO
2  tests/admin_widgets/tests.py
@@ -2,6 +2,7 @@
2 2
 from __future__ import absolute_import, unicode_literals
3 3
 
4 4
 from datetime import datetime
  5
+from unittest import TestCase
5 6
 
6 7
 from django import forms
7 8
 from django.conf import settings
@@ -16,7 +17,6 @@
16 17
 from django.utils import six
17 18
 from django.utils import translation
18 19
 from django.utils.html import conditional_escape
19  
-from django.utils.unittest import TestCase
20 20
 
21 21
 from . import models
22 22
 from .widgetadmin import site as widget_admin_site
1  tests/aggregation_regress/tests.py
@@ -10,7 +10,6 @@
10 10
 from django.db.models import Count, Max, Avg, Sum, StdDev, Variance, F, Q
11 11
 from django.test import TestCase, Approximate, skipUnlessDBFeature
12 12
 from django.utils import six
13  
-from django.utils.unittest import expectedFailure
14 13
 
15 14
 from .models import (Author, Book, Publisher, Clues, Entries, HardbackBook,
16 15
         ItemTag, WithManualPK)
3  tests/app_loading/tests.py
@@ -4,11 +4,12 @@
4 4
 import os
5 5
 import sys
6 6
 import time
  7
+from unittest import TestCase
7 8
 
8 9
 from django.conf import Settings
9 10
 from django.db.models.loading import cache, load_app, get_model, get_models
10 11
 from django.utils._os import upath
11  
-from django.utils.unittest import TestCase
  12
+
12 13
 
13 14
 class EggLoadingTest(TestCase):
14 15
 
2  tests/bash_completion/tests.py
@@ -3,10 +3,10 @@
3 3
 """
4 4
 import os
5 5
 import sys
  6
+import unittest
6 7
 
7 8
 from django.conf import settings
8 9
 from django.core.management import ManagementUtility
9  
-from django.utils import unittest
10 10
 from django.utils.six import StringIO
11 11
 
12 12
 
2  tests/bug639/tests.py
@@ -8,9 +8,9 @@
8 8
 
9 9
 import os
10 10
 import shutil
  11
+import unittest
11 12
 
12 13
 from django.core.files.uploadedfile import SimpleUploadedFile
13  
-from django.utils import unittest
14 14
 from django.utils._os import upath
15 15
 
16 16
 from .models import Photo, PhotoForm, temp_storage_dir
3  tests/bug8245/tests.py
... ...
@@ -1,5 +1,6 @@
  1
+from unittest import TestCase
  2
+
1 3
 from django.contrib import admin
2  
-from django.utils.unittest import TestCase
3 4
 
4 5
 
5 6
 class Bug8245Test(TestCase):
2  tests/builtin_server/tests.py
... ...
@@ -1,9 +1,9 @@
1 1
 from __future__ import unicode_literals
2 2
 
3 3
 from io import BytesIO
  4
+from unittest import TestCase
4 5
 
5 6
 from django.core.servers.basehttp import ServerHandler, MAX_SOCKET_CHUNK_SIZE
6  
-from django.utils.unittest import TestCase
7 7
 
8 8
 
9 9
 class DummyHandler(object):
2  tests/db_typecasts/tests.py
... ...
@@ -1,10 +1,10 @@
1 1
 # Unit tests for typecast functions in django.db.backends.util
2 2
 
3 3
 import datetime
  4
+import unittest
4 5
 
5 6
 from django.db.backends import util as typecasts
6 7
 from django.utils import six
7  
-from django.utils import unittest
8 8
 
9 9
 
10 10
 TEST_CASES = {
2  tests/decorators/tests.py
... ...
@@ -1,4 +1,5 @@
1 1
 from functools import wraps
  2
+from unittest import TestCase
2 3
 
3 4
 from django.contrib.admin.views.decorators import staff_member_required
4 5
 from django.contrib.auth.decorators import login_required, permission_required, user_passes_test
@@ -6,7 +7,6 @@
6 7
 from django.middleware.clickjacking import XFrameOptionsMiddleware
7 8
 from django.utils.decorators import method_decorator
8 9
 from django.utils.functional import allow_lazy, lazy, memoize
9  
-from django.utils.unittest import TestCase
10 10
 from django.views.decorators.cache import cache_page, never_cache, cache_control
11 11
 from django.views.decorators.clickjacking import xframe_options_deny, xframe_options_sameorigin, xframe_options_exempt
12 12
 from django.views.decorators.http import require_http_methods, require_GET, require_POST, require_safe, condition
3  tests/defaultfilters/tests.py
@@ -3,11 +3,12 @@
3 3
 
4 4
 import datetime
5 5
 import decimal
  6
+import unittest
6 7
 
7 8
 from django.template.defaultfilters import *
8 9
 from django.test import TestCase
9 10
 from django.utils import six
10  
-from django.utils import unittest, translation
  11
+from django.utils import translation
11 12
 from django.utils.safestring import SafeData
12 13
 from django.utils.encoding import python_2_unicode_compatible
13 14
 
2  tests/dispatch/tests/test_dispatcher.py
... ...
@@ -1,9 +1,9 @@
1 1
 import gc
2 2
 import sys
3 3
 import time
  4
+import unittest
4 5
 
5 6
 from django.dispatch import Signal, receiver
6  
-from django.utils import unittest
7 7
 
8 8
 
9 9
 if sys.platform.startswith('java'):
3  tests/dispatch/tests/test_saferef.py
... ...
@@ -1,6 +1,7 @@
  1
+import unittest
  2
+
1 3
 from django.dispatch.saferef import safeRef
2 4
 from django.utils.six.moves import xrange
3  
-from django.utils import unittest
4 5
 
5 6
 class Test1(object):
6 7
     def x(self):
2  tests/file_storage/tests.py
@@ -7,6 +7,7 @@
7 7
 import sys
8 8
 import tempfile
9 9
 import time
  10
+import unittest
10 11
 try:
11 12
     from urllib.request import urlopen
12 13
 except ImportError:     # Python 2
@@ -28,7 +29,6 @@
28 29
 from django.core.files.uploadedfile import UploadedFile
29 30
 from django.test import LiveServerTestCase, SimpleTestCase
30 31
 from django.utils import six
31  
-from django.utils import unittest
32 32
 from django.utils._os import upath
33 33
 from django.test.utils import override_settings
34 34
 
2  tests/file_uploads/tests.py
@@ -8,6 +8,7 @@
8 8
 import os
9 9
 import shutil
10 10
 import tempfile as sys_tempfile
  11
+import unittest
11 12
 
12 13
 from django.core.files import temp as tempfile
13 14
 from django.core.files.uploadedfile import SimpleUploadedFile
@@ -16,7 +17,6 @@
16 17
 from django.test.utils import override_settings
17 18
 from django.utils.encoding import force_bytes
18 19
 from django.utils.six import StringIO
19  
-from django.utils import unittest
20 20
 
21 21
 from . import uploadhandler
22 22
 from .models import FileModel
2  tests/files/tests.py
@@ -4,6 +4,7 @@
4 4
 import gzip
5 5
 import shutil
6 6
 import tempfile
  7
+import unittest
7 8
 
8 9
 from django.core.cache import cache
9 10
 from django.core.files import File
@@ -11,7 +12,6 @@
11 12
 from django.core.files.base import ContentFile
12 13
 from django.core.files.uploadedfile import SimpleUploadedFile
13 14
 from django.test import TestCase
14  
-from django.utils import unittest
15 15
 from django.utils.six import StringIO
16 16
 
17 17
 from .models import Storage, temp_storage, temp_storage_location
3  tests/forms_tests/tests/test_validators.py
... ...
@@ -1,9 +1,10 @@
1 1
 from __future__ import unicode_literals
2 2
 
  3
+from unittest import TestCase
  4
+
3 5
 from django import forms
4 6
 from django.core import validators
5 7
 from django.core.exceptions import ValidationError
6  
-from django.utils.unittest import TestCase
7 8
 
8 9
 
9 10
 class UserForm(forms.Form):
2  tests/generic_views/test_base.py
... ...
@@ -1,11 +1,11 @@
1 1
 from __future__ import absolute_import
2 2
 
3 3
 import time
  4
+import unittest
4 5
 
5 6
 from django.core.exceptions import ImproperlyConfigured
6 7
 from django.http import HttpResponse
7 8
 from django.test import TestCase, RequestFactory
8  
-from django.utils import unittest
9 9
 from django.views.generic import View, TemplateView, RedirectView
10 10
 
11 11
 from . import views
2  tests/generic_views/test_dates.py
@@ -2,12 +2,12 @@
2 2
 
3 3
 import time
4 4
 import datetime
  5
+from unittest import skipUnless
5 6
 
6 7
 from django.core.exceptions import ImproperlyConfigured
7 8
 from django.test import TestCase, skipUnlessDBFeature
8 9
 from django.test.utils import override_settings
9 10
 from django.utils import timezone
10  
-from django.utils.unittest import skipUnless
11 11
 
12 12
 from .models import Book, BookSigning
13 13
 
2  tests/generic_views/test_edit.py
... ...
@@ -1,12 +1,12 @@
1 1
 from __future__ import absolute_import
2 2
 
3 3
 import warnings
  4
+from unittest import expectedFailure
4 5
 
5 6
 from django.core.exceptions import ImproperlyConfigured
6 7
 from django.core.urlresolvers import reverse
7 8
 from django import forms
8 9
 from django.test import TestCase
9  
-from django.utils.unittest import expectedFailure
10 10
 from django.test.client import RequestFactory
11 11
 from django.views.generic.base import View
12 12
 from django.views.generic.edit import FormMixin, CreateView
2  tests/httpwrappers/tests.py
@@ -4,6 +4,7 @@
4 4
 import copy
5 5
 import os
6 6
 import pickle
  7
+import unittest
7 8
 import warnings
8 9
 
9 10
 from django.core.exceptions import SuspiciousOperation
@@ -18,7 +19,6 @@
18 19
 from django.utils.encoding import smart_str
19 20
 from django.utils._os import upath
20 21
 from django.utils import six
21  
-from django.utils import unittest
22 22
 
23 23
 
24 24
 class QueryDictTests(unittest.TestCase):
3  tests/indexes/tests.py
... ...
@@ -1,7 +1,8 @@
  1
+from unittest import skipUnless
  2
+
1 3
 from django.core.management.color import no_style
2 4
 from django.db import connections, DEFAULT_DB_ALIAS
3 5
 from django.test import TestCase
4  
-from django.utils.unittest import skipUnless
5 6
 
6 7
 from .models import Article
7 8
 
2  tests/inspectdb/tests.py
@@ -2,11 +2,11 @@
2 2
 from __future__ import unicode_literals
3 3
 
4 4
 import re
  5
+from unittest import expectedFailure
5 6
 
6 7
 from django.core.management import call_command
7 8
 from django.db import connection
8 9
 from django.test import TestCase, skipUnlessDBFeature
9  
-from django.utils.unittest import expectedFailure
10 10
 from django.utils.six import PY3, StringIO
11 11
 
12 12
 if connection.vendor == 'oracle':
3  tests/introspection/tests.py
... ...
@@ -1,8 +1,9 @@
1 1
 from __future__ import absolute_import, unicode_literals
2 2
 
  3
+import unittest
  4
+
3 5
 from django.db import connection
4 6
 from django.test import TestCase, skipUnlessDBFeature, skipIfDBFeature
5  
-from django.utils import unittest
6 7
 
7 8
 from .models import Reporter, Article
8 9
 
3  tests/invalid_models/tests.py
... ...
@@ -1,11 +1,10 @@
1 1
 import copy
2 2
 import sys
  3
+import unittest
3 4
 
4 5
 from django.core.management.validation import get_validation_errors
5 6
 from django.db.models.loading import cache, load_app
6  
-
7 7
 from django.test.utils import override_settings
8  
-from django.utils import unittest
9 8
 from django.utils.six import StringIO
10 9
 
11 10
 
2  tests/logging_tests/tests.py
@@ -3,6 +3,7 @@
3 3
 import copy