Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch 'master' into schema-alteration

  • Loading branch information...
commit b1e0ec06f0d538eb2ab16a7c1ecefd1d896e6382 2 parents 7a47ba6 + 6c66a41
Andrew Godwin authored July 02, 2013

Showing 240 changed files with 694 additions and 4,096 deletions. Show diff stats Hide diff stats

  1. 3  INSTALL
  2. 19  django/bin/daily_cleanup.py
  3. 22  django/conf/__init__.py
  4. 2  django/conf/global_settings.py
  5. 2  django/conf/urls/shortcut.py
  6. 2  django/contrib/admin/options.py
  7. 2  django/contrib/admin/tests.py
  8. 3  django/contrib/admin/util.py
  9. 8  django/contrib/admin/views/main.py
  10. 3  django/contrib/admindocs/tests/test_fields.py
  11. 6  django/contrib/auth/forms.py
  12. 39  django/contrib/auth/models.py
  13. 5  django/contrib/auth/tests/test_hashers.py
  14. 39  django/contrib/auth/tests/test_models.py
  15. 4  django/contrib/auth/tests/test_tokens.py
  16. 22  django/contrib/auth/tests/test_views.py
  17. 3  django/contrib/auth/tests/utils.py
  18. 3  django/contrib/auth/urls.py
  19. 9  django/contrib/auth/views.py
  20. 2  django/contrib/comments/__init__.py
  21. 2  django/contrib/comments/templatetags/comments.py
  22. 6  django/contrib/contenttypes/generic.py
  23. 2  django/contrib/formtools/tests/tests.py
  24. 6  django/contrib/gis/forms/fields.py
  25. 5  django/contrib/gis/gdal/tests/test_driver.py
  26. 4  django/contrib/gis/gdal/tests/test_ds.py
  27. 7  django/contrib/gis/gdal/tests/test_envelope.py
  28. 4  django/contrib/gis/gdal/tests/test_geom.py
  29. 5  django/contrib/gis/gdal/tests/test_srs.py
  30. 5  django/contrib/gis/geoip/tests.py
  31. 4  django/contrib/gis/geos/tests/test_geos.py
  32. 4  django/contrib/gis/geos/tests/test_geos_mutation.py
  33. 2  django/contrib/gis/geos/tests/test_io.py
  34. 4  django/contrib/gis/geos/tests/test_mutable_list.py
  35. 3  django/contrib/gis/tests/distapp/tests.py
  36. 2  django/contrib/gis/tests/geo3d/tests.py
  37. 3  django/contrib/gis/tests/geoadmin/tests.py
  38. 2  django/contrib/gis/tests/geoapp/test_feeds.py
  39. 2  django/contrib/gis/tests/geoapp/test_regress.py
  40. 2  django/contrib/gis/tests/geoapp/test_sitemaps.py
  41. 5  django/contrib/gis/tests/geoapp/tests.py
  42. 2  django/contrib/gis/tests/geogapp/tests.py
  43. 2  django/contrib/gis/tests/inspectapp/tests.py
  44. 6  django/contrib/gis/tests/layermap/tests.py
  45. 3  django/contrib/gis/tests/relatedapp/tests.py
  46. 7  django/contrib/gis/tests/test_geoforms.py
  47. 3  django/contrib/gis/tests/test_measure.py
  48. 3  django/contrib/gis/tests/test_spatialrefsys.py
  49. 2  django/contrib/humanize/tests.py
  50. 3  django/contrib/messages/tests/base.py
  51. 3  django/contrib/messages/tests/test_middleware.py
  52. 7  django/contrib/sessions/middleware.py
  53. 2  django/contrib/sessions/tests.py
  54. 3  django/contrib/sitemaps/tests/test_flatpages.py
  55. 2  django/contrib/sitemaps/tests/test_http.py
  56. 17  django/contrib/sitemaps/views.py
  57. 1  django/core/files/storage.py
  58. 11  django/core/management/commands/cleanup.py
  59. 4  django/db/__init__.py
  60. 34  django/db/backends/__init__.py
  61. 2  django/db/backends/creation.py
  62. 2  django/db/backends/mysql/base.py
  63. 10  django/db/backends/sqlite3/base.py
  64. 2  django/db/models/fields/files.py
  65. 13  django/db/models/fields/related.py
  66. 4  django/db/models/manager.py
  67. 8  django/db/models/options.py
  68. 9  django/db/models/query.py
  69. 26  django/db/transaction.py
  70. 9  django/db/utils.py
  71. 2  django/forms/forms.py
  72. 6  django/forms/models.py
  73. 2  django/forms/widgets.py
  74. 8  django/http/__init__.py
  75. 68  django/http/response.py
  76. 2  django/middleware/cache.py
  77. 2  django/middleware/common.py
  78. 2  django/middleware/doc.py
  79. 2  django/middleware/transaction.py
  80. 8  django/shortcuts/__init__.py
  81. 4  django/template/defaulttags.py
  82. 10  django/template/response.py
  83. 2  django/test/_doctest.py
  84. 4  django/test/runner.py
  85. 4  django/test/simple.py
  86. 37  django/test/testcases.py
  87. 37  django/test/utils.py
  88. 26  django/utils/datastructures.py
  89. 5  django/utils/dictconfig.py
  90. 24  django/utils/encoding.py
  91. 2  django/utils/image.py
  92. 7  django/utils/itercompat.py
  93. 21  django/utils/log.py
  94. 31  django/utils/simplejson.py
  95. 11  django/utils/unittest.py
  96. 80  django/utils/unittest/__init__.py
  97. 10  django/utils/unittest/__main__.py
  98. 1,076  django/utils/unittest/case.py
  99. 9  django/utils/unittest/collector.py
  100. 64  django/utils/unittest/compatibility.py
  101. 322  django/utils/unittest/loader.py
  102. 241  django/utils/unittest/main.py
  103. 183  django/utils/unittest/result.py
  104. 206  django/utils/unittest/runner.py
  105. 57  django/utils/unittest/signals.py
  106. 287  django/utils/unittest/suite.py
  107. 99  django/utils/unittest/util.py
  108. 2  django/views/defaults.py
  109. 2  django/views/generic/edit.py
  110. 8  django/views/static.py
  111. 53  docs/faq/install.txt
  112. 12  docs/internals/deprecation.txt
  113. 11  docs/intro/install.txt
  114. 14  docs/ref/contrib/auth.txt
  115. 6  docs/ref/contrib/contenttypes.txt
  116. 12  docs/ref/django-admin.txt
  117. 16  docs/ref/models/querysets.txt
  118. 26  docs/ref/request-response.txt
  119. 22  docs/ref/settings.txt
  120. 6  docs/ref/template-response.txt
  121. 27  docs/ref/utils.txt
  122. 10  docs/releases/1.5-alpha-1.txt
  123. 12  docs/releases/1.5-beta-1.txt
  124. 12  docs/releases/1.5.txt
  125. 6  docs/releases/1.6.txt
  126. 47  docs/releases/1.7.txt
  127. 34  docs/topics/auth/customizing.txt
  128. 25  docs/topics/class-based-views/mixins.txt
  129. 6  docs/topics/install.txt
  130. 11  docs/topics/logging.txt
  131. 250  docs/topics/testing/_images/django_unittest_classes_hierarchy.graffle
  132. BIN  docs/topics/testing/_images/django_unittest_classes_hierarchy.pdf
  133. 2  docs/topics/testing/_images/django_unittest_classes_hierarchy.svg
  134. 2  docs/topics/testing/advanced.txt
  135. 37  docs/topics/testing/overview.txt
  136. 2  setup.cfg
  137. 1  setup.py
  138. 2  tests/.coveragerc
  139. 6  tests/admin_scripts/app_with_import/models.py
  140. 5  tests/admin_scripts/tests.py
  141. 19  tests/admin_views/tests.py
  142. 2  tests/admin_widgets/tests.py
  143. 1  tests/aggregation_regress/tests.py
  144. 3  tests/app_loading/tests.py
  145. 18  tests/backends/tests.py
  146. 2  tests/bash_completion/tests.py
  147. 2  tests/bug639/tests.py
  148. 3  tests/bug8245/tests.py
  149. 2  tests/builtin_server/tests.py
  150. 11  tests/cache/tests.py
  151. 2  tests/db_typecasts/tests.py
  152. 2  tests/decorators/tests.py
  153. 3  tests/defaultfilters/tests.py
  154. 2  tests/deprecation/tests.py
  155. 2  tests/dispatch/tests/test_dispatcher.py
  156. 3  tests/dispatch/tests/test_saferef.py
  157. 10  tests/file_storage/tests.py
  158. 2  tests/file_uploads/tests.py
  159. 2  tests/files/tests.py
  160. 56  tests/fixtures/tests.py
  161. 7  tests/fixtures_model_package/tests.py
  162. 32  tests/fixtures_regress/tests.py
  163. 3  tests/forms_tests/tests/test_validators.py
  164. 2  tests/generic_views/test_base.py
  165. 2  tests/generic_views/test_dates.py
  166. 8  tests/generic_views/test_edit.py
  167. 27  tests/httpwrappers/tests.py
  168. 3  tests/indexes/tests.py
  169. 2  tests/inspectdb/tests.py
  170. 3  tests/introspection/tests.py
  171. 3  tests/invalid_models/tests.py
  172. 2  tests/logging_tests/tests.py
  173. 4  tests/max_lengths/tests.py
  174. 12  tests/middleware/tests.py
  175. 2  tests/model_fields/test_imagefield.py
  176. 13  tests/model_fields/tests.py
  177. 8  tests/model_forms/tests.py
  178. 6  tests/model_forms_regress/tests.py
  179. 2  tests/model_formsets/tests.py
  180. 4  tests/model_inheritance_regress/tests.py
  181. 2  tests/model_regress/tests.py
  182. 3  tests/modeladmin/tests.py
  183. 21  tests/multiple_database/tests.py
  184. 2  tests/pagination/tests.py
  185. 2  tests/proxy_models/tests.py
  186. 2  tests/queries/tests.py
  187. 6  tests/requests/tests.py
  188. 3  tests/resolve_url/tests.py
  189. 2  tests/runtests.py
  190. 2  tests/select_for_update/tests.py
  191. 58  tests/select_related/tests.py
  192. 3  tests/select_related_onetoone/tests.py
  193. 2  tests/serializers/tests.py
  194. 4  tests/serializers_regress/tests.py
  195. 3  tests/settings_tests/tests.py
  196. 2  tests/str/tests.py
  197. 7  tests/template_tests/loaders.py
  198. 3  tests/template_tests/test_callables.py
  199. 4  tests/template_tests/test_context.py
  200. 3  tests/template_tests/test_custom.py
  201. 3  tests/template_tests/test_nodelist.py
  202. 3  tests/template_tests/test_parser.py
  203. 3  tests/template_tests/test_smartif.py
  204. 3  tests/template_tests/test_unicode.py
  205. 4  tests/template_tests/tests.py
  206. 11  tests/test_discovery_sample/tests_sample.py
  207. 35  tests/test_runner/test_discover_runner.py
  208. 9  tests/test_runner/tests.py
  209. 8  tests/test_suite_override/tests.py
  210. 41  tests/test_utils/tests.py
  211. 2  tests/timezones/tests.py
  212. 10  tests/transactions/tests.py
  213. 15  tests/transactions_regress/tests.py
  214. 4  tests/urlpatterns_reverse/tests.py
  215. 2  tests/utils_tests/test_archive.py
  216. 3  tests/utils_tests/test_baseconv.py
  217. 4  tests/utils_tests/test_crypto.py
  218. 15  tests/utils_tests/test_datastructures.py
  219. 4  tests/utils_tests/test_dateformat.py
  220. 2  tests/utils_tests/test_dateparse.py
  221. 3  tests/utils_tests/test_encoding.py
  222. 5  tests/utils_tests/test_feedgenerator.py
  223. 3  tests/utils_tests/test_functional.py
  224. 2  tests/utils_tests/test_html.py
  225. 2  tests/utils_tests/test_http.py
  226. 3  tests/utils_tests/test_ipv6.py
  227. 4  tests/utils_tests/test_module_loading.py
  228. 2  tests/utils_tests/test_os_utils.py
  229. 3  tests/utils_tests/test_regex_helper.py
  230. 2  tests/utils_tests/test_simplelazyobject.py
  231. 3  tests/utils_tests/test_termcolors.py
  232. 3  tests/utils_tests/test_timezone.py
  233. 3  tests/utils_tests/test_tzinfo.py
  234. 3  tests/validation/test_error_messages.py
  235. 2  tests/validation/test_unique.py
  236. 4  tests/validators/tests.py
  237. 2  tests/version/tests.py
  238. 2  tests/view_tests/tests/test_debug.py
  239. 3  tests/view_tests/tests/test_i18n.py
  240. 4  tests/wsgi/tests.py
3  INSTALL
... ...
@@ -1,6 +1,6 @@
1 1
 Thanks for downloading Django.
2 2
 
3  
-To install it, make sure you have Python 2.6 or greater installed. Then run
  3
+To install it, make sure you have Python 2.7 or greater installed. Then run
4 4
 this command from the command prompt:
5 5
 
6 6
     python setup.py install
@@ -12,7 +12,6 @@ site-packages directory, which is located wherever your Python installation
12 12
 lives. Some places you might check are:
13 13
 
14 14
     /usr/lib/python2.7/site-packages (Unix, Python 2.7)
15  
-    /usr/lib/python2.6/site-packages (Unix, Python 2.6)
16 15
     C:\\PYTHON\site-packages         (Windows)
17 16
 
18 17
 For more detailed instructions, see docs/intro/install.txt.
19  django/bin/daily_cleanup.py
... ...
@@ -1,19 +0,0 @@
1  
-#!/usr/bin/env python
2  
-
3  
-"""
4  
-Daily cleanup job.
5  
-
6  
-Can be run as a cronjob to clean out old data from the database (only expired
7  
-sessions at the moment).
8  
-"""
9  
-
10  
-import warnings
11  
-
12  
-from django.core import management
13  
-
14  
-if __name__ == "__main__":
15  
-    warnings.warn(
16  
-        "The `daily_cleanup` script has been deprecated "
17  
-        "in favor of `django-admin.py clearsessions`.",
18  
-        DeprecationWarning)
19  
-    management.call_command('clearsessions')
22  django/conf/__init__.py
@@ -59,14 +59,10 @@ def _configure_logging(self):
59 59
         Setup logging from LOGGING_CONFIG and LOGGING settings.
60 60
         """
61 61
         if not sys.warnoptions:
62  
-            try:
63  
-                # Route warnings through python logging
64  
-                logging.captureWarnings(True)
65  
-                # Allow DeprecationWarnings through the warnings filters
66  
-                warnings.simplefilter("default", DeprecationWarning)
67  
-            except AttributeError:
68  
-                # No captureWarnings on Python 2.6, DeprecationWarnings are on anyway
69  
-                pass
  62
+            # Route warnings through python logging
  63
+            logging.captureWarnings(True)
  64
+            # Allow DeprecationWarnings through the warnings filters
  65
+            warnings.simplefilter("default", DeprecationWarning)
70 66
 
71 67
         if self.LOGGING_CONFIG:
72 68
             from django.utils.log import DEFAULT_LOGGING
@@ -132,19 +128,17 @@ def __init__(self, settings_module):
132 128
                 % (self.SETTINGS_MODULE, e)
133 129
             )
134 130
 
135  
-        # Settings that should be converted into tuples if they're mistakenly entered
136  
-        # as strings.
137 131
         tuple_settings = ("INSTALLED_APPS", "TEMPLATE_DIRS")
138 132
 
139 133
         for setting in dir(mod):
140 134
             if setting == setting.upper():
141 135
                 setting_value = getattr(mod, setting)
  136
+
142 137
                 if setting in tuple_settings and \
143 138
                         isinstance(setting_value, six.string_types):
144  
-                    warnings.warn("The %s setting must be a tuple. Please fix your "
145  
-                                  "settings, as auto-correction is now deprecated." % setting,
146  
-                                  DeprecationWarning, stacklevel=2)
147  
-                    setting_value = (setting_value,) # In case the user forgot the comma.
  139
+                    raise ImproperlyConfigured("The %s setting must be a tuple. "
  140
+                            "Please fix your settings." % setting)
  141
+
148 142
                 setattr(self, setting, setting_value)
149 143
 
150 144
         if not self.SECRET_KEY:
2  django/conf/global_settings.py
@@ -562,7 +562,7 @@
562 562
 ###########
563 563
 
564 564
 # The callable to use to configure logging
565  
-LOGGING_CONFIG = 'django.utils.log.dictConfig'
  565
+LOGGING_CONFIG = 'logging.config.dictConfig'
566 566
 
567 567
 # Custom logging configuration.
568 568
 LOGGING = {}
2  django/conf/urls/shortcut.py
@@ -3,7 +3,7 @@
3 3
 from django.conf.urls import patterns
4 4
 
5 5
 warnings.warn("django.conf.urls.shortcut will be removed in Django 1.8.",
6  
-    PendingDeprecationWarning)
  6
+    DeprecationWarning)
7 7
 
8 8
 urlpatterns = patterns('django.views',
9 9
     (r'^(?P<content_type_id>\d+)/(?P<object_id>.*)/$', 'defaults.shortcut'),
2  django/contrib/admin/options.py
@@ -76,7 +76,7 @@ class IncorrectLookupParameters(Exception):
76 76
 
77 77
 class RenameBaseModelAdminMethods(forms.MediaDefiningClass, RenameMethodsBase):
78 78
     renamed_methods = (
79  
-        ('queryset', 'get_queryset', PendingDeprecationWarning),
  79
+        ('queryset', 'get_queryset', DeprecationWarning),
80 80
     )
81 81
 
82 82
 
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/admin/util.py
@@ -3,6 +3,7 @@
3 3
 import datetime
4 4
 import decimal
5 5
 
  6
+from django.contrib.auth import get_permission_codename
6 7
 from django.db import models
7 8
 from django.db.models.constants import LOOKUP_SEP
8 9
 from django.db.models.deletion import Collector
@@ -119,7 +120,7 @@ def format_callback(obj):
119 120
                                    opts.model_name),
120 121
                                 None, (quote(obj._get_pk_val()),))
121 122
             p = '%s.%s' % (opts.app_label,
122  
-                           opts.get_delete_permission())
  123
+                           get_permission_codename('delete', opts))
123 124
             if not user.has_perm(p):
124 125
                 perms_needed.add(opts.verbose_name)
125 126
             # Display a link to the admin page.
8  django/contrib/admin/views/main.py
@@ -52,7 +52,7 @@ def _is_changelist_popup(request):
52 52
         warnings.warn(
53 53
         "The `%s` GET parameter has been renamed to `%s`." %
54 54
         (IS_LEGACY_POPUP_VAR, IS_POPUP_VAR),
55  
-        PendingDeprecationWarning, 2)
  55
+        DeprecationWarning, 2)
56 56
         return True
57 57
 
58 58
     return False
@@ -60,7 +60,7 @@ def _is_changelist_popup(request):
60 60
 
61 61
 class RenameChangeListMethods(RenameMethodsBase):
62 62
     renamed_methods = (
63  
-        ('get_query_set', 'get_queryset', PendingDeprecationWarning),
  63
+        ('get_query_set', 'get_queryset', DeprecationWarning),
64 64
     )
65 65
 
66 66
 
@@ -115,14 +115,14 @@ def __init__(self, request, model, list_display, list_display_links,
115 115
     def root_query_set(self):
116 116
         warnings.warn("`ChangeList.root_query_set` is deprecated, "
117 117
                       "use `root_queryset` instead.",
118  
-                      PendingDeprecationWarning, 2)
  118
+                      DeprecationWarning, 2)
119 119
         return self.root_queryset
120 120
 
121 121
     @property
122 122
     def query_set(self):
123 123
         warnings.warn("`ChangeList.query_set` is deprecated, "
124 124
                       "use `queryset` instead.",
125  
-                      PendingDeprecationWarning, 2)
  125
+                      DeprecationWarning, 2)
126 126
         return self.queryset
127 127
 
128 128
     def get_filters_params(self, params=None):
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
 
6  django/contrib/auth/forms.py
... ...
@@ -1,7 +1,5 @@
1 1
 from __future__ import unicode_literals
2 2
 
3  
-import warnings
4  
-
5 3
 from django import forms
6 4
 from django.forms.util import flatatt
7 5
 from django.template import loader
@@ -200,10 +198,6 @@ def clean(self):
200 198
                 )
201 199
         return self.cleaned_data
202 200
 
203  
-    def check_for_test_cookie(self):
204  
-        warnings.warn("check_for_test_cookie is deprecated; ensure your login "
205  
-                "view is CSRF-protected.", DeprecationWarning)
206  
-
207 201
     def get_user_id(self):
208 202
         if self.user_cache:
209 203
             return self.user_cache.id
39  django/contrib/auth/models.py
... ...
@@ -1,8 +1,6 @@
1 1
 from __future__ import unicode_literals
2 2
 import re
3  
-import warnings
4 3
 
5  
-from django.core.exceptions import ImproperlyConfigured
6 4
 from django.core.mail import send_mail
7 5
 from django.core import validators
8 6
 from django.db import models
@@ -14,7 +12,6 @@
14 12
 from django.utils import timezone
15 13
 
16 14
 from django.contrib import auth
17  
-# UNUSABLE_PASSWORD is still imported here for backwards compatibility
18 15
 from django.contrib.auth.hashers import (
19 16
     check_password, make_password, is_password_usable)
20 17
 from django.contrib.auth.signals import user_logged_in
@@ -32,10 +29,6 @@ def update_last_login(sender, user, **kwargs):
32 29
 user_logged_in.connect(update_last_login)
33 30
 
34 31
 
35  
-class SiteProfileNotAvailable(Exception):
36  
-    pass
37  
-
38  
-
39 32
 class PermissionManager(models.Manager):
40 33
     def get_by_natural_key(self, codename, app_label, model):
41 34
         return self.get(
@@ -413,38 +406,6 @@ def email_user(self, subject, message, from_email=None):
413 406
         """
414 407
         send_mail(subject, message, from_email, [self.email])
415 408
 
416  
-    def get_profile(self):
417  
-        """
418  
-        Returns site-specific profile for this user. Raises
419  
-        SiteProfileNotAvailable if this site does not allow profiles.
420  
-        """
421  
-        warnings.warn("The use of AUTH_PROFILE_MODULE to define user profiles has been deprecated.",
422  
-            DeprecationWarning, stacklevel=2)
423  
-        if not hasattr(self, '_profile_cache'):
424  
-            from django.conf import settings
425  
-            if not getattr(settings, 'AUTH_PROFILE_MODULE', False):
426  
-                raise SiteProfileNotAvailable(
427  
-                    'You need to set AUTH_PROFILE_MODULE in your project '
428  
-                    'settings')
429  
-            try:
430  
-                app_label, model_name = settings.AUTH_PROFILE_MODULE.split('.')
431  
-            except ValueError:
432  
-                raise SiteProfileNotAvailable(
433  
-                    'app_label and model_name should be separated by a dot in '
434  
-                    'the AUTH_PROFILE_MODULE setting')
435  
-            try:
436  
-                model = models.get_model(app_label, model_name)
437  
-                if model is None:
438  
-                    raise SiteProfileNotAvailable(
439  
-                        'Unable to load the profile model, check '
440  
-                        'AUTH_PROFILE_MODULE in your project settings')
441  
-                self._profile_cache = model._default_manager.using(
442  
-                                   self._state.db).get(user__id__exact=self.id)
443  
-                self._profile_cache.user = self
444  
-            except (ImportError, ImproperlyConfigured):
445  
-                raise SiteProfileNotAvailable
446  
-        return self._profile_cache
447  
-
448 409
 
449 410
 class User(AbstractUser):
450 411
     """
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:
39  django/contrib/auth/tests/test_models.py
... ...
@@ -1,46 +1,9 @@
1  
-import warnings
2  
-
3  
-from django.conf import settings
4 1
 from django.contrib.auth import get_user_model
5  
-from django.contrib.auth.models import (Group, User, SiteProfileNotAvailable,
6  
-    UserManager)
  2
+from django.contrib.auth.models import Group, User, UserManager
7 3
 from django.contrib.auth.tests.utils import skipIfCustomUser
8 4
 from django.db.models.signals import post_save
9 5
 from django.test import TestCase
10 6
 from django.test.utils import override_settings
11  
-from django.utils import six
12  
-
13  
-
14  
-@skipIfCustomUser
15  
-@override_settings(USE_TZ=False, AUTH_PROFILE_MODULE='')
16  
-class ProfileTestCase(TestCase):
17  
-
18  
-    def test_site_profile_not_available(self):
19  
-        user = User.objects.create(username='testclient')
20  
-
21  
-        # calling get_profile without AUTH_PROFILE_MODULE set
22  
-        del settings.AUTH_PROFILE_MODULE
23  
-        with warnings.catch_warnings():
24  
-            warnings.simplefilter("ignore", DeprecationWarning)
25  
-            with six.assertRaisesRegex(self, SiteProfileNotAvailable,
26  
-                    "You need to set AUTH_PROFILE_MODULE in your project"):
27  
-                user.get_profile()
28  
-
29  
-        # Bad syntax in AUTH_PROFILE_MODULE:
30  
-        settings.AUTH_PROFILE_MODULE = 'foobar'
31  
-        with warnings.catch_warnings():
32  
-            warnings.simplefilter("ignore", DeprecationWarning)
33  
-            with six.assertRaisesRegex(self, SiteProfileNotAvailable,
34  
-                    "app_label and model_name should be separated by a dot"):
35  
-                user.get_profile()
36  
-
37  
-        # module that doesn't exist
38  
-        settings.AUTH_PROFILE_MODULE = 'foo.bar'
39  
-        with warnings.catch_warnings():
40  
-            warnings.simplefilter("ignore", DeprecationWarning)
41  
-            with six.assertRaisesRegex(self, SiteProfileNotAvailable,
42  
-                    "Unable to load the profile model"):
43  
-                user.get_profile()
44 7
 
45 8
 
46 9
 @skipIfCustomUser
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
22  django/contrib/auth/tests/test_views.py
@@ -13,7 +13,7 @@
13 13
 from django.core.urlresolvers import reverse, NoReverseMatch
14 14
 from django.http import QueryDict, HttpRequest
15 15
 from django.utils.encoding import force_text
16  
-from django.utils.http import int_to_base36, urlsafe_base64_decode, urlquote
  16
+from django.utils.http import urlquote
17 17
 from django.utils._os import upath
18 18
 from django.test import TestCase
19 19
 from django.test.utils import override_settings, patch_logger
@@ -193,16 +193,6 @@ def test_confirm_valid(self):
193 193
         # redirect to a 'complete' page:
194 194
         self.assertContains(response, "Please enter your new password")
195 195
 
196  
-    def test_confirm_valid_base36(self):
197  
-        # Remove in Django 1.7
198  
-        url, path = self._test_confirm_start()
199  
-        path_parts = path.strip("/").split("/")
200  
-        # construct an old style (base36) URL by converting the base64 ID
201  
-        path_parts[1] = int_to_base36(int(urlsafe_base64_decode(path_parts[1])))
202  
-        response = self.client.get("/%s/%s-%s/" % tuple(path_parts))
203  
-        # redirect to a 'complete' page:
204  
-        self.assertContains(response, "Please enter your new password")
205  
-
206 196
     def test_confirm_invalid(self):
207 197
         url, path = self._test_confirm_start()
208 198
         # Let's munge the token in the path, but keep the same length,
@@ -217,21 +207,11 @@ def test_confirm_invalid_user(self):
217 207
         response = self.client.get('/reset/123456/1-1/')
218 208
         self.assertContains(response, "The password reset link was invalid")
219 209
 
220  
-    def test_confirm_invalid_user_base36(self):
221  
-        # Remove in Django 1.7
222  
-        response = self.client.get('/reset/123456-1-1/')
223  
-        self.assertContains(response, "The password reset link was invalid")
224  
-
225 210
     def test_confirm_overflow_user(self):
226 211
         # Ensure that we get a 200 response for a base36 user id that overflows int
227 212
         response = self.client.get('/reset/zzzzzzzzzzzzz/1-1/')
228 213
         self.assertContains(response, "The password reset link was invalid")
229 214
 
230  
-    def test_confirm_overflow_user_base36(self):
231  
-        # Remove in Django 1.7
232  
-        response = self.client.get('/reset/zzzzzzzzzzzzz-1-1/')
233  
-        self.assertContains(response, "The password reset link was invalid")
234  
-
235 215
     def test_confirm_invalid_post(self):
236 216
         # Same as test_confirm_invalid, but trying
237 217
         # to do a POST instead.
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):
3  django/contrib/auth/urls.py
@@ -12,9 +12,6 @@
12 12
     url(r'^password_change/done/$', 'django.contrib.auth.views.password_change_done', name='password_change_done'),
13 13
     url(r'^password_reset/$', 'django.contrib.auth.views.password_reset', name='password_reset'),
14 14
     url(r'^password_reset/done/$', 'django.contrib.auth.views.password_reset_done', name='password_reset_done'),
15  
-    # Support old style base36 password reset links; remove in Django 1.7
16  
-    url(r'^reset/(?P<uidb36>[0-9A-Za-z]{1,13})-(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
17  
-        'django.contrib.auth.views.password_reset_confirm_uidb36'),
18 15
     url(r'^reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
19 16
         'django.contrib.auth.views.password_reset_confirm',
20 17
         name='password_reset_confirm'),
9  django/contrib/auth/views.py
@@ -228,15 +228,6 @@ def password_reset_confirm(request, uidb64=None, token=None,
228 228
     return TemplateResponse(request, template_name, context,
229 229
                             current_app=current_app)
230 230
 
231  
-def password_reset_confirm_uidb36(request, uidb36=None, **kwargs):
232  
-    # Support old password reset URLs that used base36 encoded user IDs.
233  
-    # Remove in Django 1.7
234  
-    try:
235  
-      uidb64 = force_text(urlsafe_base64_encode(force_bytes(base36_to_int(uidb36))))
236  
-    except ValueError:
237  
-      uidb64 = '1' # dummy invalid ID (incorrect padding for base64)
238  
-    return password_reset_confirm(request, uidb64=uidb64, **kwargs)
239  
-
240 231
 def password_reset_complete(request,
241 232
                             template_name='registration/password_reset_complete.html',
242 233
                             current_app=None, extra_context=None):
2  django/contrib/comments/__init__.py
@@ -6,7 +6,7 @@
6 6
 from django.contrib.comments.forms import CommentForm
7 7
 from django.utils.importlib import import_module
8 8
 
9  
-warnings.warn("django.contrib.comments is deprecated and will be removed before Django 1.8.", PendingDeprecationWarning)
  9
+warnings.warn("django.contrib.comments is deprecated and will be removed before Django 1.8.", DeprecationWarning)
10 10
 
11 11
 DEFAULT_COMMENTS_APP = 'django.contrib.comments'
12 12
 
2  django/contrib/comments/templatetags/comments.py
@@ -12,7 +12,7 @@
12 12
 
13 13
 class RenameBaseCommentNodeMethods(RenameMethodsBase):
14 14
     renamed_methods = (
15  
-        ('get_query_set', 'get_queryset', PendingDeprecationWarning),
  15
+        ('get_query_set', 'get_queryset', DeprecationWarning),
16 16
     )
17 17
 
18 18
 
6  django/contrib/contenttypes/generic.py
@@ -25,7 +25,7 @@
25 25
 
26 26
 class RenameGenericForeignKeyMethods(RenameMethodsBase):
27 27
     renamed_methods = (
28  
-        ('get_prefetch_query_set', 'get_prefetch_queryset', PendingDeprecationWarning),
  28
+        ('get_prefetch_query_set', 'get_prefetch_queryset', DeprecationWarning),
29 29
     )
30 30
 
31 31
 
@@ -434,8 +434,8 @@ def generic_inlineformset_factory(model, form=ModelForm,
434 434
     """
435 435
     Returns a ``GenericInlineFormSet`` for the given kwargs.
436 436
 
437  
-    You must provide ``ct_field`` and ``object_id`` if they different from the
438  
-    defaults ``content_type`` and ``object_id`` respectively.
  437
+    You must provide ``ct_field`` and ``fk_field`` if they are different from
  438
+    the defaults ``content_type`` and ``object_id`` respectively.
439 439
     """
440 440
     opts = model._meta
441 441
     # if there is no field called `ct_field` let the exception propagate
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
 
6  django/contrib/gis/forms/fields.py
... ...
@@ -1,7 +1,5 @@
1 1
 from __future__ import unicode_literals
2 2
 
3  
-import warnings
4  
-
5 3
 from django import forms
6 4
 from django.utils import six
7 5
 from django.utils.translation import ugettext_lazy as _
@@ -34,10 +32,6 @@ def __init__(self, **kwargs):
34 32
         # defaults (e.g., allow None).
35 33
         self.srid = kwargs.pop('srid', None)
36 34
         self.geom_type = kwargs.pop('geom_type', self.geom_type)
37  
-        if 'null' in kwargs:
38  
-            kwargs.pop('null', True)
39  
-            warnings.warn("Passing 'null' keyword argument to GeometryField is deprecated.",
40  
-                DeprecationWarning, stacklevel=2)
41 35
         super(GeometryField, self).__init__(**kwargs)
42 36
         self.widget.attrs['geom_type'] = self.geom_type
43 37
 
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
5  django/contrib/gis/tests/geoapp/tests.py
... ...
@@ -1,6 +1,8 @@
1 1
 from __future__ import absolute_import
2 2
 
3 3
 import re
  4
+import unittest
  5
+from unittest import skipUnless
4 6
 
5 7
 from django.db import connection
6 8
 from django.contrib.gis import gdal
@@ -9,8 +11,7 @@
9 11
     no_mysql, no_oracle, no_spatialite,
10 12
     mysql, oracle, postgis, spatialite)
11 13
 from django.test import TestCase
12  
-from django.utils import six, unittest
13  
-from django.utils.unittest import skipUnless
  14
+from django.utils import six
14 15
 
15 16
 if HAS_GEOS:
16 17
     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):
7  django/contrib/sessions/middleware.py
@@ -6,10 +6,13 @@
6 6
 from dj