summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2015-06-22 13:54:35 -0400
committerTim Graham <timograham@gmail.com>2015-06-24 16:08:20 -0400
commitaaacaeb0963c406c4fe6f68c6ae51f4a65878250 (patch)
treeb100c6ffc345f12342243a8ac684a692b26a9357 /tests
parente73842a95fb751f89a8cafc861bfd57d034cd116 (diff)
Renamed RemovedInDjangoXYWarnings for new roadmap.
Forwardport of ae1d663b7913f6da233c55409c4973248372d302 from stable/1.8.x plus more.
Diffstat (limited to 'tests')
-rw-r--r--tests/admin_inlines/tests.py2
-rw-r--r--tests/aggregation/tests.py4
-rw-r--r--tests/auth_tests/test_views.py4
-rw-r--r--tests/deprecation/tests.py2
-rw-r--r--tests/field_subclassing/fields.py6
-rw-r--r--tests/file_storage/tests.py4
-rw-r--r--tests/forms_tests/tests/test_fields.py6
-rw-r--r--tests/generic_views/test_edit.py10
-rw-r--r--tests/gis_tests/distapp/tests.py18
-rw-r--r--tests/gis_tests/geo3d/tests.py16
-rw-r--r--tests/gis_tests/geoapp/test_sitemaps.py4
-rw-r--r--tests/gis_tests/geoapp/tests.py10
-rw-r--r--tests/gis_tests/geogapp/tests.py6
-rw-r--r--tests/gis_tests/relatedapp/tests.py8
-rw-r--r--tests/i18n/urls.py6
-rw-r--r--tests/migrations/test_commands.py4
-rw-r--r--tests/model_meta/test_legacy.py16
-rw-r--r--tests/multiple_database/tests.py4
-rw-r--r--tests/resolve_url/tests.py4
-rwxr-xr-xtests/runtests.py14
-rw-r--r--tests/settings_tests/tests.py2
-rw-r--r--tests/shortcuts/tests.py16
-rw-r--r--tests/sitemaps_tests/test_http.py8
-rw-r--r--tests/sitemaps_tests/test_https.py6
-rw-r--r--tests/template_backends/test_django.py4
-rw-r--r--tests/template_tests/filter_tests/test_removetags.py6
-rw-r--r--tests/template_tests/filter_tests/test_unordered_list.py8
-rw-r--r--tests/template_tests/syntax_tests/test_cycle.py20
-rw-r--r--tests/template_tests/syntax_tests/test_firstof.py10
-rw-r--r--tests/template_tests/syntax_tests/test_for.py12
-rw-r--r--tests/template_tests/syntax_tests/test_if.py8
-rw-r--r--tests/template_tests/syntax_tests/test_ssi.py6
-rw-r--r--tests/template_tests/syntax_tests/test_url.py40
-rw-r--r--tests/template_tests/test_custom.py4
-rw-r--r--tests/template_tests/test_engine.py6
-rw-r--r--tests/template_tests/test_extends.py4
-rw-r--r--tests/template_tests/test_loaders.py14
-rw-r--r--tests/template_tests/test_response.py8
-rw-r--r--tests/test_client_regress/tests.py8
-rw-r--r--tests/test_runner/tests.py4
-rw-r--r--tests/urlpatterns_reverse/erroneous_urls.py6
-rw-r--r--tests/urlpatterns_reverse/included_namespace_urls.py6
-rw-r--r--tests/urlpatterns_reverse/tests.py20
-rw-r--r--tests/urlpatterns_reverse/urls.py6
-rw-r--r--tests/user_commands/tests.py4
-rw-r--r--tests/utils_tests/test_checksums.py4
-rw-r--r--tests/utils_tests/test_html.py6
-rw-r--r--tests/view_tests/tests/test_csrf.py2
48 files changed, 198 insertions, 198 deletions
diff --git a/tests/admin_inlines/tests.py b/tests/admin_inlines/tests.py
index 19260baf4d..d5807ba278 100644
--- a/tests/admin_inlines/tests.py
+++ b/tests/admin_inlines/tests.py
@@ -433,7 +433,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 8f3c9fb410..5b0bcb82bc 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
@@ -1068,7 +1068,7 @@ class AggregateTestCase(TestCase):
self.assertQuerysetEqual(
qs2, [1, 3], lambda v: v.num_awards)
- @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 033d083e18..7b497ac458 100644
--- a/tests/auth_tests/test_views.py
+++ b/tests/auth_tests/test_views.py
@@ -28,7 +28,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
@@ -197,7 +197,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/deprecation/tests.py b/tests/deprecation/tests.py
index ccc4f2351b..8f4ccf4eb5 100644
--- a/tests/deprecation/tests.py
+++ b/tests/deprecation/tests.py
@@ -195,5 +195,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 f8c1c43e08..9aea27420d 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 4224a94725..41ed7b5f45 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:
@@ -513,7 +513,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])
@@ -692,7 +692,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 3cc5318947..e93965a670 100644
--- a/tests/generic_views/test_edit.py
+++ b/tests/generic_views/test_edit.py
@@ -9,7 +9,7 @@ from django.test import (
SimpleTestCase, 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
@@ -72,7 +72,7 @@ class FormMixinTests(SimpleTestCase):
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 '
@@ -152,7 +152,7 @@ class CreateViewTests(TestCase):
self.assertRedirects(res, '/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/',
@@ -292,7 +292,7 @@ class UpdateViewTests(TestCase):
self.assertRedirects(res, '/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',
@@ -399,7 +399,7 @@ class DeleteViewTests(TestCase):
self.assertRedirects(res, '/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/distapp/tests.py b/tests/gis_tests/distapp/tests.py
index c18763cad4..c9c0d8dbcc 100644
--- a/tests/gis_tests/distapp/tests.py
+++ b/tests/gis_tests/distapp/tests.py
@@ -8,7 +8,7 @@ from django.contrib.gis.measure import D # alias for Distance
from django.db import connection
from django.db.models import Q
from django.test import TestCase, ignore_warnings, skipUnlessDBFeature
-from django.utils.deprecation import RemovedInDjango21Warning
+from django.utils.deprecation import RemovedInDjango20Warning
from ..utils import no_oracle, oracle, postgis, spatialite
from .models import (
@@ -97,7 +97,7 @@ class DistanceTest(TestCase):
self.assertListEqual(au_cities, self.get_names(qs.filter(point__dwithin=(self.au_pnt, dist))))
@skipUnlessDBFeature("has_distance_method")
- @ignore_warnings(category=RemovedInDjango21Warning)
+ @ignore_warnings(category=RemovedInDjango20Warning)
def test_distance_projected(self):
"""
Test the `distance` GeoQuerySet method on projected coordinate systems.
@@ -141,7 +141,7 @@ class DistanceTest(TestCase):
self.assertAlmostEqual(ft_distances[i], c.distance.survey_ft, tol)
@skipUnlessDBFeature("has_distance_method", "supports_distance_geodetic")
- @ignore_warnings(category=RemovedInDjango21Warning)
+ @ignore_warnings(category=RemovedInDjango20Warning)
def test_distance_geodetic(self):
"""
Test the `distance` GeoQuerySet method on geodetic coordinate systems.
@@ -203,7 +203,7 @@ class DistanceTest(TestCase):
@no_oracle # Oracle already handles geographic distance calculation.
@skipUnlessDBFeature("has_distance_method")
- @ignore_warnings(category=RemovedInDjango21Warning)
+ @ignore_warnings(category=RemovedInDjango20Warning)
def test_distance_transform(self):
"""
Test the `distance` GeoQuerySet method used with `transform` on a geographic field.
@@ -324,7 +324,7 @@ class DistanceTest(TestCase):
self.assertEqual(cities, ['Adelaide', 'Hobart', 'Shellharbour', 'Thirroul'])
@skipUnlessDBFeature("has_area_method")
- @ignore_warnings(category=RemovedInDjango21Warning)
+ @ignore_warnings(category=RemovedInDjango20Warning)
def test_area(self):
"""
Test the `area` GeoQuerySet method.
@@ -338,7 +338,7 @@ class DistanceTest(TestCase):
self.assertAlmostEqual(area_sq_m[i], z.area.sq_m, tol)
@skipUnlessDBFeature("has_length_method")
- @ignore_warnings(category=RemovedInDjango21Warning)
+ @ignore_warnings(category=RemovedInDjango20Warning)
def test_length(self):
"""
Test the `length` GeoQuerySet method.
@@ -362,7 +362,7 @@ class DistanceTest(TestCase):
self.assertAlmostEqual(len_m2, i10.length.m, 2)
@skipUnlessDBFeature("has_perimeter_method")
- @ignore_warnings(category=RemovedInDjango21Warning)
+ @ignore_warnings(category=RemovedInDjango20Warning)
def test_perimeter(self):
"""
Test the `perimeter` GeoQuerySet method.
@@ -379,7 +379,7 @@ class DistanceTest(TestCase):
self.assertEqual(0, c.perim.m)
@skipUnlessDBFeature("has_area_method", "has_distance_method")
- @ignore_warnings(category=RemovedInDjango21Warning)
+ @ignore_warnings(category=RemovedInDjango20Warning)
def test_measurement_null_fields(self):
"""
Test the measurement GeoQuerySet methods on fields with NULL values.
@@ -394,7 +394,7 @@ class DistanceTest(TestCase):
self.assertIsNone(z.area)
@skipUnlessDBFeature("has_distance_method")
- @ignore_warnings(category=RemovedInDjango21Warning)
+ @ignore_warnings(category=RemovedInDjango20Warning)
def test_distance_order_by(self):
qs = SouthTexasCity.objects.distance(Point(3, 3)).order_by(
'distance'
diff --git a/tests/gis_tests/geo3d/tests.py b/tests/gis_tests/geo3d/tests.py
index 2feecaa417..31b440be4a 100644
--- a/tests/gis_tests/geo3d/tests.py
+++ b/tests/gis_tests/geo3d/tests.py
@@ -13,7 +13,7 @@ from django.contrib.gis.geos import GEOSGeometry, LineString, Point, Polygon
from django.test import TestCase, ignore_warnings, skipUnlessDBFeature
from django.utils._os import upath
from django.utils.deprecation import (
- RemovedInDjango20Warning, RemovedInDjango21Warning,
+ RemovedInDjango20Warning, RemovedInDjango110Warning,
)
from .models import (
@@ -173,7 +173,7 @@ class Geo3DTest(Geo3DLoadingHelper, TestCase):
lm.save()
self.assertEqual(3, MultiPoint3D.objects.count())
- @ignore_warnings(category=RemovedInDjango21Warning)
+ @ignore_warnings(category=RemovedInDjango20Warning)
def test_kml(self):
"""
Test GeoQuerySet.kml() with Z values.
@@ -185,7 +185,7 @@ class Geo3DTest(Geo3DLoadingHelper, TestCase):
ref_kml_regex = re.compile(r'^<Point><coordinates>-95.363\d+,29.763\d+,18</coordinates></Point>$')
self.assertTrue(ref_kml_regex.match(h.kml))
- @ignore_warnings(category=RemovedInDjango21Warning)
+ @ignore_warnings(category=RemovedInDjango20Warning)
def test_geojson(self):
"""
Test GeoQuerySet.geojson() with Z values.
@@ -217,7 +217,7 @@ class Geo3DTest(Geo3DLoadingHelper, TestCase):
self.assertSetEqual({p.ewkt for p in ref_union}, {p.ewkt for p in union})
@skipUnlessDBFeature("supports_3d_functions")
- @ignore_warnings(category=RemovedInDjango20Warning)
+ @ignore_warnings(category=RemovedInDjango110Warning)
def test_extent(self):
"""
Testing the Extent3D aggregate for 3D models.
@@ -237,7 +237,7 @@ class Geo3DTest(Geo3DLoadingHelper, TestCase):
self.assertIsNone(City3D.objects.none().extent3d())
self.assertIsNone(City3D.objects.none().aggregate(Extent3D('point'))['point__extent3d'])
- @ignore_warnings(category=RemovedInDjango21Warning)
+ @ignore_warnings(category=RemovedInDjango20Warning)
@skipUnlessDBFeature("supports_3d_functions")
def test_perimeter(self):
"""
@@ -256,7 +256,7 @@ class Geo3DTest(Geo3DLoadingHelper, TestCase):
Polygon3D.objects.perimeter().get(name='3D BBox').perimeter.m,
tol)
- @ignore_warnings(category=RemovedInDjango21Warning)
+ @ignore_warnings(category=RemovedInDjango20Warning)
@skipUnlessDBFeature("supports_3d_functions")
def test_length(self):
"""
@@ -290,7 +290,7 @@ class Geo3DTest(Geo3DLoadingHelper, TestCase):
InterstateProj3D.objects.length().get(name='I-45').length.m,
tol)
- @ignore_warnings(category=RemovedInDjango21Warning)
+ @ignore_warnings(category=RemovedInDjango20Warning)
@skipUnlessDBFeature("supports_3d_functions")
def test_scale(self):
"""
@@ -303,7 +303,7 @@ class Geo3DTest(Geo3DLoadingHelper, TestCase):
for city in City3D.objects.scale(1.0, 1.0, zscale):
self.assertEqual(city_dict[city.name][2] * zscale, city.scale.z)
- @ignore_warnings(category=RemovedInDjango21Warning)
+ @ignore_warnings(category=RemovedInDjango20Warning)
@skipUnlessDBFeature("supports_3d_functions")
def test_translate(self):
"""
diff --git a/tests/gis_tests/geoapp/test_sitemaps.py b/tests/gis_tests/geoapp/test_sitemaps.py
index 4bd8b8744e..288d003f21 100644
--- a/tests/gis_tests/geoapp/test_sitemaps.py
+++ b/tests/gis_tests/geoapp/test_sitemaps.py
@@ -10,7 +10,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
from .models import City, Country
@@ -30,7 +30,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 c54ffe4e9e..64af08aa77 100644
--- a/tests/gis_tests/geoapp/tests.py
+++ b/tests/gis_tests/geoapp/tests.py
@@ -14,7 +14,7 @@ from django.db import connection
from django.test import TestCase, ignore_warnings, skipUnlessDBFeature
from django.utils import six
from django.utils.deprecation import (
- RemovedInDjango20Warning, RemovedInDjango21Warning,
+ RemovedInDjango20Warning, RemovedInDjango110Warning,
)
from ..utils import no_oracle, oracle, postgis, spatialite
@@ -435,7 +435,7 @@ class GeoLookupTest(TestCase):
@skipUnlessDBFeature("gis_enabled")
-@ignore_warnings(category=RemovedInDjango21Warning)
+@ignore_warnings(category=RemovedInDjango20Warning)
class GeoQuerySetTest(TestCase):
fixtures = ['initial']
@@ -493,7 +493,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
@@ -651,7 +651,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
@@ -863,7 +863,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/geogapp/tests.py b/tests/gis_tests/geogapp/tests.py
index ec70e98d70..a92d6b4e2b 100644
--- a/tests/gis_tests/geogapp/tests.py
+++ b/tests/gis_tests/geogapp/tests.py
@@ -11,7 +11,7 @@ from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.measure import D
from django.test import TestCase, ignore_warnings, skipUnlessDBFeature
from django.utils._os import upath
-from django.utils.deprecation import RemovedInDjango21Warning
+from django.utils.deprecation import RemovedInDjango20Warning
from ..utils import oracle, postgis
from .models import City, County, Zipcode
@@ -41,7 +41,7 @@ class GeographyTest(TestCase):
self.assertEqual(['Dallas', 'Houston', 'Oklahoma City'], cities)
@skipUnlessDBFeature("has_distance_method", "supports_distance_geodetic")
- @ignore_warnings(category=RemovedInDjango21Warning)
+ @ignore_warnings(category=RemovedInDjango20Warning)
def test03_distance_method(self):
"Testing GeoQuerySet.distance() support on non-point geography fields."
# `GeoQuerySet.distance` is not allowed geometry fields.
@@ -94,7 +94,7 @@ class GeographyTest(TestCase):
self.assertEqual(state, c.state)
@skipUnlessDBFeature("has_area_method", "supports_distance_geodetic")
- @ignore_warnings(category=RemovedInDjango21Warning)
+ @ignore_warnings(category=RemovedInDjango20Warning)
def test06_geography_area(self):
"Testing that Area calculations work on geography columns."
# SELECT ST_Area(poly) FROM geogapp_zipcode WHERE code='77002';
diff --git a/tests/gis_tests/relatedapp/tests.py b/tests/gis_tests/relatedapp/tests.py
index 97c42b5dc3..19b0f89eab 100644
--- a/tests/gis_tests/relatedapp/tests.py
+++ b/tests/gis_tests/relatedapp/tests.py
@@ -7,7 +7,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
from .models import (
@@ -64,7 +64,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
@@ -98,7 +98,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
@@ -291,7 +291,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/migrations/test_commands.py b/tests/migrations/test_commands.py
index 58344e50ce..d1bef38716 100644
--- a/tests/migrations/test_commands.py
+++ b/tests/migrations/test_commands.py
@@ -10,7 +10,7 @@ from django.core.management import CommandError, call_command
from django.db import DatabaseError, connection, models
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
@@ -117,7 +117,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 917a7d4cf3..d93b5fc020 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 1dadb3bea4..08493ffaf2 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 14c0fbb364..d0c9d74abe 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 SimpleTestCase, 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(SimpleTestCase):
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 12e78cad68..712441fd62 100755
--- a/tests/runtests.py
+++ b/tests/runtests.py
@@ -17,12 +17,12 @@ from django.test.utils import get_runner
from django.utils import six
from django.utils._os import upath
from django.utils.deprecation import (
- RemovedInDjango20Warning, RemovedInDjango21Warning,
+ RemovedInDjango20Warning, RemovedInDjango110Warning,
)
from django.utils.log import DEFAULT_LOGGING
+warnings.simplefilter("error", RemovedInDjango110Warning)
warnings.simplefilter("error", RemovedInDjango20Warning)
-warnings.simplefilter("error", RemovedInDjango21Warning)
RUNTESTS_DIR = os.path.abspath(os.path.dirname(upath(__file__)))
@@ -107,7 +107,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,
@@ -121,7 +121,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',
@@ -161,13 +161,13 @@ 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
)
warnings.filterwarnings(
'ignore',
'The GeoManager class is deprecated.',
- RemovedInDjango21Warning
+ RemovedInDjango20Warning
)
# Load all the ALWAYS_INSTALLED_APPS.
diff --git a/tests/settings_tests/tests.py b/tests/settings_tests/tests.py
index 97fb72baa5..be1cb426d8 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 74acb13d7e..ef7a0edc7a 100644
--- a/tests/shortcuts/tests.py
+++ b/tests/shortcuts/tests.py
@@ -1,6 +1,6 @@
from django.test import SimpleTestCase, 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(SimpleTestCase):
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(SimpleTestCase):
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(SimpleTestCase):
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(SimpleTestCase):
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(SimpleTestCase):
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 2a21b04b5a..332eeaee25 100644
--- a/tests/template_backends/test_django.py
+++ b/tests/template_backends/test_django.py
@@ -4,7 +4,7 @@ from django.template import RequestContext
from django.template.backends.django import DjangoTemplates
from django.template.library import InvalidTemplateLibrary
from django.test import RequestFactory, ignore_warnings, override_settings
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
from .test_dummy import TemplateStringsTests
@@ -36,7 +36,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&gt;\n\t<ul>\n\t\t<li>&lt;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 c478faff52..7e9f7c3c8d 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
@@ -13,19 +13,19 @@ class CycleTagTests(SimpleTestCase):
with self.assertRaises(TemplateSyntaxError):
self.engine.get_template('cycle01')
- @ignore_warnings(category=RemovedInDjango20Warning)
+ @ignore_warnings(category=RemovedInDjango110Warning)
@setup({'cycle02': '{% cycle a,b,c as abc %}{% cycle abc %}'})
def test_cycle02(self):
output = self.engine.render_to_string('cycle02')
self.assertEqual(output, 'ab')
- @ignore_warnings(category=RemovedInDjango20Warning)
+ @ignore_warnings(category=RemovedInDjango110Warning)
@setup({'cycle03': '{% cycle a,b,c as abc %}{% cycle abc %}{% cycle abc %}'})
def test_cycle03(self):
output = self.engine.render_to_string('cycle03')
self.assertEqual(output, 'abc')
- @ignore_warnings(category=RemovedInDjango20Warning)
+ @ignore_warnings(category=RemovedInDjango110Warning)
@setup({'cycle04': '{% cycle a,b,c as abc %}{% cycle abc %}{% cycle abc %}{% cycle abc %}'})
def test_cycle04(self):
output = self.engine.render_to_string('cycle04')
@@ -41,19 +41,19 @@ class CycleTagTests(SimpleTestCase):
with self.assertRaises(TemplateSyntaxError):
self.engine.get_template('cycle06')
- @ignore_warnings(category=RemovedInDjango20Warning)
+ @ignore_warnings(category=RemovedInDjango110Warning)
@setup({'cycle07': '{% cycle a,b,c as foo %}{% cycle bar %}'})
def test_cycle07(self):
with self.assertRaises(TemplateSyntaxError):
self.engine.get_template('cycle07')
- @ignore_warnings(category=RemovedInDjango20Warning)
+ @ignore_warnings(category=RemovedInDjango110Warning)
@setup({'cycle08': '{% cycle a,b,c as foo %}{% cycle foo %}{{ foo }}{{ foo }}{% cycle foo %}{{ foo }}'})
def test_cycle08(self):
output = self.engine.render_to_string('cycle08')
self.assertEqual(output, 'abbbcc')
- @ignore_warnings(category=RemovedInDjango20Warning)
+ @ignore_warnings(category=RemovedInDjango110Warning)
@setup({'cycle09': '{% for i in test %}{% cycle a,b %}{{ i }},{% endfor %}'})
def test_cycle09(self):
output = self.engine.render_to_string('cycle09', {'test': list(range(5))})
@@ -146,20 +146,20 @@ class CycleTagTests(SimpleTestCase):
output = self.engine.render_to_string('cycle25', {'a': '<'})
self.assertEqual(output, '&lt;')
- @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, '&lt;&gt;')
- @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 79eb381c69..c25a1854c3 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
@@ -58,26 +58,26 @@ class FirstOfTagTests(SimpleTestCase):
output = self.engine.render_to_string('firstof10', {'a': '<'})
self.assertEqual(output, '&lt;')
- @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, '&lt;')
- @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, '&gt;')
- @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 8045ea4990..32fc5f0e3e 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
@@ -126,9 +126,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(
@@ -137,7 +137,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(
@@ -150,7 +150,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(
@@ -162,7 +162,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 e1422de509..0fd9af7712 100644
--- a/tests/template_tests/syntax_tests/test_ssi.py
+++ b/tests/template_tests/syntax_tests/test_ssi.py
@@ -4,12 +4,12 @@ import os
from django.template import Context, Engine
from django.test import SimpleTestCase, ignore_warnings
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils.deprecation import RemovedInDjango110Warning
from ..utils import ROOT, setup
-@ignore_warnings(category=RemovedInDjango20Warning)
+@ignore_warnings(category=RemovedInDjango110Warning)
class SsiTagTests(SimpleTestCase):
# Test normal behavior
@@ -81,7 +81,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 11c04f870c..5d2907074d 100644
--- a/tests/template_tests/test_custom.py
+++ b/tests/template_tests/test_custom.py
@@ -8,7 +8,7 @@ from django.template.library import InvalidTemplateLibrary
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
@@ -247,7 +247,7 @@ class InclusionTagTests(TagTestCase):
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 a72a430e3e..2d354bae0b 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):
@@ -91,7 +91,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_extends.py b/tests/template_tests/test_extends.py
index 9e56d69db4..03a674e25b 100644
--- a/tests/template_tests/test_extends.py
+++ b/tests/template_tests/test_extends.py
@@ -4,7 +4,7 @@ from django.template import Context, Engine, TemplateDoesNotExist
from django.template.loader_tags import ExtendsError
from django.template.loaders.base import Loader
from django.test import SimpleTestCase, ignore_warnings
-from django.utils.deprecation import RemovedInDjango21Warning
+from django.utils.deprecation import RemovedInDjango20Warning
from .utils import ROOT
@@ -132,7 +132,7 @@ class NonRecursiveLoader(Loader):
raise TemplateDoesNotExist(template_name)
-@ignore_warnings(category=RemovedInDjango21Warning)
+@ignore_warnings(category=RemovedInDjango20Warning)
class NonRecursiveLoaderExtendsTests(SimpleTestCase):
loaders = [
diff --git a/tests/template_tests/test_loaders.py b/tests/template_tests/test_loaders.py
index 41cac5cb9d..f1263105c6 100644
--- a/tests/template_tests/test_loaders.py
+++ b/tests/template_tests/test_loaders.py
@@ -12,7 +12,7 @@ from django.template import Context, TemplateDoesNotExist
from django.template.engine import Engine
from django.test import SimpleTestCase, ignore_warnings, override_settings
from django.utils import six
-from django.utils.deprecation import RemovedInDjango21Warning
+from django.utils.deprecation import RemovedInDjango20Warning
from .utils import TEMPLATE_DIR
@@ -55,7 +55,7 @@ class CachedLoaderTests(SimpleTestCase):
e = self.engine.template_loaders[0].get_template_cache['doesnotexist.html']
self.assertEqual(e.args[0], 'doesnotexist.html')
- @ignore_warnings(category=RemovedInDjango21Warning)
+ @ignore_warnings(category=RemovedInDjango20Warning)
def test_load_template(self):
loader = self.engine.template_loaders[0]
template, origin = loader.load_template('index.html')
@@ -69,7 +69,7 @@ class CachedLoaderTests(SimpleTestCase):
source, name = loader.load_template('index.html')
self.assertEqual(template.origin.template_name, 'index.html')
- @ignore_warnings(category=RemovedInDjango21Warning)
+ @ignore_warnings(category=RemovedInDjango20Warning)
def test_load_template_missing(self):
"""
#19949 -- TemplateDoesNotExist exceptions should be cached.
@@ -176,7 +176,7 @@ class EggLoaderTests(SimpleTestCase):
output = template.render(Context({}))
self.assertEqual(output, "y")
- @ignore_warnings(category=RemovedInDjango21Warning)
+ @ignore_warnings(category=RemovedInDjango20Warning)
def test_load_template_source(self):
loader = self.engine.template_loaders[0]
templates = {
@@ -249,7 +249,7 @@ class FileSystemLoaderTests(SimpleTestCase):
self.assertEqual(template.origin.loader, self.engine.template_loaders[0])
self.assertEqual(template.origin.loader_name, 'django.template.loaders.filesystem.Loader')
- @ignore_warnings(category=RemovedInDjango21Warning)
+ @ignore_warnings(category=RemovedInDjango20Warning)
def test_load_template_source(self):
loader = self.engine.template_loaders[0]
source, name = loader.load_template_source('index.html')
@@ -336,7 +336,7 @@ class AppDirectoriesLoaderTests(SimpleTestCase):
self.assertEqual(template.origin.template_name, 'index.html')
self.assertEqual(template.origin.loader, self.engine.template_loaders[0])
- @ignore_warnings(category=RemovedInDjango21Warning)
+ @ignore_warnings(category=RemovedInDjango20Warning)
@override_settings(INSTALLED_APPS=['template_tests'])
def test_load_template_source(self):
loader = self.engine.template_loaders[0]
@@ -367,7 +367,7 @@ class LocmemLoaderTests(SimpleTestCase):
self.assertEqual(template.origin.template_name, 'index.html')
self.assertEqual(template.origin.loader, self.engine.template_loaders[0])
- @ignore_warnings(category=RemovedInDjango21Warning)
+ @ignore_warnings(category=RemovedInDjango20Warning)
def test_load_template_source(self):
loader = self.engine.template_loaders[0]
source, name = loader.load_template_source('index.html')
diff --git a/tests/template_tests/test_response.py b/tests/template_tests/test_response.py
index ad71a48d6b..36a0ba704d 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 efc44289cd..a492fd6e76 100644
--- a/tests/test_client_regress/tests.py
+++ b/tests/test_client_regress/tests.py
@@ -21,7 +21,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 (
- RemovedInDjango20Warning, RemovedInDjango21Warning,
+ RemovedInDjango20Warning, RemovedInDjango110Warning,
)
from django.utils.translation import ugettext_lazy
@@ -520,11 +520,11 @@ class AssertRedirectsTests(SimpleTestCase):
with self.assertRaises(AssertionError):
self.assertRedirects(response, 'http://testserver/secure_view/', status_code=302)
- @ignore_warnings(category=RemovedInDjango21Warning)
+ @ignore_warnings(category=RemovedInDjango20Warning)
def test_full_path_in_expected_urls(self):
"""
Test that specifying a full URL as assertRedirects expected_url still
- work as backwards compatible behavior until Django 2.1.
+ work as backwards compatible behavior until Django 2.0.
"""
response = self.client.get('/redirect_view/')
self.assertRedirects(response, 'http://testserver/get_view/')
@@ -1024,7 +1024,7 @@ class ContextTests(TestDataMixin, 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/test_runner/tests.py b/tests/test_runner/tests.py
index fba8e44e02..3e47ee00f7 100644
--- a/tests/test_runner/tests.py
+++ b/tests/test_runner/tests.py
@@ -352,8 +352,8 @@ class DeprecationDisplayTest(AdminScriptTestCase):
args = ['test', '--settings=test_project.settings', 'test_runner_deprecation_app']
out, err = self.run_django_admin(args)
self.assertIn("Ran 1 test", force_text(err))
- six.assertRegex(self, err, r"RemovedInDjango\d\dWarning: warning from test")
- six.assertRegex(self, err, r"RemovedInDjango\d\dWarning: module-level warning from deprecation_app")
+ six.assertRegex(self, err, r"RemovedInDjango\d+Warning: warning from test")
+ six.assertRegex(self, err, r"RemovedInDjango\d+Warning: module-level warning from deprecation_app")
def test_runner_deprecation_verbosity_zero(self):
args = ['test', '--settings=test_project.settings', '--verbosity=0', 'test_runner_deprecation_app']
diff --git a/tests/urlpatterns_reverse/erroneous_urls.py b/tests/urlpatterns_reverse/erroneous_urls.py
index c96424f830..281d2bfa5b 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 43bba1b6de..93aa007716 100644
--- a/tests/urlpatterns_reverse/included_namespace_urls.py
+++ b/tests/urlpatterns_reverse/included_namespace_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 .namespace_urls import URLObject
from .views import view_class_instance
@@ -9,9 +9,9 @@ from .views import view_class_instance
testobj3 = URLObject('testapp', 'test-ns3')
testobj4 = URLObject('testapp', 'test-ns4')
-# 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 7363084f2a..66803cd762 100644
--- a/tests/urlpatterns_reverse/tests.py
+++ b/tests/urlpatterns_reverse/tests.py
@@ -27,7 +27,7 @@ from django.test import (
from django.test.utils import override_script_prefix
from django.utils import six
from django.utils.deprecation import (
- RemovedInDjango20Warning, RemovedInDjango21Warning,
+ RemovedInDjango20Warning, RemovedInDjango110Warning,
)
from . import middleware, urlconf_outer, views
@@ -227,7 +227,7 @@ class NoURLPatternsTests(SimpleTestCase):
@override_settings(ROOT_URLCONF='urlpatterns_reverse.urls')
class URLPatternReverse(SimpleTestCase):
- @ignore_warnings(category=RemovedInDjango20Warning)
+ @ignore_warnings(category=RemovedInDjango110Warning)
def test_urlpattern_reverse(self):
for name, expected, args, kwargs in test_data:
try:
@@ -303,7 +303,7 @@ class URLPatternReverse(SimpleTestCase):
class ResolverTests(unittest.TestCase):
- @ignore_warnings(category=RemovedInDjango21Warning)
+ @ignore_warnings(category=RemovedInDjango20Warning)
def test_resolver_repr(self):
"""
Test repr of RegexURLResolver, especially when urlconf_name is a list
@@ -469,7 +469,7 @@ class ReverseShortcutTests(SimpleTestCase):
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.
@@ -483,7 +483,7 @@ class ReverseShortcutTests(SimpleTestCase):
@override_settings(ROOT_URLCONF='urlpatterns_reverse.namespace_urls')
-@ignore_warnings(category=RemovedInDjango21Warning)
+@ignore_warnings(category=RemovedInDjango20Warning)
class NamespaceTests(SimpleTestCase):
def test_ambiguous_object(self):
@@ -824,7 +824,7 @@ class NoRootUrlConfTests(SimpleTestCase):
@override_settings(ROOT_URLCONF='urlpatterns_reverse.namespace_urls')
class ResolverMatchTests(SimpleTestCase):
- @ignore_warnings(category=RemovedInDjango21Warning)
+ @ignore_warnings(category=RemovedInDjango20Warning)
def test_urlpattern_resolve(self):
for path, url_name, app_name, namespace, view_name, func, args, kwargs in resolve_test_data:
# Test legacy support for extracting "function, args, kwargs"
@@ -849,7 +849,7 @@ class ResolverMatchTests(SimpleTestCase):
self.assertEqual(match[1], args)
self.assertEqual(match[2], kwargs)
- @ignore_warnings(category=RemovedInDjango21Warning)
+ @ignore_warnings(category=RemovedInDjango20Warning)
def test_resolver_match_on_request(self):
response = self.client.get('/resolver_match/')
resolver_match = response.resolver_match
@@ -917,12 +917,12 @@ class IncludeTests(SimpleTestCase):
def test_include_urls(self):
self.assertEqual(include(self.url_patterns), (self.url_patterns, None, None))
- @ignore_warnings(category=RemovedInDjango21Warning)
+ @ignore_warnings(category=RemovedInDjango20Warning)
def test_include_namespace(self):
# no app_name -> deprecated
self.assertEqual(include(self.url_patterns, 'namespace'), (self.url_patterns, None, 'namespace'))
- @ignore_warnings(category=RemovedInDjango21Warning)
+ @ignore_warnings(category=RemovedInDjango20Warning)
def test_include_namespace_app_name(self):
# app_name argument to include -> deprecated
self.assertEqual(
@@ -930,7 +930,7 @@ class IncludeTests(SimpleTestCase):
(self.url_patterns, 'app_name', 'namespace')
)
- @ignore_warnings(category=RemovedInDjango21Warning)
+ @ignore_warnings(category=RemovedInDjango20Warning)
def test_include_3_tuple(self):
# 3-tuple -> deprecated
self.assertEqual(
diff --git a/tests/urlpatterns_reverse/urls.py b/tests/urlpatterns_reverse/urls.py
index 25609c14cf..98a00f803f 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 ff30becc11..50104df989 100644
--- a/tests/view_tests/tests/test_csrf.py
+++ b/tests/view_tests/tests/test_csrf.py
@@ -63,7 +63,7 @@ class CsrfViewTests(SimpleTestCase):
"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',