Permalink
Browse files

Merge branch 'master' into schema-alteration

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

0 comments on commit b1e0ec0

Please sign in to comment.