Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

Refs #20680.
  • Loading branch information...
commit cfcf4b3605f9653e4e056088d89932b2a0e4281b 1 parent 7f264e0
Aymeric Augustin aaugustin authored
Showing with 212 additions and 161 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
  101. +2 −1  tests/transactions_regress/tests.py
  102. +3 −1 tests/urlpatterns_reverse/tests.py
  103. +1 −1  tests/utils_tests/test_archive.py
  104. +2 −1  tests/utils_tests/test_baseconv.py
  105. +2 −2 tests/utils_tests/test_crypto.py
  106. +1 −1  tests/utils_tests/test_dateparse.py
  107. +2 −1  tests/utils_tests/test_encoding.py
  108. +2 −1  tests/utils_tests/test_functional.py
  109. +1 −1  tests/utils_tests/test_html.py
  110. +1 −1  tests/utils_tests/test_http.py
  111. +2 −1  tests/utils_tests/test_ipv6.py
  112. +2 −2 tests/utils_tests/test_module_loading.py
  113. +1 −1  tests/utils_tests/test_os_utils.py
  114. +2 −1  tests/utils_tests/test_regex_helper.py
  115. +1 −1  tests/utils_tests/test_simplelazyobject.py
  116. +2 −1  tests/utils_tests/test_termcolors.py
  117. +2 −1  tests/utils_tests/test_timezone.py
  118. +2 −1  tests/utils_tests/test_tzinfo.py
  119. +2 −1  tests/validation/test_error_messages.py
  120. +1 −1  tests/validation/test_unique.py
  121. +2 −2 tests/validators/tests.py
  122. +1 −1  tests/version/tests.py
  123. +1 −1  tests/view_tests/tests/test_debug.py
2  django/contrib/admin/tests.py
View
@@ -1,8 +1,8 @@
import os
+from unittest import SkipTest
from django.test import LiveServerTestCase
from django.utils.module_loading import import_by_path
-from django.utils.unittest import SkipTest
from django.utils.translation import ugettext as _
3  django/contrib/admindocs/tests/test_fields.py
View
@@ -1,9 +1,10 @@
from __future__ import absolute_import, unicode_literals
+import unittest
+
from django.contrib.admindocs import views
from django.db import models
from django.db.models import fields
-from django.utils import unittest
from django.utils.translation import ugettext as _
5 django/contrib/auth/tests/test_hashers.py
View
@@ -1,13 +1,14 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
+import unittest
+from unittest import skipUnless
+
from django.conf.global_settings import PASSWORD_HASHERS as default_hashers
from django.contrib.auth.hashers import (is_password_usable, BasePasswordHasher,
check_password, make_password, PBKDF2PasswordHasher, load_hashers, PBKDF2SHA1PasswordHasher,
get_hasher, identify_hasher, UNUSABLE_PASSWORD_PREFIX, UNUSABLE_PASSWORD_SUFFIX_LENGTH)
from django.utils import six
-from django.utils import unittest
-from django.utils.unittest import skipUnless
try:
4 django/contrib/auth/tests/test_tokens.py
View
@@ -1,12 +1,12 @@
-import sys
from datetime import date, timedelta
+import sys
+import unittest
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth.tokens import PasswordResetTokenGenerator
from django.contrib.auth.tests.utils import skipIfCustomUser
from django.test import TestCase
-from django.utils import unittest
@skipIfCustomUser
3  django/contrib/auth/tests/utils.py
View
@@ -1,5 +1,6 @@
+from unittest import skipIf
+
from django.conf import settings
-from django.utils.unittest import skipIf
def skipIfCustomUser(test_func):
2  django/contrib/formtools/tests/tests.py
View
@@ -3,6 +3,7 @@
import datetime
import os
+import unittest
import warnings
from django import http
@@ -10,7 +11,6 @@
from django.test import TestCase
from django.test.utils import override_settings
from django.utils._os import upath
-from django.utils import unittest
from django.contrib.formtools.tests.forms import *
5 django/contrib/gis/gdal/tests/test_driver.py
View
@@ -1,6 +1,7 @@
+import unittest
+from unittest import skipUnless
+
from django.contrib.gis.gdal import HAS_GDAL
-from django.utils import unittest
-from django.utils.unittest import skipUnless
if HAS_GDAL:
from django.contrib.gis.gdal import Driver, OGRException
4 django/contrib/gis/gdal/tests/test_ds.py
View
@@ -1,9 +1,9 @@
import os
+import unittest
+from unittest import skipUnless
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.geometry.test_data import get_ds_file, TestDS, TEST_DATA
-from django.utils import unittest
-from django.utils.unittest import skipUnless
if HAS_GDAL:
from django.contrib.gis.gdal import DataSource, Envelope, OGRGeometry, OGRException, OGRIndexError, GDAL_VERSION
7 django/contrib/gis/gdal/tests/test_envelope.py
View
@@ -1,6 +1,7 @@
+import unittest
+from unittest import skipUnless
+
from django.contrib.gis.gdal import HAS_GDAL
-from django.utils import unittest
-from django.utils.unittest import skipUnless
if HAS_GDAL:
from django.contrib.gis.gdal import Envelope, OGRException
@@ -17,7 +18,7 @@ class EnvelopeTest(unittest.TestCase):
def setUp(self):
self.e = Envelope(0, 0, 5, 5)
-
+
def test01_init(self):
"Testing Envelope initilization."
e1 = Envelope((0, 0, 5, 5))
4 django/contrib/gis/gdal/tests/test_geom.py
View
@@ -4,12 +4,12 @@
from django.utils.six.moves import cPickle as pickle
except ImportError:
import pickle
+import unittest
+from unittest import skipUnless
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.geometry.test_data import TestDataMixin
from django.utils.six.moves import xrange
-from django.utils import unittest
-from django.utils.unittest import skipUnless
if HAS_GDAL:
from django.contrib.gis.gdal import (OGRGeometry, OGRGeomType,
5 django/contrib/gis/gdal/tests/test_srs.py
View
@@ -1,6 +1,7 @@
+import unittest
+from unittest import skipUnless
+
from django.contrib.gis.gdal import HAS_GDAL
-from django.utils import unittest
-from django.utils.unittest import skipUnless
if HAS_GDAL:
from django.contrib.gis.gdal import SpatialReference, CoordTransform, OGRException, SRSException
5 django/contrib/gis/geoip/tests.py
View
@@ -2,11 +2,12 @@
from __future__ import unicode_literals
import os
+import unittest
+from unittest import skipUnless
+
from django.conf import settings
from django.contrib.gis.geos import HAS_GEOS
from django.contrib.gis.geoip import HAS_GEOIP
-from django.utils import unittest
-from django.utils.unittest import skipUnless
from django.utils import six
4 django/contrib/gis/geos/tests/test_geos.py
View
@@ -3,6 +3,8 @@
import ctypes
import json
import random
+import unittest
+from unittest import skipUnless
from binascii import a2b_hex, b2a_hex
from io import BytesIO
@@ -14,8 +16,6 @@
from django.utils.encoding import force_bytes
from django.utils import six
from django.utils.six.moves import xrange
-from django.utils import unittest
-from django.utils.unittest import skipUnless
from .. import HAS_GEOS
4 django/contrib/gis/geos/tests/test_geos_mutation.py
View
@@ -2,8 +2,8 @@
# Modified from original contribution by Aryeh Leib Taurog, which was
# released under the New BSD license.
-from django.utils import unittest
-from django.utils.unittest import skipUnless
+import unittest
+from unittest import skipUnless
from .. import HAS_GEOS
2  django/contrib/gis/geos/tests/test_io.py
View
@@ -2,9 +2,9 @@
import binascii
import unittest
+from unittest import skipUnless
from django.contrib.gis import memoryview
-from django.utils.unittest import skipUnless
from ..import HAS_GEOS
4 django/contrib/gis/geos/tests/test_mutable_list.py
View
@@ -3,9 +3,11 @@
#
# Modified from original contribution by Aryeh Leib Taurog, which was
# released under the New BSD license.
+
+import unittest
+
from django.contrib.gis.geos.mutable_list import ListMixin
from django.utils import six
-from django.utils import unittest
class UserListA(ListMixin):
3  django/contrib/gis/tests/distapp/tests.py
View
@@ -1,5 +1,7 @@
from __future__ import absolute_import
+from unittest import skipUnless
+
from django.db import connection
from django.db.models import Q
from django.contrib.gis.geos import HAS_GEOS
@@ -8,7 +10,6 @@
HAS_SPATIAL_DB, mysql, oracle, postgis, spatialite, no_oracle, no_spatialite
)
from django.test import TestCase
-from django.utils.unittest import skipUnless
if HAS_GEOS and HAS_SPATIAL_DB:
from django.contrib.gis.geos import GEOSGeometry, LineString
2  django/contrib/gis/tests/geo3d/tests.py
View
@@ -2,13 +2,13 @@
import os
import re
+from unittest import skipUnless
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.geos import HAS_GEOS
from django.contrib.gis.tests.utils import postgis
from django.test import TestCase
from django.utils._os import upath
-from django.utils.unittest import skipUnless
if HAS_GEOS:
from django.contrib.gis.db.models import Union, Extent3D
3  django/contrib/gis/tests/geoadmin/tests.py
View
@@ -1,9 +1,10 @@
from __future__ import absolute_import
+from unittest import skipUnless
+
from django.test import TestCase
from django.contrib.gis.geos import HAS_GEOS
from django.contrib.gis.tests.utils import HAS_SPATIAL_DB
-from django.utils.unittest import skipUnless
if HAS_GEOS and HAS_SPATIAL_DB:
from django.contrib.gis import admin
2  django/contrib/gis/tests/geoapp/test_feeds.py
View
@@ -1,5 +1,6 @@
from __future__ import absolute_import
+from unittest import skipUnless
from xml.dom import minidom
from django.conf import settings
@@ -7,7 +8,6 @@
from django.contrib.gis.geos import HAS_GEOS
from django.contrib.gis.tests.utils import HAS_SPATIAL_DB
from django.test import TestCase
-from django.utils.unittest import skipUnless
if HAS_GEOS:
from .models import City
2  django/contrib/gis/tests/geoapp/test_regress.py
View
@@ -2,6 +2,7 @@
from __future__ import absolute_import, unicode_literals
from datetime import datetime
+from unittest import skipUnless
from django.contrib.gis.geos import HAS_GEOS
from django.contrib.gis.tests.utils import no_mysql, no_spatialite
@@ -9,7 +10,6 @@
from django.contrib.gis.tests.utils import HAS_SPATIAL_DB
from django.db.models import Count, Min
from django.test import TestCase
-from django.utils.unittest import skipUnless
if HAS_GEOS:
from .models import City, PennsylvaniaCity, State, Truth
2  django/contrib/gis/tests/geoapp/test_sitemaps.py
View
@@ -1,6 +1,7 @@
from __future__ import absolute_import
from io import BytesIO
+from unittest import skipUnless
from xml.dom import minidom
import zipfile
@@ -9,7 +10,6 @@
from django.contrib.gis.tests.utils import HAS_SPATIAL_DB
from django.contrib.sites.models import Site
from django.test import TestCase
-from django.utils.unittest import skipUnless
if HAS_GEOS:
from .models import City, Country
2  django/contrib/gis/tests/geoapp/tests.py
View
@@ -1,6 +1,7 @@
from __future__ import absolute_import
import re
+from unittest import skipUnless
from django.db import connection
from django.contrib.gis import gdal
@@ -10,7 +11,6 @@
mysql, oracle, postgis, spatialite)
from django.test import TestCase
from django.utils import six, unittest
-from django.utils.unittest import skipUnless
if HAS_GEOS:
from django.contrib.gis.geos import (fromstr, GEOSGeometry,
2  django/contrib/gis/tests/geogapp/tests.py
View
@@ -4,6 +4,7 @@
from __future__ import absolute_import
import os
+from unittest import skipUnless
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.geos import HAS_GEOS
@@ -11,7 +12,6 @@
from django.contrib.gis.tests.utils import postgis
from django.test import TestCase
from django.utils._os import upath
-from django.utils.unittest import skipUnless
if HAS_GEOS:
from .models import City, County, Zipcode
2  django/contrib/gis/tests/inspectapp/tests.py
View
@@ -1,13 +1,13 @@
from __future__ import absolute_import
import os
+from unittest import skipUnless
from django.db import connections
from django.test import TestCase
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.geometry.test_data import TEST_DATA
from django.contrib.gis.tests.utils import HAS_SPATIAL_DB
-from django.utils.unittest import skipUnless
if HAS_GDAL:
from django.contrib.gis.gdal import Driver
6 django/contrib/gis/tests/layermap/tests.py
View
@@ -1,17 +1,17 @@
# coding: utf-8
from __future__ import absolute_import, unicode_literals
-import os
from copy import copy
from decimal import Decimal
+import os
+import unittest
+from unittest import skipUnless
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.tests.utils import HAS_SPATIAL_DB, mysql
from django.db import router
from django.conf import settings
from django.test import TestCase
-from django.utils import unittest
-from django.utils.unittest import skipUnless
from django.utils._os import upath
if HAS_GDAL:
3  django/contrib/gis/tests/relatedapp/tests.py
View
@@ -1,9 +1,10 @@
from __future__ import absolute_import
+from unittest import skipUnless
+
from django.contrib.gis.geos import HAS_GEOS
from django.contrib.gis.tests.utils import HAS_SPATIAL_DB, mysql, oracle, no_mysql, no_oracle, no_spatialite
from django.test import TestCase
-from django.utils.unittest import skipUnless
if HAS_GEOS:
from django.contrib.gis.db.models import Collect, Count, Extent, F, Union
7 django/contrib/gis/tests/test_geoforms.py
View
@@ -1,15 +1,16 @@
+from unittest import skipUnless
+
from django.forms import ValidationError
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.tests.utils import HAS_SPATIALREFSYS
from django.test import SimpleTestCase
from django.utils import six
-from django.utils.unittest import skipUnless
-
if HAS_SPATIALREFSYS:
from django.contrib.gis import forms
from django.contrib.gis.geos import GEOSGeometry
+
@skipUnless(HAS_GDAL and HAS_SPATIALREFSYS, "GeometryFieldTest needs gdal support and a spatial database")
class GeometryFieldTest(SimpleTestCase):
@@ -143,7 +144,7 @@ def assertMapWidget(self, form_instance):
def assertTextarea(self, geom, rendered):
"""Makes sure the wkt and a textarea are in the content"""
-
+
self.assertIn('<textarea ', rendered)
self.assertIn('required', rendered)
self.assertIn(geom.wkt, rendered)
3  django/contrib/gis/tests/test_measure.py
View
@@ -3,8 +3,9 @@
and conversions. Here are some tests.
"""
+import unittest
+
from django.contrib.gis.measure import Distance, Area, D, A
-from django.utils import unittest
class DistanceTest(unittest.TestCase):
3  django/contrib/gis/tests/test_spatialrefsys.py
View
@@ -1,8 +1,9 @@
+import unittest
+
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.tests.utils import (no_mysql, oracle, postgis,
spatialite, HAS_SPATIALREFSYS, SpatialRefSys)
from django.utils import six
-from django.utils import unittest
test_srs = ({'srid' : 4326,
2  django/contrib/humanize/tests.py
View
@@ -1,6 +1,7 @@
from __future__ import unicode_literals
import datetime
from decimal import Decimal
+from unittest import skipIf
try:
import pytz
@@ -17,7 +18,6 @@
from django.utils import translation
from django.utils.translation import ugettext as _
from django.utils import tzinfo
-from django.utils.unittest import skipIf
from i18n import TransRealMixin
3  django/contrib/messages/tests/base.py
View
@@ -1,3 +1,5 @@
+from unittest import skipIf
+
from django import http
from django.conf import settings, global_settings
from django.contrib.messages import constants, utils, get_level, set_level
@@ -7,7 +9,6 @@
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from django.utils.translation import ugettext_lazy
-from django.utils.unittest import skipIf
def skipUnlessAuthIsInstalled(func):
3  django/contrib/messages/tests/test_middleware.py
View
@@ -1,6 +1,7 @@
+import unittest
+
from django import http
from django.contrib.messages.middleware import MessageMiddleware
-from django.utils import unittest
class MiddlewareTest(unittest.TestCase):
2  django/contrib/sessions/tests.py
View
@@ -4,6 +4,7 @@
import shutil
import string
import tempfile
+import unittest
import warnings
from django.conf import settings
@@ -22,7 +23,6 @@
from django.test.utils import override_settings, patch_logger
from django.utils import six
from django.utils import timezone
-from django.utils import unittest
from django.contrib.sessions.exceptions import InvalidSessionKey
3  django/contrib/sitemaps/tests/test_flatpages.py
View
@@ -1,7 +1,8 @@
from __future__ import unicode_literals
+from unittest import skipUnless
+
from django.conf import settings
-from django.utils.unittest import skipUnless
from .base import SitemapTestsBase
2  django/contrib/sitemaps/tests/test_http.py
View
@@ -2,13 +2,13 @@
import os
from datetime import date
+from unittest import skipUnless
from django.conf import settings
from django.contrib.sitemaps import Sitemap, GenericSitemap
from django.contrib.sites.models import Site
from django.core.exceptions import ImproperlyConfigured
from django.test.utils import override_settings
-from django.utils.unittest import skipUnless
from django.utils.formats import localize
from django.utils._os import upath
from django.utils.translation import activate, deactivate
4 django/test/runner.py
View
@@ -1,12 +1,12 @@
import os
from optparse import make_option
+import unittest
+from unittest import TestSuite, defaultTestLoader
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase
from django.test.utils import setup_test_environment, teardown_test_environment
-from django.utils import unittest
-from django.utils.unittest import TestSuite, defaultTestLoader
class DiscoverRunner(object):
17 django/test/testcases.py
View
@@ -8,13 +8,16 @@
import os
import re
import sys
+import select
+import socket
+import threading
+import unittest
+from unittest import skipIf # Imported here for backward compatibility
+from unittest.util import safe_repr
try:
from urllib.parse import urlsplit, urlunsplit
except ImportError: # Python 2
from urlparse import urlsplit, urlunsplit
-import select
-import socket
-import threading
from django.conf import settings
from django.contrib.staticfiles.handlers import StaticFilesHandler
@@ -36,10 +39,8 @@
from django.test.signals import template_rendered
from django.test.utils import (CaptureQueriesContext, ContextList,
override_settings, compare_xml)
-from django.utils import six, unittest as ut2
+from django.utils import six
from django.utils.encoding import force_text
-from django.utils.unittest import skipIf # Imported here for backward compatibility
-from django.utils.unittest.util import safe_repr
from django.views.static import serve
@@ -155,7 +156,7 @@ def message(self):
return '%s was rendered.' % self.template_name
-class SimpleTestCase(ut2.TestCase):
+class SimpleTestCase(unittest.TestCase):
# The class we'll use for the test client self.client.
# Can be overridden in derived classes.
@@ -886,7 +887,7 @@ def decorator(test_func):
@wraps(test_func)
def skip_wrapper(*args, **kwargs):
if condition():
- raise ut2.SkipTest(reason)
+ raise unittest.SkipTest(reason)
return test_func(*args, **kwargs)
test_item = skip_wrapper
else:
2  docs/topics/testing/advanced.txt
View
@@ -37,7 +37,7 @@ Example
The following is a simple unit test using the request factory::
- from django.utils import unittest
+ import unittest
from django.test.client import RequestFactory
class SimpleTest(unittest.TestCase):
4 docs/topics/testing/overview.txt
View
@@ -800,7 +800,7 @@ Example
The following is a simple unit test using the test client::
- from django.utils import unittest
+ import unittest
from django.test.client import Client
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::
- from django.utils import unittest
+ import unittest
from django.test.client import Client
class SimpleTest(unittest.TestCase):
4 tests/admin_scripts/tests.py
View
@@ -6,13 +6,14 @@
"""
from __future__ import unicode_literals
+import codecs
import os
import re
import shutil
import socket
import subprocess
import sys
-import codecs
+import unittest
import django
from django import conf, get_version
@@ -20,7 +21,6 @@
from django.core.management import BaseCommand, CommandError
from django.db import connection
from django.test.runner import DiscoverRunner
-from django.utils import unittest
from django.utils.encoding import force_text
from django.utils._os import upath
from django.utils.six import StringIO
2  tests/admin_widgets/tests.py
View
@@ -2,6 +2,7 @@
from __future__ import absolute_import, unicode_literals
from datetime import datetime
+from unittest import TestCase
from django import forms
from django.conf import settings
@@ -16,7 +17,6 @@
from django.utils import six
from django.utils import translation
from django.utils.html import conditional_escape
-from django.utils.unittest import TestCase
from . import models
from .widgetadmin import site as widget_admin_site
1  tests/aggregation_regress/tests.py
View
@@ -10,7 +10,6 @@
from django.db.models import Count, Max, Avg, Sum, StdDev, Variance, F, Q
from django.test import TestCase, Approximate, skipUnlessDBFeature
from django.utils import six
-from django.utils.unittest import expectedFailure
from .models import (Author, Book, Publisher, Clues, Entries, HardbackBook,
ItemTag, WithManualPK)
3  tests/app_loading/tests.py
View
@@ -4,11 +4,12 @@
import os
import sys
import time
+from unittest import TestCase
from django.conf import Settings
from django.db.models.loading import cache, load_app, get_model, get_models
from django.utils._os import upath
-from django.utils.unittest import TestCase
+
class EggLoadingTest(TestCase):
2  tests/bash_completion/tests.py
View
@@ -3,10 +3,10 @@
"""
import os
import sys
+import unittest
from django.conf import settings
from django.core.management import ManagementUtility
-from django.utils import unittest
from django.utils.six import StringIO
2  tests/bug639/tests.py
View
@@ -8,9 +8,9 @@
import os
import shutil
+import unittest
from django.core.files.uploadedfile import SimpleUploadedFile
-from django.utils import unittest
from django.utils._os import upath
from .models import Photo, PhotoForm, temp_storage_dir
3  tests/bug8245/tests.py
View
@@ -1,5 +1,6 @@
+from unittest import TestCase
+
from django.contrib import admin
-from django.utils.unittest import TestCase
class Bug8245Test(TestCase):
2  tests/builtin_server/tests.py
View
@@ -1,9 +1,9 @@
from __future__ import unicode_literals
from io import BytesIO
+from unittest import TestCase
from django.core.servers.basehttp import ServerHandler, MAX_SOCKET_CHUNK_SIZE
-from django.utils.unittest import TestCase
class DummyHandler(object):
2  tests/db_typecasts/tests.py
View
@@ -1,10 +1,10 @@
# Unit tests for typecast functions in django.db.backends.util
import datetime
+import unittest
from django.db.backends import util as typecasts
from django.utils import six
-from django.utils import unittest
TEST_CASES = {
2  tests/decorators/tests.py
View
@@ -1,4 +1,5 @@
from functools import wraps
+from unittest import TestCase
from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.auth.decorators import login_required, permission_required, user_passes_test
@@ -6,7 +7,6 @@
from django.middleware.clickjacking import XFrameOptionsMiddleware
from django.utils.decorators import method_decorator
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.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
3  tests/defaultfilters/tests.py
View
@@ -3,11 +3,12 @@
import datetime
import decimal
+import unittest
from django.template.defaultfilters import *
from django.test import TestCase
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.encoding import python_2_unicode_compatible
2  tests/dispatch/tests/test_dispatcher.py
View
@@ -1,9 +1,9 @@
import gc
import sys
import time
+import unittest
from django.dispatch import Signal, receiver
-from django.utils import unittest
if sys.platform.startswith('java'):
3  tests/dispatch/tests/test_saferef.py
View
@@ -1,6 +1,7 @@
+import unittest
+
from django.dispatch.saferef import safeRef
from django.utils.six.moves import xrange
-from django.utils import unittest
class Test1(object):
def x(self):
2  tests/file_storage/tests.py
View
@@ -7,6 +7,7 @@
import sys
import tempfile
import time
+import unittest
try:
from urllib.request import urlopen
except ImportError: # Python 2
@@ -28,7 +29,6 @@
from django.core.files.uploadedfile import UploadedFile
from django.test import LiveServerTestCase, SimpleTestCase
from django.utils import six
-from django.utils import unittest
from django.utils._os import upath
from django.test.utils import override_settings
2  tests/file_uploads/tests.py
View
@@ -8,6 +8,7 @@
import os
import shutil
import tempfile as sys_tempfile
+import unittest
from django.core.files import temp as tempfile
from django.core.files.uploadedfile import SimpleUploadedFile
@@ -16,7 +17,6 @@
from django.test.utils import override_settings
from django.utils.encoding import force_bytes
from django.utils.six import StringIO
-from django.utils import unittest
from . import uploadhandler
from .models import FileModel
2  tests/files/tests.py
View
@@ -4,6 +4,7 @@
import gzip
import shutil
import tempfile
+import unittest
from django.core.cache import cache
from django.core.files import File
@@ -11,7 +12,6 @@
from django.core.files.base import ContentFile
from django.core.files.uploadedfile import SimpleUploadedFile
from django.test import TestCase
-from django.utils import unittest
from django.utils.six import StringIO
from .models import Storage, temp_storage, temp_storage_location
3  tests/forms_tests/tests/test_validators.py
View
@@ -1,9 +1,10 @@
from __future__ import unicode_literals
+from unittest import TestCase
+
from django import forms
from django.core import validators
from django.core.exceptions import ValidationError
-from django.utils.unittest import TestCase
class UserForm(forms.Form):
2  tests/generic_views/test_base.py
View
@@ -1,11 +1,11 @@
from __future__ import absolute_import
import time
+import unittest
from django.core.exceptions import ImproperlyConfigured
from django.http import HttpResponse
from django.test import TestCase, RequestFactory
-from django.utils import unittest
from django.views.generic import View, TemplateView, RedirectView
from . import views
2  tests/generic_views/test_dates.py
View
@@ -2,12 +2,12 @@
import time
import datetime
+from unittest import skipUnless
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase, skipUnlessDBFeature
from django.test.utils import override_settings
from django.utils import timezone
-from django.utils.unittest import skipUnless
from .models import Book, BookSigning
2  tests/generic_views/test_edit.py
View
@@ -1,12 +1,12 @@
from __future__ import absolute_import
import warnings
+from unittest import expectedFailure
from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import reverse
from django import forms
from django.test import TestCase
-from django.utils.unittest import expectedFailure
from django.test.client import RequestFactory
from django.views.generic.base import View
from django.views.generic.edit import FormMixin, CreateView
2  tests/httpwrappers/tests.py
View
@@ -4,6 +4,7 @@
import copy
import os
import pickle
+import unittest
import warnings
from django.core.exceptions import SuspiciousOperation
@@ -18,7 +19,6 @@
from django.utils.encoding import smart_str
from django.utils._os import upath
from django.utils import six
-from django.utils import unittest
class QueryDictTests(unittest.TestCase):
3  tests/indexes/tests.py
View
@@ -1,7 +1,8 @@
+from unittest import skipUnless
+
from django.core.management.color import no_style
from django.db import connections, DEFAULT_DB_ALIAS
from django.test import TestCase
-from django.utils.unittest import skipUnless
from .models import Article
2  tests/inspectdb/tests.py
View
@@ -2,11 +2,11 @@
from __future__ import unicode_literals
import re
+from unittest import expectedFailure
from django.core.management import call_command
from django.db import connection
from django.test import TestCase, skipUnlessDBFeature
-from django.utils.unittest import expectedFailure
from django.utils.six import PY3, StringIO
if connection.vendor == 'oracle':
3  tests/introspection/tests.py
View
@@ -1,8 +1,9 @@
from __future__ import absolute_import, unicode_literals
+import unittest
+
from django.db import connection
from django.test import TestCase, skipUnlessDBFeature, skipIfDBFeature
-from django.utils import unittest
from .models import Reporter, Article
3  tests/invalid_models/tests.py
View
@@ -1,11 +1,10 @@
import copy
import sys
+import unittest
from django.core.management.validation import get_validation_errors
from django.db.models.loading import cache, load_app
-
from django.test.utils import override_settings
-from django.utils import unittest
from django.utils.six import StringIO
2  tests/logging_tests/tests.py
View
@@ -3,6 +3,7 @@
import copy
import logging
import sys
+from unittest import skipUnless
import warnings
from django.conf import LazySettings
@@ -13,7 +14,6 @@
from django.utils.log import (CallbackFilter, RequireDebugFalse,
RequireDebugTrue)
from django.utils.six import StringIO
-from django.utils.unittest import skipUnless
from admin_scripts.tests import AdminScriptTestCase
4 tests/max_lengths/tests.py
View
@@ -1,6 +1,6 @@
from __future__ import absolute_import
-from django.utils import unittest
+import unittest
from .models import PersonWithDefaultMaxLengths, PersonWithCustomMaxLengths
@@ -36,4 +36,4 @@ def test_custom_max_lengths(self):
new_args = args.copy()
new_args[field] = "X" * 250 # a value longer than any of the default fields could hold.
p = PersonWithCustomMaxLengths.objects.create(**new_args)
- self.assertEqual(getattr(p, field), ("X" * 250))
+ self.assertEqual(getattr(p, field), ("X" * 250))
2  tests/middleware/tests.py
View
@@ -5,6 +5,7 @@
from io import BytesIO
import random
import re
+from unittest import expectedFailure, skipIf
import warnings
from django.conf import settings
@@ -22,7 +23,6 @@
from django.utils import six
from django.utils.encoding import force_str
from django.utils.six.moves import xrange
-from django.utils.unittest import expectedFailure, skipIf
from .models import Band
2  tests/model_fields/test_imagefield.py
View
@@ -2,13 +2,13 @@
import os
import shutil
+from unittest import skipIf
from django.core.exceptions import ImproperlyConfigured
from django.core.files import File
from django.core.files.images import ImageFile
from django.test import TestCase
from django.utils._os import upath
-from django.utils.unittest import skipIf
try:
from .models import Image
2  tests/model_fields/tests.py
View
@@ -2,6 +2,7 @@
import datetime
from decimal import Decimal
+import unittest
from django import test
from django import forms
@@ -9,7 +10,6 @@
from django.db import connection, models, IntegrityError
from django.db.models.fields.files import FieldFile
from django.utils import six
-from django.utils import unittest
from .models import (Foo, Bar, Whiz, BigD, BigS, Image, BigInt, Post,
NullBooleanModel, BooleanModel, DataModel, Document, RenamedField,
2  tests/model_forms/tests.py
View
@@ -3,6 +3,7 @@
import datetime
import os
from decimal import Decimal
+from unittest import skipUnless
import warnings
from django import forms
@@ -13,7 +14,6 @@
from django.db.models.query import EmptyQuerySet
from django.forms.models import model_to_dict
from django.utils._os import upath
-from django.utils.unittest import skipUnless
from django.test import TestCase
from django.utils import six
2  tests/model_forms_regress/tests.py
View
@@ -1,6 +1,7 @@
from __future__ import absolute_import, unicode_literals
from datetime import date
+import unittest
import warnings
from django import forms
@@ -9,7 +10,6 @@
from django.forms.models import (modelform_factory, ModelChoiceField,
fields_for_model, construct_instance, ModelFormMetaclass)
from django.utils import six
-from django.utils import unittest
from django.test import TestCase
from .models import (Person, RealPerson, Triple, FilePathModel, Article,
4 tests/model_inheritance_regress/tests.py
View
@@ -5,10 +5,10 @@
import datetime
from operator import attrgetter
-from django import forms
+from unittest import expectedFailure
+from django import forms
from django.test import TestCase
-from django.utils.unittest import expectedFailure
from .models import (Place, Restaurant, ItalianRestaurant, ParkingLot,
ParkingLot2, ParkingLot3, Supplier, Wholesaler, Child, SelfRefParent,
2  tests/model_regress/tests.py
View
@@ -3,12 +3,12 @@
import datetime
from operator import attrgetter
import sys
+import unittest
from django.core.exceptions import ValidationError
from django.test import TestCase, skipUnlessDBFeature
from django.utils import six
from django.utils import tzinfo
-from django.utils import unittest
from django.db import connection, router
from django.db.models.sql import InsertQuery
3  tests/modeladmin/tests.py
View
@@ -1,6 +1,7 @@
from __future__ import absolute_import, unicode_literals
from datetime import date
+import unittest
from django import forms
from django.conf import settings
@@ -15,7 +16,7 @@
from django.forms.widgets import Select
from django.test import TestCase
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
2  tests/pagination/tests.py
View
@@ -1,12 +1,12 @@
from __future__ import absolute_import, unicode_literals
from datetime import datetime
+import unittest
from django.core.paginator import (Paginator, EmptyPage, InvalidPage,
PageNotAnInteger)
from django.test import TestCase
from django.utils import six
-from django.utils import unittest
from .models import Article
from .custom import ValidAdjacentNumsPaginator
2  tests/queries/tests.py
View
@@ -4,6 +4,7 @@
from operator import attrgetter
import pickle
import sys
+import unittest
from django.conf import settings
from django.core.exceptions import FieldError
@@ -13,7 +14,6 @@
from django.db.models.sql.datastructures import EmptyResultSet
from django.test import TestCase, skipUnlessDBFeature
from django.test.utils import str_prefix
-from django.utils import unittest
from django.utils.datastructures import SortedDict
from .models import (
6 tests/requests/tests.py
View
@@ -1,10 +1,11 @@
# -*- encoding: utf-8 -*-
from __future__ import unicode_literals
-import time
-import warnings
from datetime import datetime, timedelta
from io import BytesIO
+import time
+from unittest import skipIf
+import warnings
from django.db import connection, connections, DEFAULT_DB_ALIAS
from django.core import signals
@@ -15,7 +16,6 @@
from django.test.client import FakePayload
from django.test.utils import override_settings, str_prefix
from django.utils import six
-from django.utils.unittest import skipIf
from django.utils.http import cookie_date, urlencode
from django.utils.timezone import utc
3  tests/resolve_url/tests.py
View
@@ -1,8 +1,9 @@
from __future__ import unicode_literals
+from unittest import TestCase
+
from django.core.urlresolvers import NoReverseMatch
from django.contrib.auth.views import logout
-from django.utils.unittest import TestCase
from django.shortcuts import resolve_url
from .models import UnimportantThing
2  tests/select_for_update/tests.py
View
@@ -2,13 +2,13 @@
import sys
import time
+import unittest
from django.conf import settings
from django.db import transaction, connection
from django.db.utils import ConnectionHandler, DEFAULT_DB_ALIAS, DatabaseError
from django.test import (TransactionTestCase, skipIfDBFeature,
skipUnlessDBFeature)
-from django.utils import unittest
from .models import Person
3  tests/select_related_onetoone/tests.py
View
@@ -1,7 +1,8 @@
from __future__ import absolute_import
+import unittest
+
from django.test import TestCase
-from django.utils import unittest
from .models import (User, UserProfile, UserStat, UserStatResult, StatDetails,
AdvancedUserStat, Image, Product, Parent1, Parent2, Child1, Child2, Child3,
2  tests/serializers/tests.py
View
@@ -3,6 +3,7 @@
# -*- coding: utf-8 -*-
import json
from datetime import datetime
+import unittest
from xml.dom import minidom
from django.conf import settings
@@ -11,7 +12,6 @@
from django.test import TestCase, TransactionTestCase, Approximate
from django.utils import six
from django.utils.six import StringIO
-from django.utils import unittest
from .models import (Category, Author, Article, AuthorProfile, Actor, Movie,
Score, Player, Team)
4 tests/serializers_regress/tests.py
View
@@ -10,7 +10,7 @@
import datetime
import decimal
-from django.core.serializers.xml_serializer import DTDForbidden
+from unittest import expectedFailure, skipUnless
try:
import yaml
@@ -20,13 +20,13 @@
from django.core import serializers
from django.core.serializers import SerializerDoesNotExist
from django.core.serializers.base import DeserializationError
+from django.core.serializers.xml_serializer import DTDForbidden
from django.db import connection, models
from django.http import HttpResponse
from django.test import TestCase
from django.utils import six
from django.utils.encoding import force_text
from django.utils.functional import curry
-from django.utils.unittest import expectedFailure, skipUnless
from .models import (BinaryData, BooleanData, CharData, DateData, DateTimeData, EmailData,
FileData, FilePathData, DecimalData, FloatData, IntegerData, IPAddressData,
3  tests/settings_tests/tests.py
View
@@ -1,4 +1,5 @@
import os
+import unittest
import warnings
from django.conf import settings, global_settings
@@ -6,7 +7,7 @@
from django.http import HttpRequest
from django.test import SimpleTestCase, TransactionTestCase, TestCase, signals
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')
2  tests/str/tests.py
View
@@ -2,10 +2,10 @@
from __future__ import absolute_import, unicode_literals
import datetime
+from unittest import skipIf
from django.test import TestCase
from django.utils import six
-from django.utils.unittest import skipIf
from .models import Article, BrokenArticle, InternationalArticle
7 tests/template_tests/loaders.py
View
@@ -9,15 +9,16 @@
if __name__ == '__main__':
settings.configure()
-import sys
-import pkg_resources
import imp
import os.path
+import pkg_resources
+import sys
+import unittest
from django.template import TemplateDoesNotExist, Context
from django.template.loaders.eggs import Loader as EggLoader
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.six import StringIO
3  tests/template_tests/test_callables.py
View
@@ -1,7 +1,8 @@
from __future__ import unicode_literals
+from unittest import TestCase
+
from django import template
-from django.utils.unittest import TestCase
class CallableVariablesTests(TestCase):
4 tests/template_tests/test_context.py
View
@@ -1,6 +1,8 @@
# coding: utf-8
+
+from unittest import TestCase
+
from django.template import Context
-from django.utils.unittest import TestCase
class ContextTests(TestCase):
3  tests/template_tests/test_custom.py
View
@@ -1,8 +1,9 @@
from __future__ import absolute_import, unicode_literals
+from unittest import TestCase
+
from django import template
from django.utils import six
-from django.utils.unittest import TestCase
from .templatetags import custom
3  tests/template_tests/test_nodelist.py
View
@@ -1,6 +1,7 @@
+from unittest import TestCase
+
from django.template import VariableNode, Context
from django.template.loader import get_template_from_string
-from django.utils.unittest import TestCase
from django.test.utils import override_settings
class NodelistTest(TestCase):
3  tests/template_tests/test_parser.py
View
@@ -3,10 +3,11 @@
"""
from __future__ import unicode_literals
+from unittest import TestCase
+
from django.template import (TokenParser, FilterExpression, Parser, Variable,
Template, TemplateSyntaxError)
from django.test.utils import override_settings
-from django.utils.unittest import TestCase
from django.utils import six
3  tests/template_tests/test_smartif.py
View
@@ -1,5 +1,6 @@
+import unittest
+
from django.template.smartif import IfParser
-from django.utils import unittest
class SmartIfTests(unittest.TestCase):
3  tests/template_tests/test_unicode.py
View
@@ -1,10 +1,11 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
+from unittest import TestCase
+
from django.template import Template, TemplateEncodingError, Context
from django.utils.safestring import SafeData
from django.utils import six
-from django.utils.unittest import TestCase
class UnicodeTests(TestCase):
2  tests/template_tests/tests.py
View
@@ -13,6 +13,7 @@
import os
import sys
import traceback
+import unittest
try:
from urllib.parse import urljoin
except ImportError: # Python 2
@@ -27,7 +28,6 @@
from django.test import RequestFactory, TestCase
from django.test.utils import (setup_test_template_loader,
restore_template_loaders, override_settings)
-from django.utils import unittest
from django.utils.encoding import python_2_unicode_compatible
from django.utils.formats import date_format
from django.utils._os import upath
2  tests/test_runner/test_discover_runner.py
View
@@ -1,10 +1,10 @@
from contextlib import contextmanager
import os
import sys
+from unittest import expectedFailure
from django.test import TestCase
from django.test.runner import DiscoverRunner
-from django.utils.unittest import expectedFailure
try:
import unittest2
4 tests/test_runner/tests.py
View
@@ -3,8 +3,9 @@
"""
from __future__ import absolute_import, unicode_literals
-import sys
from optparse import make_option
+import sys
+import unittest
from django.core.exceptions import ImproperlyConfigured
from django.core.management import call_command
@@ -12,7 +13,6 @@
from django.test import runner, TestCase, TransactionTestCase, skipUnlessDBFeature
from django.test.testcases import connections_support_transactions
from django.test.utils import IgnoreDeprecationWarningsMixin
-from django.utils import unittest
from django.utils.importlib import import_module
from admin_scripts.tests import AdminScriptTestCase
3  tests/test_suite_override/tests.py
View
@@ -1,6 +1,7 @@
+import unittest
+
from django.db.models import get_app
from django.test.utils import IgnoreDeprecationWarningsMixin
-from django.utils import unittest
def suite():
5 tests/test_utils/tests.py
View
@@ -1,6 +1,9 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
+import unittest
+from unittest import skip
+
from django.db import connection
from django.forms import EmailField, IntegerField
from django.http import HttpResponse
@@ -9,8 +12,6 @@
from django.test.html import HTMLParseError, parse_html
from django.test.utils import CaptureQueriesContext, IgnoreDeprecationWarningsMixin
from django.utils import six
-from django.utils import unittest
-from django.utils.unittest import skip
from .models import Person
2  tests/timezones/tests.py
View
@@ -5,6 +5,7 @@
import re
import sys
import time
+from unittest import skipIf, skipUnless
import warnings
from xml.dom.minidom import parseString
@@ -25,7 +26,6 @@
from django.utils import six
from django.utils import timezone
from django.utils.tzinfo import FixedOffset
-from django.utils.unittest import skipIf, skipUnless
from .forms import EventForm, EventSplitForm, EventModelForm
from .models import Event, MaybeEvent, Session, SessionEvent, Timestamp, AllDayEvent
2  tests/transactions/tests.py
View
@@ -1,12 +1,12 @@
from __future__ import absolute_import
import sys
+from unittest import skipIf, skipUnless
from django.db import connection, transaction, DatabaseError, IntegrityError
from django.test import TransactionTestCase, skipUnlessDBFeature
from django.test.utils import IgnoreDeprecationWarningsMixin
from django.utils import six
-from django.utils.unittest import skipIf, skipUnless
from .models import Reporter
3  tests/transactions_regress/tests.py
View
@@ -1,11 +1,12 @@
from __future__ import absolute_import
+from unittest import skipIf, skipUnless
+
from django.db import (connection, connections, transaction, DEFAULT_DB_ALIAS, DatabaseError,
IntegrityError)
from django.db.transaction import commit_on_success, commit_manually, TransactionManagementError
from django.test import TransactionTestCase, skipUnlessDBFeature
from django.test.utils import override_settings, IgnoreDeprecationWarningsMixin
-from django.utils.unittest import skipIf, skipUnless
from .models import Mod, M2mA, M2mB, SubMod
4 tests/urlpatterns_reverse/tests.py
View
@@ -3,6 +3,8 @@
"""
from __future__ import absolute_import, unicode_literals
+import unittest
+
from django.conf import settings
from django.contrib.auth.models import User
from django.core.exceptions import ImproperlyConfigured, ViewDoesNotExist
@@ -12,7 +14,7 @@
from django.http import HttpRequest, HttpResponseRedirect, HttpResponsePermanentRedirect
from django.shortcuts import redirect
from django.test import TestCase
-from django.utils import unittest, six
+from django.utils import six
from . import urlconf_outer, middleware, views
2  tests/utils_tests/test_archive.py
View
@@ -1,7 +1,7 @@
import os
import shutil
import tempfile
-from django.utils import unittest
+import unittest
from django.utils.archive import Archive, extract
from django.utils._os import upath
3  tests/utils_tests/test_baseconv.py
View
@@ -1,4 +1,5 @@
-from django.utils.unittest import TestCase
+from unittest import TestCase
+
from django.utils.baseconv import base2, base16, base36, base56, base62, base64, BaseConverter
from django.utils.six.moves import xrange
4 tests/utils_tests/test_crypto.py
View
@@ -1,11 +1,11 @@
from __future__ import unicode_literals
import binascii
+import hashlib
import math
import timeit
-import hashlib
+import unittest
-from django.utils import unittest
from django.utils.crypto import constant_time_compare, pbkdf2
2  tests/utils_tests/test_dateparse.py
View
@@ -1,9 +1,9 @@
from __future__ import unicode_literals
from datetime import date, time, datetime
+import unittest
from django.utils.dateparse import parse_date, parse_time, parse_datetime
-from django.utils import unittest
from django.utils.tzinfo import FixedOffset
3  tests/utils_tests/test_encoding.py
View
@@ -1,7 +1,8 @@
# -*- encoding: utf-8 -*-
from __future__ import unicode_literals
-from django.utils import unittest
+import unittest
+
from django.utils.encoding import force_bytes, filepath_to_uri
3  tests/utils_tests/test_functional.py
View
@@ -1,4 +1,5 @@
-from django.utils import unittest
+import unittest
+
from django.utils.functional import lazy, lazy_property, cached_property
2  tests/utils_tests/test_html.py
View
@@ -2,11 +2,11 @@
from datetime import datetime
import os
+from unittest import TestCase
from django.utils import html
from django.utils._os import upath
from django.utils.encoding import force_text
-from django.utils.unittest import TestCase
class TestUtilsHtml(TestCase):
2  tests/utils_tests/test_http.py
View
@@ -1,12 +1,12 @@
from datetime import datetime
import sys
+import unittest
from django.http import HttpResponse, utils
from django.test import RequestFactory
from django.utils.datastructures import MultiValueDict
from django.utils import http
from django.utils import six
-from django.utils import unittest
class TestUtilsHttp(unittest.TestCase):
3  tests/utils_tests/test_ipv6.py
View
@@ -1,6 +1,7 @@
from __future__ import unicode_literals
-from django.utils import unittest
+import unittest
+
from django.utils.ipv6 import is_valid_ipv6_address, clean_ipv6_address
class TestUtilsIPv6(unittest.TestCase):
4 tests/utils_tests/test_module_loading.py
View
@@ -1,10 +1,10 @@
+import imp
import os
import sys
-import imp
+import unittest
from zipimport import zipimporter
from django.core.exceptions import ImproperlyConfigured
-from django.utils import unittest
from django.utils.importlib import import_module
from django.utils.module_loading import import_by_path, module_has_submodule
from django.utils._os import upath
2  tests/utils_tests/test_os_utils.py
View
@@ -1,6 +1,6 @@
import os
+import unittest
-from django.utils import unittest
from django.utils._os import safe_join
3  tests/utils_tests/test_regex_helper.py
View
@@ -1,7 +1,8 @@
from __future__ import unicode_literals
+import unittest
+
from django.utils import regex_helper
-from django.utils import unittest
class NormalizeTests(unittest.TestCase):
2  tests/utils_tests/test_simplelazyobject.py
View
@@ -3,9 +3,9 @@
import copy
import pickle
import sys
+from unittest import TestCase
from django.utils import six
-from django.utils.unittest import TestCase
from django.utils.functional import SimpleLazyObject, empty