From ae1d663b7913f6da233c55409c4973248372d302 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Mon, 22 Jun 2015 13:54:35 -0400 Subject: [PATCH] [1.8.x] Renamed RemovedInDjango20Warning to RemovedInDjango110Warning. --- django/conf/__init__.py | 6 +-- django/conf/urls/__init__.py | 10 ++--- django/conf/urls/i18n.py | 6 +-- django/contrib/admin/helpers.py | 6 +-- django/contrib/auth/views.py | 6 +-- django/contrib/contenttypes/models.py | 4 +- django/contrib/gis/db/models/query.py | 12 ++--- .../contrib/gis/db/models/sql/aggregates.py | 2 +- django/contrib/webdesign/__init__.py | 6 +-- django/core/context_processors.py | 4 +- django/core/files/storage.py | 6 +-- django/core/management/base.py | 10 ++--- django/core/management/commands/migrate.py | 4 +- django/core/urlresolvers.py | 4 +- django/db/backends/base/creation.py | 4 +- django/db/models/aggregates.py | 2 +- django/db/models/fields/files.py | 6 +-- django/db/models/fields/related.py | 4 +- django/db/models/fields/subclassing.py | 4 +- django/db/models/options.py | 8 ++-- django/db/models/sql/aggregates.py | 4 +- django/db/models/sql/compiler.py | 4 +- django/db/models/sql/query.py | 12 ++--- django/db/utils.py | 6 +-- django/forms/fields.py | 6 +-- django/shortcuts.py | 6 +-- django/template/__init__.py | 2 +- django/template/backends/django.py | 8 ++-- django/template/base.py | 4 +- django/template/context.py | 6 +-- django/template/defaultfilters.py | 6 +-- django/template/defaulttags.py | 10 ++--- django/template/engine.py | 16 +++---- django/template/loader.py | 10 ++--- django/template/loaders/base.py | 2 +- django/template/response.py | 14 +++--- django/template/smartif.py | 8 ++-- django/template/utils.py | 6 +-- django/templatetags/future.py | 10 ++--- django/test/testcases.py | 6 +-- django/utils/checksums.py | 6 +-- django/utils/deprecation.py | 5 ++- django/utils/html.py | 6 +-- django/views/generic/edit.py | 10 ++--- docs/internals/deprecation.txt | 6 +-- docs/ref/class-based-views/mixins-editing.txt | 4 +- docs/ref/forms/fields.txt | 2 +- docs/ref/models/meta.txt | 2 +- docs/ref/settings.txt | 2 +- docs/ref/templates/builtins.txt | 6 +-- docs/ref/templates/upgrading.txt | 2 +- docs/ref/urls.txt | 2 +- docs/releases/1.8.3.txt | 5 +++ docs/releases/1.8.txt | 44 +++++++++---------- docs/topics/auth/default.txt | 4 +- docs/topics/http/shortcuts.txt | 4 +- docs/topics/i18n/translation.txt | 2 +- docs/topics/templates.txt | 2 +- tests/admin_inlines/tests.py | 2 +- tests/aggregation/tests.py | 4 +- tests/auth_tests/test_views.py | 4 +- tests/commands_sql/tests.py | 6 +-- tests/deprecation/tests.py | 2 +- tests/field_subclassing/fields.py | 6 +-- tests/file_storage/tests.py | 4 +- tests/forms_tests/tests/test_fields.py | 6 +-- tests/generic_views/test_edit.py | 10 ++--- tests/gis_tests/geo3d/tests.py | 4 +- tests/gis_tests/geoapp/test_sitemaps.py | 4 +- tests/gis_tests/geoapp/tests.py | 8 ++-- tests/gis_tests/relatedapp/tests.py | 8 ++-- tests/i18n/urls.py | 6 +-- tests/indexes/tests.py | 4 +- tests/migrations/test_commands.py | 4 +- tests/model_meta/test_legacy.py | 16 +++---- tests/multiple_database/tests.py | 4 +- tests/resolve_url/tests.py | 4 +- tests/runtests.py | 12 ++--- tests/settings_tests/tests.py | 2 +- tests/shortcuts/tests.py | 16 +++---- tests/sitemaps_tests/test_http.py | 8 ++-- tests/sitemaps_tests/test_https.py | 6 +-- tests/template_backends/test_django.py | 4 +- .../filter_tests/test_removetags.py | 6 +-- .../filter_tests/test_unordered_list.py | 8 ++-- .../template_tests/syntax_tests/test_cycle.py | 8 ++-- .../syntax_tests/test_firstof.py | 10 ++--- tests/template_tests/syntax_tests/test_for.py | 12 ++--- tests/template_tests/syntax_tests/test_if.py | 8 ++-- tests/template_tests/syntax_tests/test_ssi.py | 6 +-- tests/template_tests/syntax_tests/test_url.py | 40 ++++++++--------- tests/template_tests/test_custom.py | 4 +- tests/template_tests/test_engine.py | 6 +-- tests/template_tests/test_response.py | 8 ++-- tests/test_client_regress/tests.py | 4 +- tests/urlpatterns_reverse/erroneous_urls.py | 6 +-- .../included_namespace_urls.py | 6 +-- tests/urlpatterns_reverse/tests.py | 6 +-- tests/urlpatterns_reverse/urls.py | 6 +-- tests/user_commands/tests.py | 4 +- tests/utils_tests/test_checksums.py | 4 +- tests/utils_tests/test_html.py | 6 +-- tests/view_tests/tests/test_csrf.py | 2 +- 103 files changed, 348 insertions(+), 340 deletions(-) diff --git a/django/conf/__init__.py b/django/conf/__init__.py index 7ca099b47b..c4eb80a081 100644 --- a/django/conf/__init__.py +++ b/django/conf/__init__.py @@ -13,7 +13,7 @@ import warnings from django.conf import global_settings from django.core.exceptions import ImproperlyConfigured -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from django.utils.functional import LazyObject, empty from django.utils import six @@ -115,11 +115,11 @@ class Settings(BaseSettings): if ('django.contrib.auth.middleware.AuthenticationMiddleware' in self.MIDDLEWARE_CLASSES and 'django.contrib.auth.middleware.SessionAuthenticationMiddleware' not in self.MIDDLEWARE_CLASSES): warnings.warn( - "Session verification will become mandatory in Django 2.0. " + "Session verification will become mandatory in Django 1.10. " "Please add 'django.contrib.auth.middleware.SessionAuthenticationMiddleware' " "to your MIDDLEWARE_CLASSES setting when you are ready to opt-in after " "reading the upgrade considerations in the 1.8 release notes.", - RemovedInDjango20Warning + RemovedInDjango110Warning ) if hasattr(time, 'tzset') and self.TIME_ZONE: diff --git a/django/conf/urls/__init__.py b/django/conf/urls/__init__.py index 6ed54930c4..e88440dc0c 100644 --- a/django/conf/urls/__init__.py +++ b/django/conf/urls/__init__.py @@ -5,7 +5,7 @@ from django.core.urlresolvers import (RegexURLPattern, RegexURLResolver, LocaleRegexURLResolver) from django.core.exceptions import ImproperlyConfigured from django.utils import six -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning __all__ = ['handler400', 'handler403', 'handler404', 'handler500', 'include', 'patterns', 'url'] @@ -49,9 +49,9 @@ def include(arg, namespace=None, app_name=None): def patterns(prefix, *args): warnings.warn( 'django.conf.urls.patterns() is deprecated and will be removed in ' - 'Django 2.0. Update your urlpatterns to be a list of ' + 'Django 1.10. Update your urlpatterns to be a list of ' 'django.conf.urls.url() instances instead.', - RemovedInDjango20Warning, stacklevel=2 + RemovedInDjango110Warning, stacklevel=2 ) pattern_list = [] for t in args: @@ -72,9 +72,9 @@ def url(regex, view, kwargs=None, name=None, prefix=''): if isinstance(view, six.string_types): warnings.warn( 'Support for string view arguments to url() is deprecated and ' - 'will be removed in Django 2.0 (got %s). Pass the callable ' + 'will be removed in Django 1.10 (got %s). Pass the callable ' 'instead.' % view, - RemovedInDjango20Warning, stacklevel=2 + RemovedInDjango110Warning, stacklevel=2 ) if not view: raise ImproperlyConfigured('Empty URL pattern view name not permitted (for pattern %r)' % regex) diff --git a/django/conf/urls/i18n.py b/django/conf/urls/i18n.py index 9366a5f708..44e05b357d 100644 --- a/django/conf/urls/i18n.py +++ b/django/conf/urls/i18n.py @@ -4,7 +4,7 @@ from django.conf import settings from django.conf.urls import patterns, url from django.core.urlresolvers import LocaleRegexURLResolver from django.utils import six -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from django.views.i18n import set_language @@ -18,9 +18,9 @@ def i18n_patterns(prefix, *args): warnings.warn( "Calling i18n_patterns() with the `prefix` argument and with tuples " "instead of django.conf.urls.url() instances is deprecated and " - "will no longer work in Django 2.0. Use a list of " + "will no longer work in Django 1.10. Use a list of " "django.conf.urls.url() instances instead.", - RemovedInDjango20Warning, stacklevel=2 + RemovedInDjango110Warning, stacklevel=2 ) pattern_list = patterns(prefix, *args) else: diff --git a/django/contrib/admin/helpers.py b/django/contrib/admin/helpers.py index 07ea9a4813..e50939b2c1 100644 --- a/django/contrib/admin/helpers.py +++ b/django/contrib/admin/helpers.py @@ -14,7 +14,7 @@ from django.db.models.fields.related import ManyToManyRel from django.forms.utils import flatatt from django.template.defaultfilters import capfirst, linebreaksbr from django.utils import six -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from django.utils.encoding import force_text, smart_text from django.utils.functional import cached_property from django.utils.html import conditional_escape, format_html @@ -284,9 +284,9 @@ class InlineAdminForm(AdminForm): def original_content_type_id(self): warnings.warn( 'InlineAdminForm.original_content_type_id is deprecated and will be ' - 'removed in Django 2.0. If you were using this attribute to construct ' + 'removed in Django 1.10. If you were using this attribute to construct ' 'the "view on site" URL, use the `absolute_url` attribute instead.', - RemovedInDjango20Warning, stacklevel=2 + RemovedInDjango110Warning, stacklevel=2 ) if self.original is not None: # Since this module gets imported in the application's root package, diff --git a/django/contrib/auth/views.py b/django/contrib/auth/views.py index 99363c392e..e57d151d55 100644 --- a/django/contrib/auth/views.py +++ b/django/contrib/auth/views.py @@ -16,7 +16,7 @@ from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect, QueryDict from django.shortcuts import resolve_url from django.template.response import TemplateResponse -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from django.utils.encoding import force_text from django.utils.http import is_safe_url, urlsafe_base64_decode from django.utils.six.moves.urllib.parse import urlparse, urlunparse @@ -175,8 +175,8 @@ def password_reset(request, is_admin_site=False, warnings.warn( "The is_admin_site argument to " "django.contrib.auth.views.password_reset() is deprecated " - "and will be removed in Django 2.0.", - RemovedInDjango20Warning, 3 + "and will be removed in Django 1.10.", + RemovedInDjango110Warning, 3 ) opts = dict(opts, domain_override=request.get_host()) form.save(**opts) diff --git a/django/contrib/contenttypes/models.py b/django/contrib/contenttypes/models.py index 2aadf80027..27a5388a70 100644 --- a/django/contrib/contenttypes/models.py +++ b/django/contrib/contenttypes/models.py @@ -5,7 +5,7 @@ import warnings from django.apps import apps from django.db import models from django.db.utils import IntegrityError, OperationalError, ProgrammingError -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from django.utils.encoding import force_text, python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ @@ -41,7 +41,7 @@ class ContentTypeManager(models.Manager): del kwargs['name'] warnings.warn( "ContentType.name field doesn't exist any longer. Please remove it from your code.", - RemovedInDjango20Warning, stacklevel=2) + RemovedInDjango110Warning, stacklevel=2) return super(ContentTypeManager, self).create(**kwargs) def get_for_model(self, model, for_concrete_model=True): diff --git a/django/contrib/gis/db/models/query.py b/django/contrib/gis/db/models/query.py index f287c778da..343610c90c 100644 --- a/django/contrib/gis/db/models/query.py +++ b/django/contrib/gis/db/models/query.py @@ -15,7 +15,7 @@ from django.db.models.expressions import RawSQL from django.db.models.fields import Field from django.db.models.query import QuerySet from django.utils import six -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning class GeoQuerySet(QuerySet): @@ -69,7 +69,7 @@ class GeoQuerySet(QuerySet): warnings.warn( "The collect GeoQuerySet method is deprecated. Use the Collect() " "aggregate in an aggregate() or annotate() method.", - RemovedInDjango20Warning, stacklevel=2 + RemovedInDjango110Warning, stacklevel=2 ) return self._spatial_aggregate(aggregates.Collect, **kwargs) @@ -114,7 +114,7 @@ class GeoQuerySet(QuerySet): warnings.warn( "The extent GeoQuerySet method is deprecated. Use the Extent() " "aggregate in an aggregate() or annotate() method.", - RemovedInDjango20Warning, stacklevel=2 + RemovedInDjango110Warning, stacklevel=2 ) return self._spatial_aggregate(aggregates.Extent, **kwargs) @@ -127,7 +127,7 @@ class GeoQuerySet(QuerySet): warnings.warn( "The extent3d GeoQuerySet method is deprecated. Use the Extent3D() " "aggregate in an aggregate() or annotate() method.", - RemovedInDjango20Warning, stacklevel=2 + RemovedInDjango110Warning, stacklevel=2 ) return self._spatial_aggregate(aggregates.Extent3D, **kwargs) @@ -234,7 +234,7 @@ class GeoQuerySet(QuerySet): warnings.warn( "The make_line GeoQuerySet method is deprecated. Use the MakeLine() " "aggregate in an aggregate() or annotate() method.", - RemovedInDjango20Warning, stacklevel=2 + RemovedInDjango110Warning, stacklevel=2 ) return self._spatial_aggregate(aggregates.MakeLine, geo_field_type=PointField, **kwargs) @@ -422,7 +422,7 @@ class GeoQuerySet(QuerySet): warnings.warn( "The unionagg GeoQuerySet method is deprecated. Use the Union() " "aggregate in an aggregate() or annotate() method.", - RemovedInDjango20Warning, stacklevel=2 + RemovedInDjango110Warning, stacklevel=2 ) return self._spatial_aggregate(aggregates.Union, **kwargs) diff --git a/django/contrib/gis/db/models/sql/aggregates.py b/django/contrib/gis/db/models/sql/aggregates.py index b83bafda70..e3fb049cf5 100644 --- a/django/contrib/gis/db/models/sql/aggregates.py +++ b/django/contrib/gis/db/models/sql/aggregates.py @@ -7,4 +7,4 @@ __all__ = ['Collect', 'Extent', 'Extent3D', 'MakeLine', 'Union'] + aggregates.__ warnings.warn( "django.contrib.gis.db.models.sql.aggregates is deprecated. Use " "django.contrib.gis.db.models.aggregates instead.", - RemovedInDjango20Warning, stacklevel=2) + RemovedInDjango110Warning, stacklevel=2) diff --git a/django/contrib/webdesign/__init__.py b/django/contrib/webdesign/__init__.py index 635ed88a67..eacf09612c 100644 --- a/django/contrib/webdesign/__init__.py +++ b/django/contrib/webdesign/__init__.py @@ -1,11 +1,11 @@ import warnings -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning default_app_config = 'django.contrib.webdesign.apps.WebDesignConfig' warnings.warn( - "django.contrib.webdesign will be removed in Django 2.0. The " + "django.contrib.webdesign will be removed in Django 1.10. The " "{% lorem %} tag is now included in the built-in tags.", - RemovedInDjango20Warning + RemovedInDjango110Warning ) diff --git a/django/core/context_processors.py b/django/core/context_processors.py index f2303bec59..f106439f12 100644 --- a/django/core/context_processors.py +++ b/django/core/context_processors.py @@ -1,9 +1,9 @@ import warnings from django.template.context_processors import * # NOQA -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning warnings.warn( "django.core.context_processors is deprecated in favor of " "django.template.context_processors.", - RemovedInDjango20Warning, stacklevel=2) + RemovedInDjango110Warning, stacklevel=2) diff --git a/django/core/files/storage.py b/django/core/files/storage.py index 65b6d46463..e611d3ac7b 100644 --- a/django/core/files/storage.py +++ b/django/core/files/storage.py @@ -11,7 +11,7 @@ from django.core.files.move import file_move_safe from django.utils._os import abspathu, safe_join from django.utils.crypto import get_random_string from django.utils.deconstruct import deconstructible -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from django.utils.encoding import filepath_to_uri, force_text from django.utils.functional import LazyObject from django.utils.module_loading import import_string @@ -56,8 +56,8 @@ class Storage(object): warnings.warn( 'Backwards compatibility for storage backends without ' 'support for the `max_length` argument in ' - 'Storage.get_available_name() will be removed in Django 2.0.', - RemovedInDjango20Warning, stacklevel=2 + 'Storage.get_available_name() will be removed in Django 1.10.', + RemovedInDjango110Warning, stacklevel=2 ) name = self.get_available_name(name) diff --git a/django/core/management/base.py b/django/core/management/base.py index 3c3e5948aa..558cc320b9 100644 --- a/django/core/management/base.py +++ b/django/core/management/base.py @@ -18,7 +18,7 @@ from django.core.exceptions import ImproperlyConfigured from django.core.management.color import color_style, no_style from django.db import connections from django.utils.deprecation import ( - RemovedInDjango19Warning, RemovedInDjango20Warning, + RemovedInDjango19Warning, RemovedInDjango110Warning, ) from django.utils.encoding import force_str @@ -174,7 +174,7 @@ class BaseCommand(object): ``option_list`` This is the list of ``optparse`` options which will be fed into the command's ``OptionParser`` for parsing arguments. - Deprecated and will be removed in Django 2.0. + Deprecated and will be removed in Django 1.10. ``output_transaction`` A boolean indicating whether the command outputs SQL @@ -306,7 +306,7 @@ class BaseCommand(object): # Backwards compatibility: use deprecated optparse module warnings.warn("OptionParser usage for Django management commands " "is deprecated, use ArgumentParser instead", - RemovedInDjango20Warning) + RemovedInDjango110Warning) parser = OptionParser(prog=prog_name, usage=self.usage(subcommand), version=self.get_version()) @@ -648,9 +648,9 @@ class NoArgsCommand(BaseCommand): def __init__(self): warnings.warn( - "NoArgsCommand class is deprecated and will be removed in Django 2.0. " + "NoArgsCommand class is deprecated and will be removed in Django 1.10. " "Use BaseCommand instead, which takes no arguments by default.", - RemovedInDjango20Warning + RemovedInDjango110Warning ) super(NoArgsCommand, self).__init__() diff --git a/django/core/management/commands/migrate.py b/django/core/management/commands/migrate.py index 720cf392cc..b372369166 100644 --- a/django/core/management/commands/migrate.py +++ b/django/core/management/commands/migrate.py @@ -20,7 +20,7 @@ from django.db.migrations.autodetector import MigrationAutodetector from django.db.migrations.executor import MigrationExecutor from django.db.migrations.loader import AmbiguityError from django.db.migrations.state import ProjectState -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from django.utils.module_loading import module_has_submodule @@ -73,7 +73,7 @@ class Command(BaseCommand): if options.get("list", False): warnings.warn( "The 'migrate --list' command is deprecated. Use 'showmigrations' instead.", - RemovedInDjango20Warning, stacklevel=2) + RemovedInDjango110Warning, stacklevel=2) self.stdout.ending = None # Remove when #21429 is fixed return call_command( 'showmigrations', diff --git a/django/core/urlresolvers.py b/django/core/urlresolvers.py index f7cb13291e..f7753cf092 100644 --- a/django/core/urlresolvers.py +++ b/django/core/urlresolvers.py @@ -18,7 +18,7 @@ from django.core.exceptions import ImproperlyConfigured, ViewDoesNotExist from django.http import Http404 from django.utils import lru_cache, six from django.utils.datastructures import MultiValueDict -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from django.utils.encoding import force_str, force_text, iri_to_uri from django.utils.functional import lazy from django.utils.http import RFC3986_SUBDELIMS, urlquote @@ -442,7 +442,7 @@ class RegexURLResolver(LocaleRegexProvider): if not callable(original_lookup) and callable(lookup_view): warnings.warn( 'Reversing by dotted path is deprecated (%s).' % original_lookup, - RemovedInDjango20Warning, stacklevel=3 + RemovedInDjango110Warning, stacklevel=3 ) possibilities = self.reverse_dict.getlist(lookup_view) diff --git a/django/db/backends/base/creation.py b/django/db/backends/base/creation.py index 2c803e5539..72eb345e09 100644 --- a/django/db/backends/base/creation.py +++ b/django/db/backends/base/creation.py @@ -8,7 +8,7 @@ from django.conf import settings from django.core import serializers from django.db import router from django.db.backends.utils import truncate_name -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from django.utils.encoding import force_bytes from django.utils.six import StringIO from django.utils.six.moves import input @@ -191,7 +191,7 @@ class BaseDatabaseCreation(object): """ warnings.warn("DatabaseCreation.sql_indexes_for_model is deprecated, " "use the equivalent method of the schema editor instead.", - RemovedInDjango20Warning) + RemovedInDjango110Warning) if not model._meta.managed or model._meta.proxy or model._meta.swapped: return [] output = [] diff --git a/django/db/models/aggregates.py b/django/db/models/aggregates.py index b51fe5635a..1b3c4133ce 100644 --- a/django/db/models/aggregates.py +++ b/django/db/models/aggregates.py @@ -41,7 +41,7 @@ class Aggregate(Func): def _patch_aggregate(self, query): """ Helper method for patching 3rd party aggregates that do not yet support - the new way of subclassing. This method should be removed in 2.0 + the new way of subclassing. This method will be removed in Django 1.10. add_to_query(query, alias, col, source, is_summary) will be defined on legacy aggregates which, in turn, instantiates the SQL implementation of diff --git a/django/db/models/fields/files.py b/django/db/models/fields/files.py index ba79e927dd..73c67bef81 100644 --- a/django/db/models/fields/files.py +++ b/django/db/models/fields/files.py @@ -11,7 +11,7 @@ from django.core.files.storage import default_storage from django.db.models import signals from django.db.models.fields import Field from django.utils import six -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from django.utils.encoding import force_str, force_text from django.utils.translation import ugettext_lazy as _ @@ -96,8 +96,8 @@ class FieldFile(File): warnings.warn( 'Backwards compatibility for storage backends without ' 'support for the `max_length` argument in ' - 'Storage.save() will be removed in Django 2.0.', - RemovedInDjango20Warning, stacklevel=2 + 'Storage.save() will be removed in Django 1.10.', + RemovedInDjango110Warning, stacklevel=2 ) self.name = self.storage.save(name, content) diff --git a/django/db/models/fields/related.py b/django/db/models/fields/related.py index 4ab4334e25..2f06d4d008 100644 --- a/django/db/models/fields/related.py +++ b/django/db/models/fields/related.py @@ -19,7 +19,7 @@ from django.db.models.lookups import IsNull from django.db.models.query import QuerySet from django.db.models.query_utils import PathInfo from django.utils import six -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from django.utils.encoding import force_text, smart_text from django.utils.functional import cached_property, curry from django.utils.translation import ugettext_lazy as _ @@ -340,7 +340,7 @@ class RelatedField(Field): def related(self): warnings.warn( "Usage of field.related has been deprecated. Use field.rel instead.", - RemovedInDjango20Warning, 2) + RemovedInDjango110Warning, 2) return self.rel def do_related_class(self, other, cls): diff --git a/django/db/models/fields/subclassing.py b/django/db/models/fields/subclassing.py index 4233106429..84d13ce85c 100644 --- a/django/db/models/fields/subclassing.py +++ b/django/db/models/fields/subclassing.py @@ -9,7 +9,7 @@ seamlessly. import warnings -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning class SubfieldBase(type): @@ -19,7 +19,7 @@ class SubfieldBase(type): """ def __new__(cls, name, bases, attrs): warnings.warn("SubfieldBase has been deprecated. Use Field.from_db_value instead.", - RemovedInDjango20Warning) + RemovedInDjango110Warning) new_class = super(SubfieldBase, cls).__new__(cls, name, bases, attrs) new_class.contribute_to_class = make_contrib( diff --git a/django/db/models/options.py b/django/db/models/options.py index 0525607678..69331c5691 100644 --- a/django/db/models/options.py +++ b/django/db/models/options.py @@ -13,7 +13,7 @@ from django.db.models.fields.proxy import OrderWrt from django.db.models.fields.related import ManyToManyField from django.utils import six from django.utils.datastructures import ImmutableList, OrderedSet -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from django.utils.encoding import ( force_text, python_2_unicode_compatible, smart_text, ) @@ -51,7 +51,7 @@ class raise_deprecation(object): fn.__name__, self.suggested_alternative, ), - RemovedInDjango20Warning, stacklevel=2 + RemovedInDjango110Warning, stacklevel=2 ) return fn(*args, **kwargs) return wrapper @@ -509,7 +509,7 @@ class Options(object): only forward fields will be returned. The many_to_many argument exists for backwards compatibility reasons; - it has been deprecated and will be removed in Django 2.0. + it has been deprecated and will be removed in Django 1.10. """ m2m_in_kwargs = many_to_many is not None if m2m_in_kwargs: @@ -518,7 +518,7 @@ class Options(object): warnings.warn( "The 'many_to_many' argument on get_field() is deprecated; " "use a filter on field.many_to_many instead.", - RemovedInDjango20Warning + RemovedInDjango110Warning ) try: diff --git a/django/db/models/sql/aggregates.py b/django/db/models/sql/aggregates.py index 0ebe10e83f..5e73e4fc6a 100644 --- a/django/db/models/sql/aggregates.py +++ b/django/db/models/sql/aggregates.py @@ -6,7 +6,7 @@ import warnings from django.db.models.fields import FloatField, IntegerField from django.db.models.lookups import RegisterLookupMixin -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from django.utils.functional import cached_property __all__ = ['Aggregate', 'Avg', 'Count', 'Max', 'Min', 'StdDev', 'Sum', 'Variance'] @@ -15,7 +15,7 @@ __all__ = ['Aggregate', 'Avg', 'Count', 'Max', 'Min', 'StdDev', 'Sum', 'Variance warnings.warn( "django.db.models.sql.aggregates is deprecated. Use " "django.db.models.aggregates instead.", - RemovedInDjango20Warning, stacklevel=2) + RemovedInDjango110Warning, stacklevel=2) class Aggregate(RegisterLookupMixin): diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py index 6aab204598..688e3f741e 100644 --- a/django/db/models/sql/compiler.py +++ b/django/db/models/sql/compiler.py @@ -13,7 +13,7 @@ from django.db.models.sql.datastructures import EmptyResultSet from django.db.models.sql.query import Query, get_order_dir from django.db.transaction import TransactionManagementError from django.db.utils import DatabaseError -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from django.utils.six.moves import zip @@ -329,7 +329,7 @@ class SQLCompiler(object): warnings.warn( "Calling a SQLCompiler directly is deprecated. " "Call compiler.quote_name_unless_alias instead.", - RemovedInDjango20Warning, stacklevel=2) + RemovedInDjango110Warning, stacklevel=2) return self.quote_name_unless_alias(name) def quote_name_unless_alias(self, name): diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py index d0b56449b2..7a0fe8f892 100644 --- a/django/db/models/sql/query.py +++ b/django/db/models/sql/query.py @@ -31,7 +31,7 @@ from django.db.models.sql.where import ( ) from django.utils import six from django.utils.deprecation import ( - RemovedInDjango19Warning, RemovedInDjango20Warning, + RemovedInDjango19Warning, RemovedInDjango110Warning, ) from django.utils.encoding import force_text from django.utils.tree import Node @@ -201,7 +201,7 @@ class Query(object): def aggregates(self): warnings.warn( "The aggregates property is deprecated. Use annotations instead.", - RemovedInDjango20Warning, stacklevel=2) + RemovedInDjango110Warning, stacklevel=2) return self.annotations def __str__(self): @@ -971,7 +971,7 @@ class Query(object): def add_aggregate(self, aggregate, model, alias, is_summary): warnings.warn( "add_aggregate() is deprecated. Use add_annotation() instead.", - RemovedInDjango20Warning, stacklevel=2) + RemovedInDjango110Warning, stacklevel=2) self.add_annotation(aggregate, alias, is_summary) def add_annotation(self, annotation, alias, is_summary=False): @@ -1887,7 +1887,7 @@ class Query(object): def set_aggregate_mask(self, names): warnings.warn( "set_aggregate_mask() is deprecated. Use set_annotation_mask() instead.", - RemovedInDjango20Warning, stacklevel=2) + RemovedInDjango110Warning, stacklevel=2) self.set_annotation_mask(names) def set_annotation_mask(self, names): @@ -1901,7 +1901,7 @@ class Query(object): def append_aggregate_mask(self, names): warnings.warn( "append_aggregate_mask() is deprecated. Use append_annotation_mask() instead.", - RemovedInDjango20Warning, stacklevel=2) + RemovedInDjango110Warning, stacklevel=2) self.append_annotation_mask(names) def append_annotation_mask(self, names): @@ -1944,7 +1944,7 @@ class Query(object): def aggregate_select(self): warnings.warn( "aggregate_select() is deprecated. Use annotation_select() instead.", - RemovedInDjango20Warning, stacklevel=2) + RemovedInDjango110Warning, stacklevel=2) return self.annotation_select @property diff --git a/django/db/utils.py b/django/db/utils.py index d8aa34d30f..2261a69f71 100644 --- a/django/db/utils.py +++ b/django/db/utils.py @@ -10,7 +10,7 @@ from django.core.exceptions import ImproperlyConfigured from django.utils import six from django.utils._os import upath from django.utils.deprecation import ( - RemovedInDjango19Warning, RemovedInDjango20Warning, + RemovedInDjango19Warning, RemovedInDjango110Warning, ) from django.utils.functional import cached_property from django.utils.module_loading import import_string @@ -339,8 +339,8 @@ class ConnectionRouter(object): "The signature of allow_migrate has changed from " "allow_migrate(self, db, model) to " "allow_migrate(self, db, app_label, model_name=None, **hints). " - "Support for the old signature will be removed in Django 2.0.", - RemovedInDjango20Warning) + "Support for the old signature will be removed in Django 1.10.", + RemovedInDjango110Warning) model = hints.get('model') allow = None if model is None else method(db, model) else: diff --git a/django/forms/fields.py b/django/forms/fields.py index 53520530b6..bcaa146e4e 100644 --- a/django/forms/fields.py +++ b/django/forms/fields.py @@ -29,7 +29,7 @@ from django.forms.widgets import ( from django.utils import formats, six from django.utils.dateparse import parse_duration from django.utils.deprecation import ( - RemovedInDjango19Warning, RemovedInDjango20Warning, RenameMethodsBase, + RemovedInDjango19Warning, RemovedInDjango110Warning, RenameMethodsBase, ) from django.utils.duration import duration_string from django.utils.encoding import force_str, force_text, smart_text @@ -50,7 +50,7 @@ __all__ = ( class RenameFieldMethods(RenameMethodsBase): renamed_methods = ( - ('_has_changed', 'has_changed', RemovedInDjango20Warning), + ('_has_changed', 'has_changed', RemovedInDjango110Warning), ) @@ -553,7 +553,7 @@ class RegexField(CharField): warnings.warn( "The 'error_message' argument is deprecated. Use " "Field.error_messages['invalid'] instead.", - RemovedInDjango20Warning, stacklevel=2 + RemovedInDjango110Warning, stacklevel=2 ) error_messages = kwargs.get('error_messages') or {} error_messages['invalid'] = error_message diff --git a/django/shortcuts.py b/django/shortcuts.py index 415e51887e..90b2df3dd8 100644 --- a/django/shortcuts.py +++ b/django/shortcuts.py @@ -19,7 +19,7 @@ from django.template.engine import ( _context_instance_undefined, _dictionary_undefined, _dirs_undefined, ) from django.utils import six -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from django.utils.encoding import force_text from django.utils.functional import Promise @@ -62,7 +62,7 @@ def render(request, template_name, context=None, and dirs is _dirs_undefined and dictionary is _dictionary_undefined): # No deprecated arguments were passed - use the new code path - # In Django 2.0, request should become a positional argument. + # In Django 1.10, request should become a positional argument. content = loader.render_to_string( template_name, context, request=request, using=using) @@ -78,7 +78,7 @@ def render(request, template_name, context=None, warnings.warn( "The current_app argument of render is deprecated. " "Set the current_app attribute of request instead.", - RemovedInDjango20Warning, stacklevel=2) + RemovedInDjango110Warning, stacklevel=2) request.current_app = current_app # Directly set the private attribute to avoid triggering the # warning in RequestContext.__init__. diff --git a/django/template/__init__.py b/django/template/__init__.py index b2566decad..aa80a3dbb2 100644 --- a/django/template/__init__.py +++ b/django/template/__init__.py @@ -62,7 +62,7 @@ from .context import ContextPopException # NOQA from .base import (Context, Node, NodeList, RequestContext, # NOQA StringOrigin, Template, Variable) -# Deprecated in Django 1.8, will be removed in Django 2.0. +# Deprecated in Django 1.8, will be removed in Django 1.10. from .base import resolve_variable # NOQA # Library management diff --git a/django/template/backends/django.py b/django/template/backends/django.py index 5940c0b457..f6aa8451d8 100644 --- a/django/template/backends/django.py +++ b/django/template/backends/django.py @@ -6,7 +6,7 @@ import warnings from django.conf import settings from django.template.context import Context, RequestContext, make_context from django.template.engine import Engine, _dirs_undefined -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from .base import BaseEngine @@ -49,7 +49,7 @@ class Template(object): # >>> template.render(Context({'name': 'world'})) # In Django 1.7 get_template() returned a django.template.Template. # In Django 1.8 it returns a django.template.backends.django.Template. - # In Django 2.0 the isinstance checks should be removed. If passing a + # In Django 1.10 the isinstance checks should be removed. If passing a # Context or a RequestContext works by accident, it won't be an issue # per se, but it won't be officially supported either. if isinstance(context, RequestContext): @@ -61,12 +61,12 @@ class Template(object): "the two arguments refer to the same request.") warnings.warn( "render() must be called with a dict, not a RequestContext.", - RemovedInDjango20Warning, stacklevel=2) + RemovedInDjango110Warning, stacklevel=2) elif isinstance(context, Context): warnings.warn( "render() must be called with a dict, not a Context.", - RemovedInDjango20Warning, stacklevel=2) + RemovedInDjango110Warning, stacklevel=2) else: context = make_context(context, request) diff --git a/django/template/base.py b/django/template/base.py index 184562129b..5661bdc000 100644 --- a/django/template/base.py +++ b/django/template/base.py @@ -62,7 +62,7 @@ from django.template.context import ( # NOQA: imported for backwards compatibil BaseContext, Context, ContextPopException, RequestContext, ) from django.utils import lru_cache, six -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from django.utils.encoding import ( force_str, force_text, python_2_unicode_compatible, ) @@ -710,7 +710,7 @@ def resolve_variable(path, context): """ warnings.warn("resolve_variable() is deprecated. Use django.template." "Variable(path).resolve(context) instead", - RemovedInDjango20Warning, stacklevel=2) + RemovedInDjango110Warning, stacklevel=2) return Variable(path).resolve(context) diff --git a/django/template/context.py b/django/template/context.py index e77866cc5d..8a0d477e4f 100644 --- a/django/template/context.py +++ b/django/template/context.py @@ -2,7 +2,7 @@ import warnings from contextlib import contextmanager from copy import copy -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning # Hard-coded processor for easier use of CSRF protection. _builtin_context_processors = ('django.template.context_processors.csrf',) @@ -129,7 +129,7 @@ class Context(BaseContext): warnings.warn( "The current_app argument of Context is deprecated. Use " "RequestContext and set the current_app attribute of its " - "request instead.", RemovedInDjango20Warning, stacklevel=2) + "request instead.", RemovedInDjango110Warning, stacklevel=2) self.autoescape = autoescape self._current_app = current_app self.use_l10n = use_l10n @@ -214,7 +214,7 @@ class RequestContext(Context): warnings.warn( "The current_app argument of RequestContext is deprecated. " "Set the current_app attribute of its request instead.", - RemovedInDjango20Warning, stacklevel=2) + RemovedInDjango110Warning, stacklevel=2) self._current_app = current_app self.request = request self._processors = () if processors is None else tuple(processors) diff --git a/django/template/defaultfilters.py b/django/template/defaultfilters.py index a3a9004494..6aefb3cbf2 100644 --- a/django/template/defaultfilters.py +++ b/django/template/defaultfilters.py @@ -12,7 +12,7 @@ from django.conf import settings from django.template.base import Library, Variable, VariableDoesNotExist from django.utils import formats, six from django.utils.dateformat import format, time_format -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from django.utils.encoding import force_text, iri_to_uri from django.utils.html import ( avoid_wrapping, conditional_escape, escape, escapejs, linebreaks, @@ -714,8 +714,8 @@ def unordered_list(value, autoescape=True): if converted: warnings.warn( "The old style syntax in `unordered_list` is deprecated and will " - "be removed in Django 2.0. Use the the new format instead.", - RemovedInDjango20Warning) + "be removed in Django 1.10. Use the the new format instead.", + RemovedInDjango110Warning) return mark_safe(list_formatter(value)) diff --git a/django/template/defaulttags.py b/django/template/defaulttags.py index 4f3a5fb3ef..09c0e72d3b 100644 --- a/django/template/defaulttags.py +++ b/django/template/defaulttags.py @@ -20,7 +20,7 @@ from django.template.base import ( from django.template.defaultfilters import date from django.template.smartif import IfParser, Literal from django.utils import six, timezone -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from django.utils.encoding import force_text, smart_text from django.utils.html import format_html from django.utils.lorem_ipsum import paragraphs, words @@ -197,9 +197,9 @@ class ForNode(Node): if num_loopvars != len_item: warnings.warn( "Need {} values to unpack in for loop; got {}. " - "This will raise an exception in Django 2.0." + "This will raise an exception in Django 1.10." .format(num_loopvars, len_item), - RemovedInDjango20Warning) + RemovedInDjango110Warning) try: unpacked_vars = dict(zip(self.loopvars, item)) except TypeError: @@ -481,7 +481,7 @@ class URLNode(Node): current_app = context.request.current_app except AttributeError: # Change the fallback value to None when the deprecation path for - # Context.current_app completes in Django 2.0. + # Context.current_app completes in Django 1.10. current_app = context.current_app # Try to look up the URL twice: once given the view name, and again @@ -1095,7 +1095,7 @@ def ssi(parser, token): """ warnings.warn( "The {% ssi %} tag is deprecated. Use the {% include %} tag instead.", - RemovedInDjango20Warning, + RemovedInDjango110Warning, ) bits = token.split_contents() diff --git a/django/template/engine.py b/django/template/engine.py index 6856dd960f..f6547ac3e1 100644 --- a/django/template/engine.py +++ b/django/template/engine.py @@ -2,7 +2,7 @@ import warnings from django.core.exceptions import ImproperlyConfigured from django.utils import lru_cache, six -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from django.utils.functional import cached_property from django.utils.module_loading import import_string @@ -117,7 +117,7 @@ class Engine(object): warnings.warn( "%s inherits from django.template.loader.BaseLoader " "instead of django.template.loaders.base.Loader. " % - loader, RemovedInDjango20Warning, stacklevel=2) + loader, RemovedInDjango110Warning, stacklevel=2) loader_instance = loader_class(*args) @@ -162,7 +162,7 @@ class Engine(object): else: warnings.warn( "The dirs argument of get_template is deprecated.", - RemovedInDjango20Warning, stacklevel=2) + RemovedInDjango110Warning, stacklevel=2) template, origin = self.find_template(template_name, dirs) if not hasattr(template, 'render'): @@ -173,7 +173,7 @@ class Engine(object): # This method was originally a function defined in django.template.loader. # It was moved here in Django 1.8 when encapsulating the Django template # engine in this Engine class. It's still called by deprecated code but it - # will be removed in Django 2.0. It's superseded by a new render_to_string + # will be removed in Django 1.10. It's superseded by a new render_to_string # function in django.template.loader. def render_to_string(self, template_name, context=None, @@ -185,7 +185,7 @@ class Engine(object): else: warnings.warn( "The context_instance argument of render_to_string is " - "deprecated.", RemovedInDjango20Warning, stacklevel=2) + "deprecated.", RemovedInDjango110Warning, stacklevel=2) if dirs is _dirs_undefined: # Do not set dirs to None here to avoid triggering the deprecation # warning in select_template or get_template. @@ -193,13 +193,13 @@ class Engine(object): else: warnings.warn( "The dirs argument of render_to_string is deprecated.", - RemovedInDjango20Warning, stacklevel=2) + RemovedInDjango110Warning, stacklevel=2) if dictionary is _dictionary_undefined: dictionary = None else: warnings.warn( "The dictionary argument of render_to_string was renamed to " - "context.", RemovedInDjango20Warning, stacklevel=2) + "context.", RemovedInDjango110Warning, stacklevel=2) context = dictionary if isinstance(template_name, (list, tuple)): @@ -231,7 +231,7 @@ class Engine(object): else: warnings.warn( "The dirs argument of select_template is deprecated.", - RemovedInDjango20Warning, stacklevel=2) + RemovedInDjango110Warning, stacklevel=2) if not template_name_list: raise TemplateDoesNotExist("No template names provided") diff --git a/django/template/loader.py b/django/template/loader.py index c8fb16bf92..90397d9540 100644 --- a/django/template/loader.py +++ b/django/template/loader.py @@ -1,6 +1,6 @@ import warnings -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from . import engines from .backends.django import DjangoTemplates @@ -30,7 +30,7 @@ def get_template(template_name, dirs=_dirs_undefined, using=None): for engine in engines: try: # This is required for deprecating the dirs argument. Simply - # return engine.get_template(template_name) in Django 2.0. + # return engine.get_template(template_name) in Django 1.10. if isinstance(engine, DjangoTemplates): return engine.get_template(template_name, dirs) elif dirs is not _dirs_undefined: @@ -59,7 +59,7 @@ def select_template(template_name_list, dirs=_dirs_undefined, using=None): for engine in engines: try: # This is required for deprecating the dirs argument. Simply - # use engine.get_template(template_name) in Django 2.0. + # use engine.get_template(template_name) in Django 1.10. if isinstance(engine, DjangoTemplates): return engine.get_template(template_name, dirs) elif dirs is not _dirs_undefined: @@ -104,7 +104,7 @@ def render_to_string(template_name, context=None, try: # This is required for deprecating properly arguments specific # to Django templates. Remove Engine.render_to_string() at the - # same time as this code path in Django 2.0. + # same time as this code path in Django 1.10. if isinstance(engine, DjangoTemplates): if request is not None: raise ValueError( @@ -151,5 +151,5 @@ class BaseLoader(base.Loader): warnings.warn( "django.template.loader.BaseLoader was superseded by " "django.template.loaders.base.Loader.", - RemovedInDjango20Warning, stacklevel=2) + RemovedInDjango110Warning, stacklevel=2) super(BaseLoader, self).__init__(*args, **kwargs) diff --git a/django/template/loaders/base.py b/django/template/loaders/base.py index c7060725c7..cf487f0700 100644 --- a/django/template/loaders/base.py +++ b/django/template/loaders/base.py @@ -3,7 +3,7 @@ from django.template.base import Template, TemplateDoesNotExist class Loader(object): is_usable = False - # Only used to raise a deprecation warning. Remove in Django 2.0. + # Only used to raise a deprecation warning. Remove in Django 1.10. _accepts_engine_in_init = True def __init__(self, engine): diff --git a/django/template/response.py b/django/template/response.py index 094907ed97..3f7c90c71c 100644 --- a/django/template/response.py +++ b/django/template/response.py @@ -5,7 +5,7 @@ from django.template import Context, RequestContext, Template, loader from django.template.backends.django import Template as BackendTemplate from django.template.context import _current_app_undefined from django.utils import six -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning class ContentNotRenderedError(Exception): @@ -22,7 +22,7 @@ class SimpleTemplateResponse(HttpResponse): "{}'s template argument cannot be a django.template.Template " "anymore. It may be a backend-specific template like those " "created by get_template().".format(self.__class__.__name__), - RemovedInDjango20Warning, stacklevel=2) + RemovedInDjango110Warning, stacklevel=2) template = BackendTemplate(template) # It would seem obvious to call these next two members 'template' and @@ -84,7 +84,7 @@ class SimpleTemplateResponse(HttpResponse): def _resolve_template(self, template): # This wrapper deprecates returning a django.template.Template in # subclasses that override resolve_template. It can be removed in - # Django 2.0. + # Django 1.10. new_template = self.resolve_template(template) if isinstance(new_template, Template): warnings.warn( @@ -92,7 +92,7 @@ class SimpleTemplateResponse(HttpResponse): "template like those created by get_template(), not a " "{}.".format( self.__class__.__name__, new_template.__class__.__name__), - RemovedInDjango20Warning, stacklevel=2) + RemovedInDjango110Warning, stacklevel=2) new_template = BackendTemplate(new_template) return new_template @@ -102,7 +102,7 @@ class SimpleTemplateResponse(HttpResponse): def _resolve_context(self, context): # This wrapper deprecates returning a Context or a RequestContext in # subclasses that override resolve_context. It can be removed in - # Django 2.0. If returning a Context or a RequestContext works by + # Django 1.10. If returning a Context or a RequestContext works by # accident, it won't be an issue per se, but it won't be officially # supported either. new_context = self.resolve_context(context) @@ -112,7 +112,7 @@ class SimpleTemplateResponse(HttpResponse): warnings.warn( "{}.resolve_context() must return a dict, not a {}.".format( self.__class__.__name__, new_context.__class__.__name__), - RemovedInDjango20Warning, stacklevel=2) + RemovedInDjango110Warning, stacklevel=2) # It would be tempting to do new_context = new_context.flatten() # here but that would cause template context processors to run for # TemplateResponse(request, template, Context({})), which would be @@ -199,7 +199,7 @@ class TemplateResponse(SimpleTemplateResponse): warnings.warn( "The current_app argument of TemplateResponse is deprecated. " "Set the current_app attribute of its request instead.", - RemovedInDjango20Warning, stacklevel=2) + RemovedInDjango110Warning, stacklevel=2) request.current_app = current_app super(TemplateResponse, self).__init__( template, context, content_type, status, charset, using) diff --git a/django/template/smartif.py b/django/template/smartif.py index 7b5a0083da..36c76cb5e6 100644 --- a/django/template/smartif.py +++ b/django/template/smartif.py @@ -3,7 +3,7 @@ Parser and utilities for the smart 'if' tag """ import warnings -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning # Using a simple top down parser, as described here: @@ -102,7 +102,7 @@ OPERATORS = { 'not': prefix(8, lambda context, x: not x.eval(context)), 'in': infix(9, lambda context, x, y: x.eval(context) in y.eval(context)), 'not in': infix(9, lambda context, x, y: x.eval(context) not in y.eval(context)), - # This should be removed in Django 2.0: + # This should be removed in Django 1.10: '=': infix(10, lambda context, x, y: x.eval(context) == y.eval(context)), '==': infix(10, lambda context, x, y: x.eval(context) == y.eval(context)), '!=': infix(10, lambda context, x, y: x.eval(context) != y.eval(context)), @@ -180,8 +180,8 @@ class IfParser(object): else: if token == '=': warnings.warn( - "Operator '=' is deprecated and will be removed in Django 2.0. Use '==' instead.", - RemovedInDjango20Warning, stacklevel=2 + "Operator '=' is deprecated and will be removed in Django 1.10. Use '==' instead.", + RemovedInDjango110Warning, stacklevel=2 ) return op() diff --git a/django/template/utils.py b/django/template/utils.py index ea72a8c5b1..cbf0de148d 100644 --- a/django/template/utils.py +++ b/django/template/utils.py @@ -7,7 +7,7 @@ from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils import lru_cache from django.utils._os import upath -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from django.utils.functional import cached_property from django.utils.module_loading import import_string @@ -33,8 +33,8 @@ class EngineHandler(object): if not self._templates: warnings.warn( "You haven't defined a TEMPLATES setting. You must do so " - "before upgrading to Django 2.0. Otherwise Django will be " - "unable to load templates.", RemovedInDjango20Warning) + "before upgrading to Django 1.10. Otherwise Django will be " + "unable to load templates.", RemovedInDjango110Warning) self._templates = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', diff --git a/django/templatetags/future.py b/django/templatetags/future.py index 53d22866dd..ffc4f3c12d 100644 --- a/django/templatetags/future.py +++ b/django/templatetags/future.py @@ -2,7 +2,7 @@ import warnings from django.template import Library, defaulttags from django.utils.deprecation import ( - RemovedInDjango19Warning, RemovedInDjango20Warning, + RemovedInDjango19Warning, RemovedInDjango110Warning, ) register = Library() @@ -47,8 +47,8 @@ def cycle(parser, token): """ warnings.warn( "Loading the `cycle` tag from the `future` library is deprecated and " - "will be removed in Django 2.0. Use the default `cycle` tag instead.", - RemovedInDjango20Warning) + "will be removed in Django 1.10. Use the default `cycle` tag instead.", + RemovedInDjango110Warning) return defaulttags.cycle(parser, token) @@ -82,6 +82,6 @@ def firstof(parser, token): """ warnings.warn( "Loading the `firstof` tag from the `future` library is deprecated and " - "will be removed in Django 2.0. Use the default `firstof` tag instead.", - RemovedInDjango20Warning) + "will be removed in Django 1.10. Use the default `firstof` tag instead.", + RemovedInDjango110Warning) return defaulttags.firstof(parser, token) diff --git a/django/test/testcases.py b/django/test/testcases.py index 3b40a64be5..ecf0eda4e8 100644 --- a/django/test/testcases.py +++ b/django/test/testcases.py @@ -38,7 +38,7 @@ from django.test.utils import ( override_settings, ) from django.utils import six -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from django.utils.encoding import force_text from django.utils.six.moves.urllib.parse import ( unquote, urlparse, urlsplit, urlunsplit, @@ -206,9 +206,9 @@ class SimpleTestCase(unittest.TestCase): if hasattr(self, 'urls'): warnings.warn( "SimpleTestCase.urls is deprecated and will be removed in " - "Django 2.0. Use @override_settings(ROOT_URLCONF=...) " + "Django 1.10. Use @override_settings(ROOT_URLCONF=...) " "in %s instead." % self.__class__.__name__, - RemovedInDjango20Warning, stacklevel=2) + RemovedInDjango110Warning, stacklevel=2) set_urlconf(None) self._old_root_urlconf = settings.ROOT_URLCONF settings.ROOT_URLCONF = self.urls diff --git a/django/utils/checksums.py b/django/utils/checksums.py index 40d6814d52..c74631acb2 100644 --- a/django/utils/checksums.py +++ b/django/utils/checksums.py @@ -7,12 +7,12 @@ __all__ = ['luhn'] import warnings from django.utils import six -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning warnings.warn( - "django.utils.checksums will be removed in Django 2.0. The " + "django.utils.checksums will be removed in Django 1.10. The " "luhn() function is now included in django-localflavor 1.1+.", - RemovedInDjango20Warning + RemovedInDjango110Warning ) LUHN_ODD_LOOKUP = (0, 2, 4, 6, 8, 1, 3, 5, 7, 9) # sum_of_digits(index * 2) diff --git a/django/utils/deprecation.py b/django/utils/deprecation.py index e6a818c9c4..6a0c91daa0 100644 --- a/django/utils/deprecation.py +++ b/django/utils/deprecation.py @@ -2,9 +2,12 @@ import inspect import warnings -class RemovedInDjango20Warning(PendingDeprecationWarning): +class RemovedInDjango110Warning(PendingDeprecationWarning): pass +# for backwards compatibility in Django 1.8.3 +RemovedInDjango20Warning = PendingDeprecationWarning + class RemovedInDjango19Warning(DeprecationWarning): pass diff --git a/django/utils/html.py b/django/utils/html.py index 837a17f171..a2672d432c 100644 --- a/django/utils/html.py +++ b/django/utils/html.py @@ -7,7 +7,7 @@ import sys import warnings from django.utils import six -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from django.utils.encoding import force_str, force_text from django.utils.functional import allow_lazy from django.utils.http import RFC3986_GENDELIMS, RFC3986_SUBDELIMS @@ -198,7 +198,7 @@ def remove_tags(html, tags): warnings.warn( "django.utils.html.remove_tags() and the removetags template filter " "are deprecated. Consider using the bleach library instead.", - RemovedInDjango20Warning, stacklevel=3 + RemovedInDjango110Warning, stacklevel=3 ) tags = [re.escape(tag) for tag in tags.split()] tags_re = '(%s)' % '|'.join(tags) @@ -220,7 +220,7 @@ def strip_entities(value): """Returns the given HTML with all entities (&something;) stripped.""" warnings.warn( "django.utils.html.strip_entities() is deprecated.", - RemovedInDjango20Warning, stacklevel=2 + RemovedInDjango110Warning, stacklevel=2 ) return re.sub(r'&(?:\w+|#\d+);', '', force_text(value)) strip_entities = allow_lazy(strip_entities, six.text_type) diff --git a/django/views/generic/edit.py b/django/views/generic/edit.py index 2a2590263f..08c090e541 100644 --- a/django/views/generic/edit.py +++ b/django/views/generic/edit.py @@ -6,14 +6,14 @@ from django.core.exceptions import ImproperlyConfigured from django.forms import models as model_forms from django.http import HttpResponseRedirect from django.utils import six -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from django.utils.encoding import force_text from django.views.generic.base import ContextMixin, TemplateResponseMixin, View from django.views.generic.detail import ( BaseDetailView, SingleObjectMixin, SingleObjectTemplateResponseMixin, ) -PERCENT_PLACEHOLDER_REGEX = re.compile(r'%\([^\)]+\)') # RemovedInDjango20Warning +PERCENT_PLACEHOLDER_REGEX = re.compile(r'%\([^\)]+\)') # RemovedInDjango110Warning class FormMixinBase(type): @@ -26,7 +26,7 @@ class FormMixinBase(type): warnings.warn( "`%s.%s.get_form` method must define a default value for " "its `form_class` argument." % (attrs['__module__'], name), - RemovedInDjango20Warning, stacklevel=2 + RemovedInDjango110Warning, stacklevel=2 ) def get_form_with_form_class(self, form_class=None): @@ -172,7 +172,7 @@ class ModelFormMixin(FormMixin, SingleObjectMixin): warnings.warn( "%()s placeholder style in success_url is deprecated. " "Please replace them by the {} Python format syntax.", - RemovedInDjango20Warning, stacklevel=2 + RemovedInDjango110Warning, stacklevel=2 ) url = self.success_url % self.object.__dict__ else: @@ -308,7 +308,7 @@ class DeletionMixin(object): warnings.warn( "%()s placeholder style in success_url is deprecated. " "Please replace them by the {} Python format syntax.", - RemovedInDjango20Warning, stacklevel=2 + RemovedInDjango110Warning, stacklevel=2 ) return self.success_url % self.object.__dict__ else: diff --git a/docs/internals/deprecation.txt b/docs/internals/deprecation.txt index 8329309727..7374029256 100644 --- a/docs/internals/deprecation.txt +++ b/docs/internals/deprecation.txt @@ -7,10 +7,10 @@ in a backward incompatible way, following their deprecation, as per the :ref:`deprecation policy `. More details about each item can often be found in the release notes of two versions prior. -.. _deprecation-removed-in-2.0: +.. _deprecation-removed-in-1.10: -2.0 ---- +1.10 +---- See the :ref:`Django 1.8 release notes` for more details on these changes. diff --git a/docs/ref/class-based-views/mixins-editing.txt b/docs/ref/class-based-views/mixins-editing.txt index 024b89cd2b..85a868ea18 100644 --- a/docs/ref/class-based-views/mixins-editing.txt +++ b/docs/ref/class-based-views/mixins-editing.txt @@ -157,7 +157,7 @@ ModelFormMixin Support for the new brace-based Python formatting syntax has been added. The old ``%(slug)s`` placeholder syntax support has been - deprecated and will be removed in Django 2.0. + deprecated and will be removed in Django 1.10. .. method:: get_form_class() @@ -251,7 +251,7 @@ DeletionMixin Support for the new brace-based Python formatting syntax has been added. The old ``%(slug)s`` placeholder syntax support has been - deprecated and will be removed in Django 2.0. + deprecated and will be removed in Django 1.10. .. method:: get_success_url() diff --git a/docs/ref/forms/fields.txt b/docs/ref/forms/fields.txt index 55a8bc049e..b6cb05b847 100644 --- a/docs/ref/forms/fields.txt +++ b/docs/ref/forms/fields.txt @@ -852,7 +852,7 @@ For each field, we describe the default widget used if you don't specify .. deprecated:: 1.8 The optional argument ``error_message`` is also accepted for backwards - compatibility but will be removed in Django 2.0. The preferred way to + compatibility but will be removed in Django 1.10. The preferred way to provide an error message is to use the :attr:`~Field.error_messages` argument, passing a dictionary with ``'invalid'`` as a key and the error message as the value. diff --git a/docs/ref/models/meta.txt b/docs/ref/models/meta.txt index d972e9b5eb..d8f711b810 100644 --- a/docs/ref/models/meta.txt +++ b/docs/ref/models/meta.txt @@ -151,7 +151,7 @@ Migrating from the old API As part of the formalization of the ``Model._meta`` API (from the :class:`django.db.models.options.Options` class), a number of methods and -properties have been deprecated and will be removed in Django 2.0. +properties have been deprecated and will be removed in Django 1.10. These old APIs can be replicated by either: diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt index 8c865edb71..53a5dda00c 100644 --- a/docs/ref/settings.txt +++ b/docs/ref/settings.txt @@ -126,7 +126,7 @@ Default: ``()`` (Empty tuple) .. deprecated:: 1.8 This setting, along with the :ttag:`ssi` template tag, is deprecated and - will be removed in Django 2.0. + will be removed in Django 1.10. .. versionchanged:: 1.8 diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt index 1caec9a634..b4ca36b5e4 100644 --- a/docs/ref/templates/builtins.txt +++ b/docs/ref/templates/builtins.txt @@ -990,7 +990,7 @@ ssi .. deprecated:: 1.8 - This tag has been deprecated and will be removed in Django 2.0. Use the + This tag has been deprecated and will be removed in Django 1.10. Use the :ttag:`include` tag instead. Outputs the contents of a given file into the page. @@ -1135,7 +1135,7 @@ by the context as to the current application. .. deprecated:: 1.8 The dotted Python path syntax is deprecated and will be removed in - Django 2.0:: + Django 1.10:: {% url 'path.to.some_view' v1 v2 %} @@ -2327,7 +2327,7 @@ contains ``['States', ['Kansas', ['Lawrence', 'Topeka'], 'Illinois']]``, then An older, more restrictive and verbose input format is also supported: ``['States', [['Kansas', [['Lawrence', []], ['Topeka', []]]], ['Illinois', []]]]``. - Support for this syntax will be removed in Django 2.0. + Support for this syntax will be removed in Django 1.10. .. templatefilter:: upper diff --git a/docs/ref/templates/upgrading.txt b/docs/ref/templates/upgrading.txt index 33057d36bd..887c2719e7 100644 --- a/docs/ref/templates/upgrading.txt +++ b/docs/ref/templates/upgrading.txt @@ -150,7 +150,7 @@ You should write:: Passing a :class:`~django.template.Context` or a :class:`~django.template.RequestContext` is still possible when the template is loaded by a :class:`~django.template.backends.django.DjangoTemplates` -backend but it's deprecated and won't be supported in Django 2.0. +backend but it's deprecated and won't be supported in Django 1.10. If you're loading a template while you're rendering another template with the Django template language and you have access to the current context, for diff --git a/docs/ref/urls.txt b/docs/ref/urls.txt index 222f41a76e..073db4c00c 100644 --- a/docs/ref/urls.txt +++ b/docs/ref/urls.txt @@ -119,7 +119,7 @@ parameter is useful. .. deprecated:: 1.8 Support for string ``view`` arguments is deprecated and will be removed in - Django 2.0. Pass the callable instead. + Django 1.10. Pass the callable instead. The ``prefix`` parameter has the same meaning as the first argument to ``patterns()`` and is only relevant when you're passing a string as the diff --git a/docs/releases/1.8.3.txt b/docs/releases/1.8.3.txt index 90008e184e..38bcaf5374 100644 --- a/docs/releases/1.8.3.txt +++ b/docs/releases/1.8.3.txt @@ -6,6 +6,11 @@ Django 1.8.3 release notes Django 1.8.3 fixes several bugs in 1.8.2. +Also, ``django.utils.deprecation.RemovedInDjango20Warning`` was renamed to +``RemovedInDjango110Warning`` as the version roadmap was revised to 1.9, 1.10, +1.11 (LTS), 2.0 (drops Python 2 support). For backwards compatibility, +``RemovedInDjango20Warning`` remains as an importable alias. + Bugfixes ======== diff --git a/docs/releases/1.8.txt b/docs/releases/1.8.txt index 5dee5671a9..2b755ef7c7 100644 --- a/docs/releases/1.8.txt +++ b/docs/releases/1.8.txt @@ -379,7 +379,7 @@ Generic Views * Placeholders in :attr:`ModelFormMixin.success_url ` now support the Python :py:meth:`str.format()` syntax. The legacy ``%()s`` syntax is still - supported but will be removed in Django 2.0. + supported but will be removed in Django 1.10. Internationalization ^^^^^^^^^^^^^^^^^^^^ @@ -1182,7 +1182,7 @@ Selected methods in ``django.db.models.options.Options`` As part of the formalization of the ``Model._meta`` API (from the :class:`django.db.models.options.Options` class), a number of methods have been -deprecated and will be removed in Django 2.0: +deprecated and will be removed in Django 1.10: * ``get_all_field_names()`` * ``get_all_related_objects()`` @@ -1203,7 +1203,7 @@ Loading ``cycle`` and ``firstof`` template tags from ``future`` library Django 1.6 introduced ``{% load cycle from future %}`` and ``{% load firstof from future %}`` syntax for forward compatibility of the :ttag:`cycle` and :ttag:`firstof` template tags. This syntax is now deprecated -and will be removed in Django 2.0. You can simply remove the +and will be removed in Django 1.10. You can simply remove the ``{% load ... from future %}`` tags. ``django.conf.urls.patterns()`` @@ -1289,7 +1289,7 @@ Built-in template context processors have been moved to The attribute :attr:`SimpleTestCase.urls ` for specifying URLconf configuration in tests has been deprecated and will be -removed in Django 2.0. Use :func:`@override_settings(ROOT_URLCONF=...) +removed in Django 1.10. Use :func:`@override_settings(ROOT_URLCONF=...) ` instead. ``prefix`` argument to :func:`~django.conf.urls.i18n.i18n_patterns` @@ -1303,7 +1303,7 @@ Using an incorrect count of unpacked values in the :ttag:`for` template tag ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Using an incorrect count of unpacked values in :ttag:`for` tag will raise an -exception rather than fail silently in Django 2.0. +exception rather than fail silently in Django 1.10. Passing a dotted path to :func:`~django.core.urlresolvers.reverse()` and :ttag:`url` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -1321,7 +1321,7 @@ the ``url`` that references :func:`django.contrib.sitemaps.views.sitemap`:: url(r'^sitemap\.xml$', sitemap, {'sitemaps': sitemaps}, name='django.contrib.sitemaps.views.sitemap') -to ensure compatibility when reversing by Python path is removed in Django 2.0. +to ensure compatibility when reversing by Python path is removed in Django 1.10. Similarly for GIS sitemaps, add ``name='django.contrib.gis.sitemaps.views.kml'`` or ``name='django.contrib.gis.sitemaps.views.kmz'``. @@ -1335,7 +1335,7 @@ The ``django.db.models.sql.aggregates`` and ``django.contrib.gis.db.models.sql.aggregates`` modules (both private API), have been deprecated as ``django.db.models.aggregates`` and ``django.contrib.gis.db.models.aggregates`` are now also responsible -for SQL generation. The old modules will be removed in Django 2.0. +for SQL generation. The old modules will be removed in Django 1.10. If you were using the old modules, see :doc:`Query Expressions ` for instructions on rewriting custom aggregates @@ -1343,7 +1343,7 @@ using the new stable API. The following methods and properties of ``django.db.models.sql.query.Query`` have also been deprecated and the backwards compatibility shims will be removed -in Django 2.0: +in Django 1.10: * ``Query.aggregates``, replaced by ``annotations``. * ``Query.aggregate_select``, replaced by ``annotation_select``. @@ -1366,14 +1366,14 @@ arguments through ``argparse.add_argument()``. See ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The class :class:`~django.core.management.NoArgsCommand` is now deprecated and -will be removed in Django 2.0. Use :class:`~django.core.management.BaseCommand` +will be removed in Django 1.10. Use :class:`~django.core.management.BaseCommand` instead, which takes no arguments by default. Listing all migrations in a project ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The ``--list`` option of the :djadmin:`migrate` management command is -deprecated and will be removed in Django 2.0. Use :djadmin:`showmigrations` +deprecated and will be removed in Django 1.10. Use :djadmin:`showmigrations` instead. ``cache_choices`` option of ``ModelChoiceField`` and ``ModelMultipleChoiceField`` @@ -1421,7 +1421,7 @@ Using the new syntax, this becomes:: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Rename this method to :meth:`~django.forms.Field.has_changed` by removing the -leading underscore. The old name will still work until Django 2.0. +leading underscore. The old name will still work until Django 1.10. ``django.utils.html.remove_tags()`` and ``removetags`` template filter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -1443,7 +1443,7 @@ It's a legacy option that should no longer be necessary. ~~~~~~~~~~~~~~~~ ``django.db.models.fields.subclassing.SubfieldBase`` has been deprecated and -will be removed in Django 2.0. Historically, it was used to handle fields where +will be removed in Django 1.10. Historically, it was used to handle fields where type conversion was needed when loading from the database, but it was not used in ``.values()`` calls or in aggregates. It has been replaced with :meth:`~django.db.models.Field.from_db_value`. Note that the new approach does @@ -1454,7 +1454,7 @@ as was the case with ``SubfieldBase``. ~~~~~~~~~~~~~~~~~~~~~~~~~~ The ``django.utils.checksums`` module has been deprecated and will be removed -in Django 2.0. The functionality it provided (validating checksum using the +in Django 1.10. The functionality it provided (validating checksum using the Luhn algorithm) was undocumented and not used in Django. The module has been moved to the `django-localflavor`_ package (version 1.1+). @@ -1464,7 +1464,7 @@ moved to the `django-localflavor`_ package (version 1.1+). ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The ``original_content_type_id`` attribute on ``InlineAdminForm`` has been -deprecated and will be removed in Django 2.0. Historically, it was used +deprecated and will be removed in Django 1.10. Historically, it was used to construct the "view on site" URL. This URL is now accessible using the ``absolute_url`` attribute of the form. @@ -1511,7 +1511,7 @@ for details. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The following functions and classes will no longer accept a ``current_app`` -parameter to set an URL namespace in Django 2.0: +parameter to set an URL namespace in Django 1.10: * ``django.shortcuts.render()`` * ``django.template.Context()`` @@ -1526,7 +1526,7 @@ to these functions or classes. If you're using a plain ``Context``, use a ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The following functions will no longer accept the ``dictionary`` and -``context_instance`` parameters in Django 2.0: +``context_instance`` parameters in Django 1.10: * ``django.shortcuts.render()`` * ``django.shortcuts.render_to_response()`` @@ -1544,7 +1544,7 @@ pass a :class:`dict` in the ``context`` parameter instead. If you're passing a ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The following functions will no longer accept a ``dirs`` parameter to override -``TEMPLATE_DIRS`` in Django 2.0: +``TEMPLATE_DIRS`` in Django 1.10: * :func:`django.template.loader.get_template()` * :func:`django.template.loader.select_template()` @@ -1576,7 +1576,7 @@ Support for the ``max_length`` argument on custom ``Storage`` classes :meth:`~django.core.files.storage.Storage.get_available_name` and/or :meth:`~django.core.files.storage.Storage.save` if they override either method. Support for storages that do not accept this argument will be removed in -Django 2.0. +Django 1.10. ``qn`` replaced by ``compiler`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -1608,7 +1608,7 @@ added in Django 1.7. In Django 1.7.2, its functionality was moved to ``'django.contrib.auth.middleware.SessionAuthenticationMiddleware'`` appears in :setting:`MIDDLEWARE_CLASSES`. -In Django 2.0, session verification will be enabled regardless of whether or not +In Django 1.10, session verification will be enabled regardless of whether or not ``SessionAuthenticationMiddleware`` is enabled (at which point ``SessionAuthenticationMiddleware`` will have no significance). You can add it to your ``MIDDLEWARE_CLASSES`` sometime before then to opt-in. Please read the @@ -1629,7 +1629,7 @@ of ``Field.rel``. The latter is an instance of ``django.db.models.fields.related.ForeignObjectRel`` which replaces ``django.db.models.related.RelatedObject``. The ``django.db.models.related`` module has been removed and the ``Field.related`` attribute will be removed in -Django 2.0. +Django 1.10. ``ssi`` template tag ~~~~~~~~~~~~~~~~~~~~ @@ -1637,7 +1637,7 @@ Django 2.0. The :ttag:`ssi` template tag allows files to be included in a template by absolute path. This is of limited use in most deployment situations, and the :ttag:`include` tag often makes more sense. This tag is now deprecated and -will be removed in Django 2.0. +will be removed in Django 1.10. ``=`` as comparison operator in ``if`` template tag ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -1650,7 +1650,7 @@ testing was undocumented and untested. It's now deprecated in favor of ``==``. The legacy ``%()s`` syntax in :attr:`ModelFormMixin.success_url ` is deprecated and -will be removed in Django 2.0. +will be removed in Django 1.10. ``GeoQuerySet`` aggregate methods ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/topics/auth/default.txt b/docs/topics/auth/default.txt index 9a5ebd5454..31460db03a 100644 --- a/docs/topics/auth/default.txt +++ b/docs/topics/auth/default.txt @@ -621,7 +621,7 @@ Session invalidation on password change is enabled in :setting:`MIDDLEWARE_CLASSES`. It's included if ``settings.py`` was generated by :djadmin:`startproject` on Django ≥ 1.7. - Session verification will become mandatory in Django 2.0 regardless of + Session verification will become mandatory in Django 1.10 regardless of whether or not ``SessionAuthenticationMiddleware`` is enabled. If you have a pre-1.7 project or one generated using a template that doesn't include ``SessionAuthenticationMiddleware``, consider enabling it before then after @@ -1076,7 +1076,7 @@ implementation details see :ref:`using-the-views`. .. deprecated:: 1.8 The ``is_admin_site`` argument is deprecated and will be removed in - Django 2.0. + Django 1.10. **Template context:** diff --git a/docs/topics/http/shortcuts.txt b/docs/topics/http/shortcuts.txt index 3f3db308d9..e0fc3aa573 100644 --- a/docs/topics/http/shortcuts.txt +++ b/docs/topics/http/shortcuts.txt @@ -49,7 +49,7 @@ Optional arguments .. versionchanged:: 1.8 The ``context`` argument used to be called ``dictionary``. That name - is deprecated in Django 1.8 and will be removed in Django 2.0. + is deprecated in Django 1.8 and will be removed in Django 1.10. ``context_instance`` The context instance to render the template with. By default, the template @@ -146,7 +146,7 @@ Optional arguments .. versionchanged:: 1.8 The ``context`` argument used to be called ``dictionary``. That name - is deprecated in Django 1.8 and will be removed in Django 2.0. + is deprecated in Django 1.8 and will be removed in Django 1.10. ``context_instance`` The context instance to render the template with. By default, the template diff --git a/docs/topics/i18n/translation.txt b/docs/topics/i18n/translation.txt index 9220cda737..ede30bde9f 100644 --- a/docs/topics/i18n/translation.txt +++ b/docs/topics/i18n/translation.txt @@ -1236,7 +1236,7 @@ Language prefix in URL patterns .. deprecated:: 1.8 The ``prefix`` argument to ``i18n_patterns()`` has been deprecated and will - not be supported in Django 2.0. Simply pass a list of + not be supported in Django 1.10. Simply pass a list of :func:`django.conf.urls.url` instances instead. This function can be used in your root URLconf and Django will automatically diff --git a/docs/topics/templates.txt b/docs/topics/templates.txt index 7a0fc77373..2bb3606d19 100644 --- a/docs/topics/templates.txt +++ b/docs/topics/templates.txt @@ -273,7 +273,7 @@ templates, Django provides a shortcut function which automates the process. .. versionchanged:: 1.8 The ``context`` argument used to be called ``dictionary``. That name - is deprecated in Django 1.8 and will be removed in Django 2.0. + is deprecated in Django 1.8 and will be removed in Django 1.10. ``context`` is now optional. An empty context will be used if it isn't provided. diff --git a/tests/admin_inlines/tests.py b/tests/admin_inlines/tests.py index 74cb0860d2..239a6d063b 100644 --- a/tests/admin_inlines/tests.py +++ b/tests/admin_inlines/tests.py @@ -422,7 +422,7 @@ class TestInlineAdminForm(TestCase): self.assertEqual( msg, 'InlineAdminForm.original_content_type_id is deprecated and will be ' - 'removed in Django 2.0. If you were using this attribute to construct ' + 'removed in Django 1.10. If you were using this attribute to construct ' 'the "view on site" URL, use the `absolute_url` attribute instead.' ) self.assertEqual(iaf2.original_content_type_id, poll_ct.id) diff --git a/tests/aggregation/tests.py b/tests/aggregation/tests.py index bf4097205e..384013ef2f 100644 --- a/tests/aggregation/tests.py +++ b/tests/aggregation/tests.py @@ -13,7 +13,7 @@ from django.db.models import ( from django.test import TestCase, ignore_warnings from django.test.utils import Approximate, CaptureQueriesContext from django.utils import six, timezone -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from .models import Author, Book, Publisher, Store @@ -949,7 +949,7 @@ class ComplexAggregateTestCase(TestCase): self.assertQuerysetEqual( qs2, [1, 2], lambda v: v.pk) - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) def test_backwards_compatibility(self): from django.db.models.sql import aggregates as sql_aggregates diff --git a/tests/auth_tests/test_views.py b/tests/auth_tests/test_views.py index 8b019139a0..81d2925627 100644 --- a/tests/auth_tests/test_views.py +++ b/tests/auth_tests/test_views.py @@ -25,7 +25,7 @@ from django.test import ( TestCase, ignore_warnings, modify_settings, override_settings, ) from django.test.utils import patch_logger -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from django.utils.encoding import force_text from django.utils.http import urlquote from django.utils.six.moves.urllib.parse import ParseResult, urlparse @@ -157,7 +157,7 @@ class PasswordResetTest(AuthViewsTestCase): self.assertEqual(len(mail.outbox), 1) self.assertEqual("staffmember@example.com", mail.outbox[0].from_email) - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) @override_settings(ALLOWED_HOSTS=['adminsite.com']) def test_admin_reset(self): "If the reset view is marked as being for admin, the HTTP_HOST header is used for a domain override." diff --git a/tests/commands_sql/tests.py b/tests/commands_sql/tests.py index a74aab9d6a..24d477f2f6 100644 --- a/tests/commands_sql/tests.py +++ b/tests/commands_sql/tests.py @@ -11,7 +11,7 @@ from django.core.management.sql import ( from django.db import DEFAULT_DB_ALIAS, connections from django.test import TestCase, ignore_warnings, override_settings from django.utils import six -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning # See also initial_sql_regress for 'custom_sql_for_model' tests @@ -68,7 +68,7 @@ class SQLCommandsTestCase(TestCase): sql = drop_tables[-1].lower() six.assertRegex(self, sql, r'^drop table .commands_sql_comment.*') - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) def test_sql_indexes(self): app_config = apps.get_app_config('commands_sql') output = sql_indexes(app_config, no_style(), connections[DEFAULT_DB_ALIAS]) @@ -81,7 +81,7 @@ class SQLCommandsTestCase(TestCase): # Number of indexes is backend-dependent self.assertTrue(1 <= self.count_ddl(output, 'DROP INDEX') <= 4) - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) def test_sql_all(self): app_config = apps.get_app_config('commands_sql') output = sql_all(app_config, no_style(), connections[DEFAULT_DB_ALIAS]) diff --git a/tests/deprecation/tests.py b/tests/deprecation/tests.py index 48f53fbae1..857db99b1a 100644 --- a/tests/deprecation/tests.py +++ b/tests/deprecation/tests.py @@ -248,5 +248,5 @@ class DeprecatingSimpleTestCaseUrls(unittest.TestCase): msg = force_text(recorded.pop().message) self.assertEqual(msg, "SimpleTestCase.urls is deprecated and will be removed in " - "Django 2.0. Use @override_settings(ROOT_URLCONF=...) " + "Django 1.10. Use @override_settings(ROOT_URLCONF=...) " "in TempTestCase instead.") diff --git a/tests/field_subclassing/fields.py b/tests/field_subclassing/fields.py index 3bfdb5a89c..d1385646a8 100644 --- a/tests/field_subclassing/fields.py +++ b/tests/field_subclassing/fields.py @@ -5,14 +5,14 @@ import warnings from django.db import models from django.utils import six -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from django.utils.encoding import force_text, python_2_unicode_compatible -# Catch warning about subfieldbase -- remove in Django 2.0 +# Catch warning about subfieldbase -- remove in Django 1.10 warnings.filterwarnings( 'ignore', 'SubfieldBase has been deprecated. Use Field.from_db_value instead.', - RemovedInDjango20Warning + RemovedInDjango110Warning ) diff --git a/tests/file_storage/tests.py b/tests/file_storage/tests.py index 0800d49038..b489c025bf 100644 --- a/tests/file_storage/tests.py +++ b/tests/file_storage/tests.py @@ -568,13 +568,13 @@ class FileFieldStorageTests(TestCase): str(warns[0].message), 'Backwards compatibility for storage backends without support for ' 'the `max_length` argument in Storage.save() will be removed in ' - 'Django 2.0.' + 'Django 1.10.' ) self.assertEqual( str(warns[1].message), 'Backwards compatibility for storage backends without support for ' 'the `max_length` argument in Storage.get_available_name() will ' - 'be removed in Django 2.0.' + 'be removed in Django 1.10.' ) self.assertEqual(obj.old_style.name, 'tests/deprecated_storage_test.txt') self.assertEqual(obj.old_style.read(), b'Same Content') diff --git a/tests/forms_tests/tests/test_fields.py b/tests/forms_tests/tests/test_fields.py index b082701c11..44ec116c2f 100644 --- a/tests/forms_tests/tests/test_fields.py +++ b/tests/forms_tests/tests/test_fields.py @@ -47,7 +47,7 @@ from django.forms import ( from django.test import SimpleTestCase, ignore_warnings from django.utils import formats, six, translation from django.utils._os import upath -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from django.utils.duration import duration_string try: @@ -490,7 +490,7 @@ class FieldsTests(SimpleTestCase): f = DateField() self.assertRaisesMessage(ValidationError, "'Enter a valid date.'", f.clean, 'a\x00b') - @ignore_warnings(category=RemovedInDjango20Warning) # for _has_changed + @ignore_warnings(category=RemovedInDjango110Warning) # for _has_changed def test_datefield_changed(self): format = '%d/%m/%Y' f = DateField(input_formats=[format]) @@ -669,7 +669,7 @@ class FieldsTests(SimpleTestCase): self.assertRaisesMessage(ValidationError, "'Enter a valid value.'", f.clean, ' 2A2') self.assertRaisesMessage(ValidationError, "'Enter a valid value.'", f.clean, '2A2 ') - @ignore_warnings(category=RemovedInDjango20Warning) # error_message deprecation + @ignore_warnings(category=RemovedInDjango110Warning) # error_message deprecation def test_regexfield_4(self): f = RegexField('^[0-9][0-9][0-9][0-9]$', error_message='Enter a four-digit number.') self.assertEqual('1234', f.clean('1234')) diff --git a/tests/generic_views/test_edit.py b/tests/generic_views/test_edit.py index 4bf3957a48..363743774b 100644 --- a/tests/generic_views/test_edit.py +++ b/tests/generic_views/test_edit.py @@ -7,7 +7,7 @@ from django.core.exceptions import ImproperlyConfigured from django.core.urlresolvers import reverse from django.test import TestCase, ignore_warnings, override_settings from django.test.client import RequestFactory -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from django.views.generic.base import View from django.views.generic.edit import CreateView, FormMixin, ModelFormMixin @@ -70,7 +70,7 @@ class FormMixinTests(TestCase): def get_form(self, form_class): return form_class(**self.get_form_kwargs()) self.assertEqual(len(w), 1) - self.assertEqual(w[0].category, RemovedInDjango20Warning) + self.assertEqual(w[0].category, RemovedInDjango110Warning) self.assertEqual( str(w[0].message), '`generic_views.test_edit.MissingDefaultValue.get_form` method ' @@ -143,7 +143,7 @@ class CreateViewTests(TestCase): self.assertRedirects(res, 'http://testserver/edit/authors/create/') self.assertQuerysetEqual(Author.objects.all(), ['']) - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) def test_create_with_interpolated_redirect(self): res = self.client.post( '/edit/authors/create/interpolate_redirect/', @@ -283,7 +283,7 @@ class UpdateViewTests(TestCase): self.assertRedirects(res, 'http://testserver/edit/authors/create/') self.assertQuerysetEqual(Author.objects.all(), ['']) - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) def test_update_with_interpolated_redirect(self): a = Author.objects.create( name='Randall Munroe', @@ -390,7 +390,7 @@ class DeleteViewTests(TestCase): self.assertRedirects(res, 'http://testserver/edit/authors/create/') self.assertQuerysetEqual(Author.objects.all(), []) - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) def test_delete_with_interpolated_redirect(self): a = Author.objects.create(**{'name': 'Randall Munroe', 'slug': 'randall-munroe'}) res = self.client.post('/edit/author/%d/delete/interpolate_redirect/' % a.pk) diff --git a/tests/gis_tests/geo3d/tests.py b/tests/gis_tests/geo3d/tests.py index 022a8063ab..9d485cca06 100644 --- a/tests/gis_tests/geo3d/tests.py +++ b/tests/gis_tests/geo3d/tests.py @@ -8,7 +8,7 @@ from django.contrib.gis.gdal import HAS_GDAL from django.contrib.gis.geos import HAS_GEOS from django.test import TestCase, ignore_warnings, skipUnlessDBFeature from django.utils._os import upath -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning if HAS_GEOS: from django.contrib.gis.db.models import Union, Extent3D @@ -207,7 +207,7 @@ class Geo3DTest(TestCase): # Ordering of points in the resulting geometry may vary between implementations self.assertSetEqual({p.ewkt for p in ref_union}, {p.ewkt for p in union}) - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) def test_extent(self): """ Testing the Extent3D aggregate for 3D models. diff --git a/tests/gis_tests/geoapp/test_sitemaps.py b/tests/gis_tests/geoapp/test_sitemaps.py index 416166b198..b7aebbb64b 100644 --- a/tests/gis_tests/geoapp/test_sitemaps.py +++ b/tests/gis_tests/geoapp/test_sitemaps.py @@ -11,7 +11,7 @@ from django.test import ( TestCase, ignore_warnings, modify_settings, override_settings, skipUnlessDBFeature, ) -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning if HAS_GEOS: from .models import City, Country @@ -32,7 +32,7 @@ class GeoSitemapTest(TestCase): expected = set(expected) self.assertEqual(actual, expected) - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) def test_geositemap_kml(self): "Tests KML/KMZ geographic sitemaps." for kml_type in ('kml', 'kmz'): diff --git a/tests/gis_tests/geoapp/tests.py b/tests/gis_tests/geoapp/tests.py index 0acc2bd210..0ba7dc7712 100644 --- a/tests/gis_tests/geoapp/tests.py +++ b/tests/gis_tests/geoapp/tests.py @@ -9,7 +9,7 @@ from django.core.management import call_command from django.db import connection from django.test import TestCase, ignore_warnings, skipUnlessDBFeature from django.utils import six -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from ..utils import no_oracle, oracle, postgis, spatialite @@ -488,7 +488,7 @@ class GeoQuerySetTest(TestCase): self.assertIsInstance(country.envelope, Polygon) @skipUnlessDBFeature("supports_extent_aggr") - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) def test_extent(self): """ Testing the (deprecated) `extent` GeoQuerySet method and the Extent @@ -646,7 +646,7 @@ class GeoQuerySetTest(TestCase): for ptown in [ptown1, ptown2]: self.assertEqual('-104.609252,38.255001', ptown.kml) - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) def test_make_line(self): """ Testing the (deprecated) `make_line` GeoQuerySet method and the MakeLine @@ -862,7 +862,7 @@ class GeoQuerySetTest(TestCase): # but this seems unexpected and should be investigated to determine the cause. @skipUnlessDBFeature("has_unionagg_method") @no_oracle - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) def test_unionagg(self): """ Testing the (deprecated) `unionagg` (aggregate union) GeoQuerySet method diff --git a/tests/gis_tests/relatedapp/tests.py b/tests/gis_tests/relatedapp/tests.py index 5513def0f1..f2974720fb 100644 --- a/tests/gis_tests/relatedapp/tests.py +++ b/tests/gis_tests/relatedapp/tests.py @@ -5,7 +5,7 @@ from django.db import connection from django.test import TestCase, ignore_warnings, skipUnlessDBFeature from django.test.utils import override_settings from django.utils import timezone -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from ..utils import no_oracle @@ -66,7 +66,7 @@ class RelatedGeoModelTest(TestCase): check_pnt(GEOSGeometry(wkt, srid), qs[0].location.point) @skipUnlessDBFeature("supports_extent_aggr") - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) def test_related_extent_aggregate(self): "Testing the `extent` GeoQuerySet aggregates on related geographic models." # This combines the Extent and Union aggregates into one query @@ -100,7 +100,7 @@ class RelatedGeoModelTest(TestCase): ) @skipUnlessDBFeature("has_unionagg_method") - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) def test_related_union_aggregate(self): "Testing the `unionagg` GeoQuerySet aggregates on related geographic models." # This combines the Extent and Union aggregates into one query @@ -294,7 +294,7 @@ class RelatedGeoModelTest(TestCase): self.assertIsNone(b.author) @skipUnlessDBFeature("supports_collect_aggr") - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) def test_collect(self): """ Testing the (deprecated) `collect` GeoQuerySet method and `Collect` diff --git a/tests/i18n/urls.py b/tests/i18n/urls.py index d63499f1bb..2485d1d11a 100644 --- a/tests/i18n/urls.py +++ b/tests/i18n/urls.py @@ -3,12 +3,12 @@ from __future__ import unicode_literals from django.conf.urls.i18n import i18n_patterns from django.http import HttpResponse, StreamingHttpResponse from django.test import ignore_warnings -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from django.utils.translation import ugettext_lazy as _ # test deprecated version of i18n_patterns() function (with prefix). Remove it -# and convert to list of urls() in Django 2.0 -i18n_patterns = ignore_warnings(category=RemovedInDjango20Warning)(i18n_patterns) +# and convert to list of urls() in Django 1.10 +i18n_patterns = ignore_warnings(category=RemovedInDjango110Warning)(i18n_patterns) urlpatterns = i18n_patterns('', (r'^simple/$', lambda r: HttpResponse()), diff --git a/tests/indexes/tests.py b/tests/indexes/tests.py index 1d60f215fe..12640d1866 100644 --- a/tests/indexes/tests.py +++ b/tests/indexes/tests.py @@ -3,12 +3,12 @@ from unittest import skipUnless from django.core.management.color import no_style from django.db import connection from django.test import TestCase, ignore_warnings -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from .models import Article, ArticleTranslation, IndexTogetherSingleList -@ignore_warnings(category=RemovedInDjango20Warning) +@ignore_warnings(category=RemovedInDjango110Warning) class CreationIndexesTests(TestCase): """ Test index handling by the to-be-deprecated connection.creation interface. diff --git a/tests/migrations/test_commands.py b/tests/migrations/test_commands.py index c8cf814e43..02a533aacd 100644 --- a/tests/migrations/test_commands.py +++ b/tests/migrations/test_commands.py @@ -12,7 +12,7 @@ from django.db import DatabaseError, connection, models from django.db.migrations import questioner from django.test import ignore_warnings, mock, override_settings from django.utils import six -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from django.utils.encoding import force_text from .models import UnicodeModel, UnserializableModel @@ -119,7 +119,7 @@ class MigrateTests(MigrationTestBase): with self.assertRaisesMessage(CommandError, "Conflicting migrations detected"): call_command("migrate", "migrations") - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) @override_settings(MIGRATION_MODULES={"migrations": "migrations.test_migrations"}) def test_migrate_list(self): """ diff --git a/tests/model_meta/test_legacy.py b/tests/model_meta/test_legacy.py index c319f28fcc..686aefd6d4 100644 --- a/tests/model_meta/test_legacy.py +++ b/tests/model_meta/test_legacy.py @@ -4,7 +4,7 @@ from django import test from django.contrib.contenttypes.fields import GenericRelation from django.core.exceptions import FieldDoesNotExist from django.db.models.fields import CharField, related -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from .models import BasePerson, Person from .results import TEST_RESULTS @@ -26,11 +26,11 @@ class M2MTests(OptionsBaseTests): with warnings.catch_warnings(record=True) as warning: warnings.simplefilter("always") models = [model for field, model in model._meta.get_m2m_with_model()] - self.assertEqual([RemovedInDjango20Warning], [w.message.__class__ for w in warning]) + self.assertEqual([RemovedInDjango110Warning], [w.message.__class__ for w in warning]) self.assertEqual(models, expected_result) -@test.ignore_warnings(category=RemovedInDjango20Warning) +@test.ignore_warnings(category=RemovedInDjango110Warning) class RelatedObjectsTests(OptionsBaseTests): key_name = lambda self, r: r[0] @@ -83,7 +83,7 @@ class RelatedObjectsTests(OptionsBaseTests): ) -@test.ignore_warnings(category=RemovedInDjango20Warning) +@test.ignore_warnings(category=RemovedInDjango110Warning) class RelatedM2MTests(OptionsBaseTests): def test_related_m2m_with_model(self): @@ -111,7 +111,7 @@ class RelatedM2MTests(OptionsBaseTests): self.assertIn('friends_inherited_rel_+', [o.field.related_query_name() for o in related_m2m]) -@test.ignore_warnings(category=RemovedInDjango20Warning) +@test.ignore_warnings(category=RemovedInDjango110Warning) class GetFieldByNameTests(OptionsBaseTests): def test_get_data_field(self): @@ -149,15 +149,15 @@ class GetFieldByNameTests(OptionsBaseTests): ) self.assertEqual(Person._meta.get_field('m2m_base', many_to_many=True).name, 'm2m_base') - # 2 RemovedInDjango20Warning messages should be raised, one for each call of get_field() + # 2 RemovedInDjango110Warning messages should be raised, one for each call of get_field() # with the 'many_to_many' argument. self.assertEqual( - [RemovedInDjango20Warning, RemovedInDjango20Warning], + [RemovedInDjango110Warning, RemovedInDjango110Warning], [w.message.__class__ for w in warning] ) -@test.ignore_warnings(category=RemovedInDjango20Warning) +@test.ignore_warnings(category=RemovedInDjango110Warning) class GetAllFieldNamesTestCase(OptionsBaseTests): def test_get_all_field_names(self): diff --git a/tests/multiple_database/tests.py b/tests/multiple_database/tests.py index f5ce93fd8d..cad410baff 100644 --- a/tests/multiple_database/tests.py +++ b/tests/multiple_database/tests.py @@ -931,7 +931,7 @@ class RouterTestCase(TestCase): def allow_migrate(self, db, model): """ Deprecated allow_migrate signature should trigger - RemovedInDjango20Warning. + RemovedInDjango110Warning. """ assert db == 'default' assert model is User @@ -945,7 +945,7 @@ class RouterTestCase(TestCase): "The signature of allow_migrate has changed from " "allow_migrate(self, db, model) to " "allow_migrate(self, db, app_label, model_name=None, **hints). " - "Support for the old signature will be removed in Django 2.0." + "Support for the old signature will be removed in Django 1.10." ) self.assertTrue(router.allow_migrate_model('default', User)) diff --git a/tests/resolve_url/tests.py b/tests/resolve_url/tests.py index b8ccd530e1..c066f0f940 100644 --- a/tests/resolve_url/tests.py +++ b/tests/resolve_url/tests.py @@ -5,7 +5,7 @@ from django.core.urlresolvers import NoReverseMatch, reverse_lazy from django.shortcuts import resolve_url from django.test import TestCase, ignore_warnings, override_settings from django.utils import six -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from .models import UnimportantThing @@ -66,7 +66,7 @@ class ResolveUrlTests(TestCase): self.assertIsInstance(resolved_url, six.text_type) self.assertEqual('/accounts/logout/', resolved_url) - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) def test_valid_view_name(self): """ Tests that passing a view function to ``resolve_url`` will result in diff --git a/tests/runtests.py b/tests/runtests.py index 317b54a95a..dc7f7c9532 100755 --- a/tests/runtests.py +++ b/tests/runtests.py @@ -17,11 +17,11 @@ from django.test.utils import get_runner from django.utils import six from django.utils._os import upath from django.utils.deprecation import ( - RemovedInDjango19Warning, RemovedInDjango20Warning, + RemovedInDjango19Warning, RemovedInDjango110Warning, ) warnings.simplefilter("error", RemovedInDjango19Warning) -warnings.simplefilter("error", RemovedInDjango20Warning) +warnings.simplefilter("error", RemovedInDjango110Warning) RUNTESTS_DIR = os.path.abspath(os.path.dirname(upath(__file__))) @@ -111,7 +111,7 @@ def setup(verbosity, test_labels): state = { 'INSTALLED_APPS': settings.INSTALLED_APPS, 'ROOT_URLCONF': getattr(settings, "ROOT_URLCONF", ""), - # Remove the following line in Django 2.0. + # Remove the following line in Django 1.10. 'TEMPLATE_DIRS': settings.TEMPLATE_DIRS, 'TEMPLATES': settings.TEMPLATES, 'LANGUAGE_CODE': settings.LANGUAGE_CODE, @@ -125,7 +125,7 @@ def setup(verbosity, test_labels): settings.ROOT_URLCONF = 'urls' settings.STATIC_URL = '/static/' settings.STATIC_ROOT = os.path.join(TMPDIR, 'static') - # Remove the following line in Django 2.0. + # Remove the following line in Django 1.10. settings.TEMPLATE_DIRS = (TEMPLATE_DIR,) settings.TEMPLATES = [{ 'BACKEND': 'django.template.backends.django.DjangoTemplates', @@ -162,8 +162,8 @@ def setup(verbosity, test_labels): warnings.filterwarnings( 'ignore', - 'django.contrib.webdesign will be removed in Django 2.0.', - RemovedInDjango20Warning + 'django.contrib.webdesign will be removed in Django 1.10.', + RemovedInDjango110Warning ) # Load all the ALWAYS_INSTALLED_APPS. diff --git a/tests/settings_tests/tests.py b/tests/settings_tests/tests.py index 4ed58be824..ee46f98537 100644 --- a/tests/settings_tests/tests.py +++ b/tests/settings_tests/tests.py @@ -487,7 +487,7 @@ class TestSessionVerification(unittest.TestCase): Settings('fake_settings_module') self.assertEqual( force_text(warn[0].message), - "Session verification will become mandatory in Django 2.0. " + "Session verification will become mandatory in Django 1.10. " "Please add 'django.contrib.auth.middleware.SessionAuthenticationMiddleware' " "to your MIDDLEWARE_CLASSES setting when you are ready to opt-in after " "reading the upgrade considerations in the 1.8 release notes.", diff --git a/tests/shortcuts/tests.py b/tests/shortcuts/tests.py index 08bcc55343..8bb50c8f6c 100644 --- a/tests/shortcuts/tests.py +++ b/tests/shortcuts/tests.py @@ -1,6 +1,6 @@ from django.test import TestCase, ignore_warnings, override_settings from django.test.utils import require_jinja2 -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning @override_settings( @@ -19,7 +19,7 @@ class ShortcutTests(TestCase): self.assertEqual(response.status_code, 200) self.assertEqual(response.content, b'FOO.BAR..\n') - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) def test_render_to_response_with_request_context(self): response = self.client.get('/render_to_response/request_context/') self.assertEqual(response.status_code, 200) @@ -32,7 +32,7 @@ class ShortcutTests(TestCase): self.assertEqual(response.content, b'FOO.BAR..\n') self.assertEqual(response['Content-Type'], 'application/x-rendertest') - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) def test_render_to_response_with_dirs(self): response = self.client.get('/render_to_response/dirs/') self.assertEqual(response.status_code, 200) @@ -53,7 +53,7 @@ class ShortcutTests(TestCase): response = self.client.get('/render_to_response/using/?using=jinja2') self.assertEqual(response.content, b'Jinja2\n') - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) def test_render_to_response_with_context_instance_misuse(self): """ For backwards-compatibility, ensure that it's possible to pass a @@ -75,7 +75,7 @@ class ShortcutTests(TestCase): self.assertEqual(response.status_code, 200) self.assertEqual(response.content, b'FOO.BAR../render/multiple_templates/\n') - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) def test_render_with_base_context(self): response = self.client.get('/render/base_context/') self.assertEqual(response.status_code, 200) @@ -102,19 +102,19 @@ class ShortcutTests(TestCase): response = self.client.get('/render/using/?using=jinja2') self.assertEqual(response.content, b'Jinja2\n') - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) def test_render_with_current_app(self): response = self.client.get('/render/current_app/') self.assertEqual(response.context.request.current_app, "foobar_app") - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) def test_render_with_dirs(self): response = self.client.get('/render/dirs/') self.assertEqual(response.status_code, 200) self.assertEqual(response.content, b'spam eggs\n') self.assertEqual(response['Content-Type'], 'text/html; charset=utf-8') - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) def test_render_with_current_app_conflict(self): with self.assertRaises(ValueError): self.client.get('/render/current_app_conflict/') diff --git a/tests/sitemaps_tests/test_http.py b/tests/sitemaps_tests/test_http.py index 2817f844d6..a6bc46e03a 100644 --- a/tests/sitemaps_tests/test_http.py +++ b/tests/sitemaps_tests/test_http.py @@ -11,7 +11,7 @@ from django.contrib.sites.models import Site from django.core.exceptions import ImproperlyConfigured from django.test import ignore_warnings, modify_settings, override_settings from django.utils._os import upath -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from django.utils.formats import localize from django.utils.translation import activate, deactivate @@ -21,7 +21,7 @@ from .models import TestModel class HTTPSitemapTests(SitemapTestsBase): - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) def test_simple_sitemap_index(self): "A simple sitemap index can be rendered" # The URL for views.sitemap in tests/urls/http.py has been updated @@ -38,7 +38,7 @@ class HTTPSitemapTests(SitemapTestsBase): """ % self.base_url self.assertXMLEqual(response.content.decode('utf-8'), expected_content) - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) @override_settings(TEMPLATES=[{ 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [os.path.join(os.path.dirname(upath(__file__)), 'templates')], @@ -194,7 +194,7 @@ class HTTPSitemapTests(SitemapTestsBase): """ % self.base_url self.assertXMLEqual(response.content.decode('utf-8'), expected_content) - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) def test_x_robots_sitemap(self): # The URL for views.sitemap in tests/urls/http.py has been updated # with a name but since reversing by Python path is tried first diff --git a/tests/sitemaps_tests/test_https.py b/tests/sitemaps_tests/test_https.py index f7b363dfe2..b3bcdc172b 100644 --- a/tests/sitemaps_tests/test_https.py +++ b/tests/sitemaps_tests/test_https.py @@ -3,7 +3,7 @@ from __future__ import unicode_literals from datetime import date from django.test import ignore_warnings, override_settings -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from .base import SitemapTestsBase @@ -12,7 +12,7 @@ from .base import SitemapTestsBase class HTTPSSitemapTests(SitemapTestsBase): protocol = 'https' - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) def test_secure_sitemap_index(self): "A secure sitemap index can be rendered" # The URL for views.sitemap in tests/urls/https.py has been updated @@ -44,7 +44,7 @@ class HTTPSSitemapTests(SitemapTestsBase): class HTTPSDetectionSitemapTests(SitemapTestsBase): extra = {'wsgi.url_scheme': 'https'} - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) def test_sitemap_index_with_https_request(self): "A sitemap index requested in HTTPS is rendered with HTTPS links" # The URL for views.sitemap in tests/urls/https.py has been updated diff --git a/tests/template_backends/test_django.py b/tests/template_backends/test_django.py index a8cc0d58b8..3aecaa30b5 100644 --- a/tests/template_backends/test_django.py +++ b/tests/template_backends/test_django.py @@ -3,7 +3,7 @@ from template_tests.test_response import test_processor_name from django.template import RequestContext from django.template.backends.django import DjangoTemplates from django.test import RequestFactory, ignore_warnings -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from .test_dummy import TemplateStringsTests @@ -35,7 +35,7 @@ class DjangoTemplatesTests(TemplateStringsTests): content = template.render({'processors': 'no'}, request) self.assertEqual(content, 'no') - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) def test_request_context_conflicts_with_request(self): template = self.engine.from_string('hello') diff --git a/tests/template_tests/filter_tests/test_removetags.py b/tests/template_tests/filter_tests/test_removetags.py index 4b3dd161e7..9cc6c5a4f9 100644 --- a/tests/template_tests/filter_tests/test_removetags.py +++ b/tests/template_tests/filter_tests/test_removetags.py @@ -1,12 +1,12 @@ from django.template.defaultfilters import removetags from django.test import SimpleTestCase, ignore_warnings -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from django.utils.safestring import mark_safe from ..utils import setup -@ignore_warnings(category=RemovedInDjango20Warning) +@ignore_warnings(category=RemovedInDjango110Warning) class RemovetagsTests(SimpleTestCase): @setup({'removetags01': '{{ a|removetags:"a b" }} {{ b|removetags:"a b" }}'}) @@ -33,7 +33,7 @@ class RemovetagsTests(SimpleTestCase): self.assertEqual(output, 'x

y

x

y

') -@ignore_warnings(category=RemovedInDjango20Warning) +@ignore_warnings(category=RemovedInDjango110Warning) class FunctionTests(SimpleTestCase): def test_removetags(self): diff --git a/tests/template_tests/filter_tests/test_unordered_list.py b/tests/template_tests/filter_tests/test_unordered_list.py index 815d488347..77e5bab0c6 100644 --- a/tests/template_tests/filter_tests/test_unordered_list.py +++ b/tests/template_tests/filter_tests/test_unordered_list.py @@ -1,6 +1,6 @@ from django.template.defaultfilters import unordered_list from django.test import SimpleTestCase, ignore_warnings -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from django.utils.encoding import python_2_unicode_compatible from django.utils.safestring import mark_safe @@ -14,7 +14,7 @@ class UnorderedListTests(SimpleTestCase): output = self.engine.render_to_string('unordered_list01', {'a': ['x>', ['x>\n\t
    \n\t\t
  • <y
  • \n\t
\n\t') - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) @setup({'unordered_list02': '{% autoescape off %}{{ a|unordered_list }}{% endautoescape %}'}) def test_unordered_list02(self): output = self.engine.render_to_string('unordered_list02', {'a': ['x>', ['x>\n\t
    \n\t\t
  • \n\t
\n\t') -@ignore_warnings(category=RemovedInDjango20Warning) +@ignore_warnings(category=RemovedInDjango110Warning) class DeprecatedUnorderedListSyntaxTests(SimpleTestCase): @setup({'unordered_list01': '{{ a|unordered_list }}'}) @@ -165,7 +165,7 @@ class FunctionTests(SimpleTestCase): '\t
  • ulitem-a
  • \n\t
  • ulitem-b
  • \n\t
  • ulitem-c
  • ', ) - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) def test_legacy(self): """ Old format for unordered lists should still work diff --git a/tests/template_tests/syntax_tests/test_cycle.py b/tests/template_tests/syntax_tests/test_cycle.py index 88a7187b1a..b5f53028c0 100644 --- a/tests/template_tests/syntax_tests/test_cycle.py +++ b/tests/template_tests/syntax_tests/test_cycle.py @@ -1,6 +1,6 @@ from django.template import TemplateSyntaxError from django.test import SimpleTestCase, ignore_warnings -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from ..utils import setup @@ -139,20 +139,20 @@ class CycleTagTests(SimpleTestCase): output = self.engine.render_to_string('cycle25', {'a': '<'}) self.assertEqual(output, '<') - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) @setup({'cycle26': '{% load cycle from future %}{% cycle a b as ab %}{% cycle ab %}'}) def test_cycle26(self): output = self.engine.render_to_string('cycle26', {'a': '<', 'b': '>'}) self.assertEqual(output, '<>') - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) @setup({'cycle27': '{% load cycle from future %}' '{% autoescape off %}{% cycle a b as ab %}{% cycle ab %}{% endautoescape %}'}) def test_cycle27(self): output = self.engine.render_to_string('cycle27', {'a': '<', 'b': '>'}) self.assertEqual(output, '<>') - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) @setup({'cycle28': '{% load cycle from future %}{% cycle a|safe b as ab %}{% cycle ab %}'}) def test_cycle28(self): output = self.engine.render_to_string('cycle28', {'a': '<', 'b': '>'}) diff --git a/tests/template_tests/syntax_tests/test_firstof.py b/tests/template_tests/syntax_tests/test_firstof.py index 2c227f2304..81e81540e2 100644 --- a/tests/template_tests/syntax_tests/test_firstof.py +++ b/tests/template_tests/syntax_tests/test_firstof.py @@ -1,6 +1,6 @@ from django.template import TemplateSyntaxError from django.test import SimpleTestCase, ignore_warnings -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from ..utils import setup @@ -57,26 +57,26 @@ class FirstOfTagTests(SimpleTestCase): output = self.engine.render_to_string('firstof10', {'a': '<'}) self.assertEqual(output, '<') - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) @setup({'firstof11': '{% load firstof from future %}{% firstof a b %}'}) def test_firstof11(self): output = self.engine.render_to_string('firstof11', {'a': '<', 'b': '>'}) self.assertEqual(output, '<') - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) @setup({'firstof12': '{% load firstof from future %}{% firstof a b %}'}) def test_firstof12(self): output = self.engine.render_to_string('firstof12', {'a': '', 'b': '>'}) self.assertEqual(output, '>') - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) @setup({'firstof13': '{% load firstof from future %}' '{% autoescape off %}{% firstof a %}{% endautoescape %}'}) def test_firstof13(self): output = self.engine.render_to_string('firstof13', {'a': '<'}) self.assertEqual(output, '<') - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) @setup({'firstof14': '{% load firstof from future %}{% firstof a|safe b %}'}) def test_firstof14(self): output = self.engine.render_to_string('firstof14', {'a': '<'}) diff --git a/tests/template_tests/syntax_tests/test_for.py b/tests/template_tests/syntax_tests/test_for.py index 566b86f3d8..6883ea09cf 100644 --- a/tests/template_tests/syntax_tests/test_for.py +++ b/tests/template_tests/syntax_tests/test_for.py @@ -1,6 +1,6 @@ from django.template import TemplateSyntaxError from django.test import SimpleTestCase, ignore_warnings -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from ..utils import setup @@ -125,9 +125,9 @@ class ForTagTests(SimpleTestCase): self.assertEqual(output, 'abc') # These tests raise deprecation warnings and will raise an exception - # in Django 2.0. The existing behavior is silent truncation if the + # in Django 1.10. The existing behavior is silent truncation if the # length of loopvars differs to the length of each set of items. - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) @setup({'for-tag-unpack10': '{% for x,y in items %}{{ x }}:{{ y }}/{% endfor %}'}) def test_for_tag_unpack10(self): output = self.engine.render_to_string( @@ -136,7 +136,7 @@ class ForTagTests(SimpleTestCase): ) self.assertEqual(output, 'one:1/two:2/') - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) @setup({'for-tag-unpack11': '{% for x,y,z in items %}{{ x }}:{{ y }},{{ z }}/{% endfor %}'}) def test_for_tag_unpack11(self): output = self.engine.render_to_string( @@ -149,7 +149,7 @@ class ForTagTests(SimpleTestCase): else: self.assertEqual(output, 'one:1,/two:2,/') - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) @setup({'for-tag-unpack12': '{% for x,y,z in items %}{{ x }}:{{ y }},{{ z }}/{% endfor %}'}) def test_for_tag_unpack12(self): output = self.engine.render_to_string( @@ -161,7 +161,7 @@ class ForTagTests(SimpleTestCase): else: self.assertEqual(output, 'one:1,carrot/two:2,/') - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) @setup({'for-tag-unpack14': '{% for x,y in items %}{{ x }}:{{ y }}/{% endfor %}'}) def test_for_tag_unpack14(self): output = self.engine.render_to_string('for-tag-unpack14', {'items': (1, 2)}) diff --git a/tests/template_tests/syntax_tests/test_if.py b/tests/template_tests/syntax_tests/test_if.py index 290a092a04..6bbf2598a1 100644 --- a/tests/template_tests/syntax_tests/test_if.py +++ b/tests/template_tests/syntax_tests/test_if.py @@ -3,7 +3,7 @@ import warnings from django.template import TemplateSyntaxError from django.test import SimpleTestCase, ignore_warnings from django.test.utils import reset_warning_registry -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from ..utils import TestObj, setup @@ -537,15 +537,15 @@ class IfTagTests(SimpleTestCase): self.assertEqual(len(warns), 1) self.assertEqual( str(warns[0].message), - "Operator '=' is deprecated and will be removed in Django 2.0. " + "Operator '=' is deprecated and will be removed in Django 1.10. " "Use '==' instead." ) -@ignore_warnings(category=RemovedInDjango20Warning) +@ignore_warnings(category=RemovedInDjango110Warning) class TestEqualitySingleEqualsSign(SimpleTestCase): # The following tests should be changed to template.TemplateSyntaxError - # (or simply removed) when the deprecation path ends in Django 2.0. + # (or simply removed) when the deprecation path ends in Django 1.10. @setup({'if-tag-eq01': '{% if foo = bar %}yes{% else %}no{% endif %}'}) def test_if_tag_eq01(self): output = self.engine.render_to_string('if-tag-eq01', {'foo': 1}) diff --git a/tests/template_tests/syntax_tests/test_ssi.py b/tests/template_tests/syntax_tests/test_ssi.py index c650889020..ea8ac71ec9 100644 --- a/tests/template_tests/syntax_tests/test_ssi.py +++ b/tests/template_tests/syntax_tests/test_ssi.py @@ -5,13 +5,13 @@ import os from django.template import Context, Engine from django.test import SimpleTestCase, ignore_warnings from django.utils.deprecation import ( - RemovedInDjango19Warning, RemovedInDjango20Warning, + RemovedInDjango19Warning, RemovedInDjango110Warning, ) from ..utils import ROOT, setup -@ignore_warnings(category=RemovedInDjango20Warning) +@ignore_warnings(category=RemovedInDjango110Warning) class SsiTagTests(SimpleTestCase): # Test normal behavior @@ -85,7 +85,7 @@ class SsiTagTests(SimpleTestCase): 'with spaces in its name. Look ma! It parsed!\n') -@ignore_warnings(category=RemovedInDjango20Warning) +@ignore_warnings(category=RemovedInDjango110Warning) class SSISecurityTests(SimpleTestCase): def setUp(self): diff --git a/tests/template_tests/syntax_tests/test_url.py b/tests/template_tests/syntax_tests/test_url.py index 8da4dba67b..d593591480 100644 --- a/tests/template_tests/syntax_tests/test_url.py +++ b/tests/template_tests/syntax_tests/test_url.py @@ -2,7 +2,7 @@ from django.core.urlresolvers import NoReverseMatch from django.template import TemplateSyntaxError from django.test import SimpleTestCase, ignore_warnings, override_settings -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from ..utils import setup @@ -11,37 +11,37 @@ from ..utils import setup class UrlTagTests(SimpleTestCase): # Successes - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) @setup({'url01': '{% url "template_tests.views.client" client.id %}'}) def test_url01(self): output = self.engine.render_to_string('url01', {'client': {'id': 1}}) self.assertEqual(output, '/client/1/') - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) @setup({'url02': '{% url "template_tests.views.client_action" id=client.id action="update" %}'}) def test_url02(self): output = self.engine.render_to_string('url02', {'client': {'id': 1}}) self.assertEqual(output, '/client/1/update/') - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) @setup({'url02a': '{% url "template_tests.views.client_action" client.id "update" %}'}) def test_url02a(self): output = self.engine.render_to_string('url02a', {'client': {'id': 1}}) self.assertEqual(output, '/client/1/update/') - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) @setup({'url02b': "{% url 'template_tests.views.client_action' id=client.id action='update' %}"}) def test_url02b(self): output = self.engine.render_to_string('url02b', {'client': {'id': 1}}) self.assertEqual(output, '/client/1/update/') - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) @setup({'url02c': "{% url 'template_tests.views.client_action' client.id 'update' %}"}) def test_url02c(self): output = self.engine.render_to_string('url02c', {'client': {'id': 1}}) self.assertEqual(output, '/client/1/update/') - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) @setup({'url03': '{% url "template_tests.views.index" %}'}) def test_url03(self): output = self.engine.render_to_string('url03') @@ -62,7 +62,7 @@ class UrlTagTests(SimpleTestCase): output = self.engine.render_to_string('url06', {'v': 'Ω'}) self.assertEqual(output, '/%D0%AE%D0%BD%D0%B8%D0%BA%D0%BE%D0%B4/%CE%A9/') - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) @setup({'url07': '{% url "template_tests.views.client2" tag=v %}'}) def test_url07(self): output = self.engine.render_to_string('url07', {'v': 'Ω'}) @@ -78,13 +78,13 @@ class UrlTagTests(SimpleTestCase): output = self.engine.render_to_string('url09', {'v': 'Ω'}) self.assertEqual(output, '/%D0%AE%D0%BD%D0%B8%D0%BA%D0%BE%D0%B4/%CE%A9/') - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) @setup({'url10': '{% url "template_tests.views.client_action" id=client.id action="two words" %}'}) def test_url10(self): output = self.engine.render_to_string('url10', {'client': {'id': 1}}) self.assertEqual(output, '/client/1/two%20words/') - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) @setup({'url11': '{% url "template_tests.views.client_action" id=client.id action="==" %}'}) def test_url11(self): output = self.engine.render_to_string('url11', {'client': {'id': 1}}) @@ -92,37 +92,37 @@ class UrlTagTests(SimpleTestCase): @setup({'url12': '{% url "template_tests.views.client_action" ' 'id=client.id action="!$&\'()*+,;=~:@," %}'}) - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) def test_url12(self): output = self.engine.render_to_string('url12', {'client': {'id': 1}}) self.assertEqual(output, '/client/1/!$&\'()*+,;=~:@,/') - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) @setup({'url13': '{% url "template_tests.views.client_action" ' 'id=client.id action=arg|join:"-" %}'}) def test_url13(self): output = self.engine.render_to_string('url13', {'client': {'id': 1}, 'arg': ['a', 'b']}) self.assertEqual(output, '/client/1/a-b/') - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) @setup({'url14': '{% url "template_tests.views.client_action" client.id arg|join:"-" %}'}) def test_url14(self): output = self.engine.render_to_string('url14', {'client': {'id': 1}, 'arg': ['a', 'b']}) self.assertEqual(output, '/client/1/a-b/') - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) @setup({'url15': '{% url "template_tests.views.client_action" 12 "test" %}'}) def test_url15(self): output = self.engine.render_to_string('url15') self.assertEqual(output, '/client/12/test/') - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) @setup({'url18': '{% url "template_tests.views.client" "1,2" %}'}) def test_url18(self): output = self.engine.render_to_string('url18') self.assertEqual(output, '/client/1,2/') - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) @setup({'url19': '{% url named_url client.id %}'}) def test_url19(self): output = self.engine.render_to_string('url19', {'client': {'id': 1}, 'named_url': 'template_tests.views.client'}) @@ -144,7 +144,7 @@ class UrlTagTests(SimpleTestCase): with self.assertRaises(NoReverseMatch): self.engine.render_to_string('url-fail02') - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) @setup({'url-fail03': '{% url "template_tests.views.client" %}'}) def test_url_fail03(self): with self.assertRaises(NoReverseMatch): @@ -190,7 +190,7 @@ class UrlTagTests(SimpleTestCase): with self.assertRaises(NoReverseMatch): self.engine.render_to_string('url-fail12', {'named_url': 'no_such_view'}) - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) @setup({'url-fail13': '{% url named_url %}'}) def test_url_fail13(self): with self.assertRaises(NoReverseMatch): @@ -227,13 +227,13 @@ class UrlTagTests(SimpleTestCase): self.engine.render_to_string('url-fail19', {'named_url': 'view'}) # {% url ... as var %} - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) @setup({'url-asvar01': '{% url "template_tests.views.index" as url %}'}) def test_url_asvar01(self): output = self.engine.render_to_string('url-asvar01') self.assertEqual(output, '') - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) @setup({'url-asvar02': '{% url "template_tests.views.index" as url %}{{ url }}'}) def test_url_asvar02(self): output = self.engine.render_to_string('url-asvar02') diff --git a/tests/template_tests/test_custom.py b/tests/template_tests/test_custom.py index fa485bb674..9130697c6a 100644 --- a/tests/template_tests/test_custom.py +++ b/tests/template_tests/test_custom.py @@ -7,7 +7,7 @@ from django.template.base import Node from django.test import SimpleTestCase, ignore_warnings from django.test.utils import extend_sys_path from django.utils import six -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from .templatetags import custom, inclusion from .utils import ROOT @@ -249,7 +249,7 @@ class CustomTagTests(SimpleTestCase): self.verify_tag(inclusion.inclusion_tag_current_app, 'inclusion_tag_current_app') self.verify_tag(inclusion.inclusion_unlimited_args_kwargs, 'inclusion_unlimited_args_kwargs') - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) def test_15070_current_app(self): """ Test that inclusion tag passes down `current_app` of context to the diff --git a/tests/template_tests/test_engine.py b/tests/template_tests/test_engine.py index 77f3c995b5..03bbe55287 100644 --- a/tests/template_tests/test_engine.py +++ b/tests/template_tests/test_engine.py @@ -3,14 +3,14 @@ import os from django.template import Context from django.template.engine import Engine from django.test import SimpleTestCase, ignore_warnings -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from .utils import ROOT, TEMPLATE_DIR OTHER_DIR = os.path.join(ROOT, 'other_templates') -@ignore_warnings(category=RemovedInDjango20Warning) +@ignore_warnings(category=RemovedInDjango110Warning) class DeprecatedRenderToStringTest(SimpleTestCase): def setUp(self): @@ -100,7 +100,7 @@ class LoaderTests(SimpleTestCase): self.assertEqual(template.render(Context()), 'priority\n') -@ignore_warnings(category=RemovedInDjango20Warning) +@ignore_warnings(category=RemovedInDjango110Warning) class TemplateDirsOverrideTests(SimpleTestCase): DIRS = ((OTHER_DIR, ), [OTHER_DIR]) diff --git a/tests/template_tests/test_response.py b/tests/template_tests/test_response.py index 22863b49fc..69133b0708 100644 --- a/tests/template_tests/test_response.py +++ b/tests/template_tests/test_response.py @@ -13,7 +13,7 @@ from django.test import ( RequestFactory, SimpleTestCase, ignore_warnings, override_settings, ) from django.test.utils import require_jinja2 -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from .utils import TEMPLATE_DIR @@ -118,7 +118,7 @@ class SimpleTemplateResponseTest(SimpleTestCase): response.render() self.assertEqual(response.content, b'bar') - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) def test_context_instance(self): response = self._response('{{ foo }}{{ processors }}', Context({'foo': 'bar'})) @@ -248,7 +248,7 @@ class TemplateResponseTest(SimpleTestCase): {'foo': 'bar'}).render() self.assertEqual(response.content, b'baryes') - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) def test_render_with_context(self): response = self._response('{{ foo }}{{ processors }}', Context({'foo': 'bar'})).render() @@ -282,7 +282,7 @@ class TemplateResponseTest(SimpleTestCase): response = TemplateResponse(request, 'template_tests/using.html', using='jinja2').render() self.assertEqual(response.content, b'Jinja2\n') - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) def test_custom_app(self): self._response('{{ foo }}', current_app="foobar") self.assertEqual(self._request.current_app, 'foobar') diff --git a/tests/test_client_regress/tests.py b/tests/test_client_regress/tests.py index 3ac3e7cecc..6a52461f93 100644 --- a/tests/test_client_regress/tests.py +++ b/tests/test_client_regress/tests.py @@ -18,7 +18,7 @@ from django.test.client import RedirectCycleError, RequestFactory, encode_file from django.test.utils import ContextList, str_prefix from django.utils._os import upath from django.utils.deprecation import ( - RemovedInDjango19Warning, RemovedInDjango20Warning, + RemovedInDjango19Warning, RemovedInDjango110Warning, ) from django.utils.translation import ugettext_lazy @@ -1003,7 +1003,7 @@ class ContextTests(TestCase): 'python', 'dolly'}, l.keys()) - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) def test_15368(self): # Need to insert a context processor that assumes certain things about # the request instance. This triggers a bug caused by some ways of diff --git a/tests/urlpatterns_reverse/erroneous_urls.py b/tests/urlpatterns_reverse/erroneous_urls.py index b08376dc91..da4dd98e58 100644 --- a/tests/urlpatterns_reverse/erroneous_urls.py +++ b/tests/urlpatterns_reverse/erroneous_urls.py @@ -1,15 +1,15 @@ import warnings from django.conf.urls import url -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from . import views # Test deprecated behavior of passing strings as view to url(). -# Some of these can be removed in Django 2.0 as they aren't convertable to +# Some of these can be removed in Django 1.10 as they aren't convertable to # callables. with warnings.catch_warnings(): - warnings.filterwarnings('ignore', category=RemovedInDjango20Warning) + warnings.filterwarnings('ignore', category=RemovedInDjango110Warning) urlpatterns = [ # View has erroneous import url(r'erroneous_inner/$', views.erroneous_view), diff --git a/tests/urlpatterns_reverse/included_namespace_urls.py b/tests/urlpatterns_reverse/included_namespace_urls.py index 8769f112e9..b387440cb5 100644 --- a/tests/urlpatterns_reverse/included_namespace_urls.py +++ b/tests/urlpatterns_reverse/included_namespace_urls.py @@ -1,16 +1,16 @@ import warnings from django.conf.urls import include, patterns, url -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from .namespace_urls import URLObject from .views import view_class_instance testobj3 = URLObject('testapp', 'test-ns3') -# test deprecated patterns() function. convert to list of urls() in Django 2.0 +# test deprecated patterns() function. convert to list of urls() in Django 1.10 with warnings.catch_warnings(): - warnings.filterwarnings('ignore', category=RemovedInDjango20Warning) + warnings.filterwarnings('ignore', category=RemovedInDjango110Warning) urlpatterns = patterns('urlpatterns_reverse.views', url(r'^normal/$', 'empty_view', name='inc-normal-view'), diff --git a/tests/urlpatterns_reverse/tests.py b/tests/urlpatterns_reverse/tests.py index 8f8496a515..e9b672f2b8 100644 --- a/tests/urlpatterns_reverse/tests.py +++ b/tests/urlpatterns_reverse/tests.py @@ -25,7 +25,7 @@ from django.test import ( SimpleTestCase, TestCase, ignore_warnings, override_settings, ) from django.utils import six -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from . import middleware, urlconf_outer, views from .views import empty_view @@ -198,7 +198,7 @@ class NoURLPatternsTests(TestCase): @override_settings(ROOT_URLCONF='urlpatterns_reverse.urls') class URLPatternReverse(TestCase): - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) def test_urlpattern_reverse(self): for name, expected, args, kwargs in test_data: try: @@ -416,7 +416,7 @@ class ReverseShortcutTests(TestCase): redirect("urlpatterns_reverse.nonimported_module.view") self.assertNotIn("urlpatterns_reverse.nonimported_module", sys.modules) - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) def test_reverse_by_path_nested(self): # Views that are added to urlpatterns using include() should be # reversible by dotted path. diff --git a/tests/urlpatterns_reverse/urls.py b/tests/urlpatterns_reverse/urls.py index d6b692d220..91be1dcde4 100644 --- a/tests/urlpatterns_reverse/urls.py +++ b/tests/urlpatterns_reverse/urls.py @@ -1,7 +1,7 @@ import warnings from django.conf.urls import include, patterns, url -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from .views import ( absolute_kwargs_view, defaults_view, empty_view, empty_view_partial, @@ -13,9 +13,9 @@ other_patterns = [ url(r'nested_path/$', nested_view), ] -# test deprecated patterns() function. convert to list of urls() in Django 2.0 +# test deprecated patterns() function. convert to list of urls() in Django 1.10 with warnings.catch_warnings(): - warnings.filterwarnings('ignore', category=RemovedInDjango20Warning) + warnings.filterwarnings('ignore', category=RemovedInDjango110Warning) urlpatterns = patterns('', url(r'^places/([0-9]+)/$', empty_view, name='places'), diff --git a/tests/user_commands/tests.py b/tests/user_commands/tests.py index eb3b86bd38..a50e714c94 100644 --- a/tests/user_commands/tests.py +++ b/tests/user_commands/tests.py @@ -9,7 +9,7 @@ from django.test import SimpleTestCase, ignore_warnings, override_settings from django.test.utils import captured_stderr, captured_stdout, extend_sys_path from django.utils import translation from django.utils._os import upath -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from django.utils.six import StringIO @@ -104,7 +104,7 @@ class CommandTests(SimpleTestCase): self.assertNotIn("opt_3", out.getvalue()) self.assertNotIn("opt-3", out.getvalue()) - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) def test_optparse_compatibility(self): """ optparse should be supported during Django 1.8/1.9 releases. diff --git a/tests/utils_tests/test_checksums.py b/tests/utils_tests/test_checksums.py index 0f6c8d6454..c3888ca26b 100644 --- a/tests/utils_tests/test_checksums.py +++ b/tests/utils_tests/test_checksums.py @@ -1,7 +1,7 @@ import unittest from django.test import ignore_warnings -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning class TestUtilsChecksums(unittest.TestCase): @@ -15,7 +15,7 @@ class TestUtilsChecksums(unittest.TestCase): output = value self.assertEqual(function(value), output) - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) def test_luhn(self): from django.utils import checksums f = checksums.luhn diff --git a/tests/utils_tests/test_html.py b/tests/utils_tests/test_html.py index 58a4d48753..bc9874c696 100644 --- a/tests/utils_tests/test_html.py +++ b/tests/utils_tests/test_html.py @@ -7,7 +7,7 @@ from datetime import datetime from django.test import SimpleTestCase, ignore_warnings from django.utils import html, safestring, six from django.utils._os import upath -from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.deprecation import RemovedInDjango110Warning from django.utils.encoding import force_text @@ -123,7 +123,7 @@ class TestUtilsHtml(SimpleTestCase): for value, output in items: self.check_output(f, value, output) - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) def test_strip_entities(self): f = html.strip_entities # Strings that should come out untouched. @@ -154,7 +154,7 @@ class TestUtilsHtml(SimpleTestCase): for value, output in items: self.check_output(f, value, output) - @ignore_warnings(category=RemovedInDjango20Warning) + @ignore_warnings(category=RemovedInDjango110Warning) def test_remove_tags(self): f = html.remove_tags items = ( diff --git a/tests/view_tests/tests/test_csrf.py b/tests/view_tests/tests/test_csrf.py index 99ea21fc2e..3358fe1669 100644 --- a/tests/view_tests/tests/test_csrf.py +++ b/tests/view_tests/tests/test_csrf.py @@ -63,7 +63,7 @@ class CsrfViewTests(TestCase): "by third parties.", status_code=403) - # In Django 2.0, this can be changed to TEMPLATES=[] because the code path + # In Django 1.10, this can be changed to TEMPLATES=[] because the code path # that reads the TEMPLATE_* settings in that case will have been removed. @override_settings(TEMPLATES=[{ 'BACKEND': 'django.template.backends.dummy.TemplateStrings',