mirror of
https://github.com/django/django.git
synced 2025-09-09 04:00:48 +00:00
Renamed RemovedInDjangoXYWarnings for new roadmap.
Forwardport of ae1d663b79
from stable/1.8.x plus more.
This commit is contained in:
parent
e73842a95f
commit
aaacaeb096
124 changed files with 455 additions and 448 deletions
|
@ -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)})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue