diff options
| author | Tim Graham <timograham@gmail.com> | 2015-06-22 13:54:35 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-06-23 07:22:16 -0400 |
| commit | ae1d663b7913f6da233c55409c4973248372d302 (patch) | |
| tree | 1ac06b1eccd77be127ae8d046e9ade878623c176 /tests | |
| parent | 7439039806038ce35d3a91f430037c667dcab051 (diff) | |
[1.8.x] Renamed RemovedInDjango20Warning to RemovedInDjango110Warning.
Diffstat (limited to 'tests')
45 files changed, 157 insertions, 157 deletions
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(), ['<Author: Randall Munroe>']) - @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(), ['<Author: Randall Munroe (author of xkcd)>']) - @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('<Point><coordinates>-104.609252,38.255001</coordinates></Point>', 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 <p>y</p> x <p>y</p>') -@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>', ['<y']]}) self.assertEqual(output, '\t<li>x>\n\t<ul>\n\t\t<li><y</li>\n\t</ul>\n\t</li>') - @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>', ['<y']]}) @@ -36,7 +36,7 @@ class UnorderedListTests(SimpleTestCase): self.assertEqual(output, '\t<li>x>\n\t<ul>\n\t\t<li><y</li>\n\t</ul>\n\t</li>') -@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<li>ulitem-a</li>\n\t<li>ulitem-b</li>\n\t<li>ulitem-<a>c</a></li>', ) - @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', |
