1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Removed current_app argument to render() and TemplateResponse().

Per deprecation timeline.
This commit is contained in:
Tim Graham
2015-09-03 15:52:04 -04:00
parent 75374d3797
commit 5e450c52aa
15 changed files with 19 additions and 175 deletions

View File

@@ -6,10 +6,9 @@ from unittest import skipUnless
from django.template import Context, Engine, TemplateSyntaxError
from django.template.base import Node
from django.template.library import InvalidTemplateLibrary
from django.test import SimpleTestCase, ignore_warnings
from django.test import SimpleTestCase
from django.test.utils import extend_sys_path
from django.utils import six
from django.utils.deprecation import RemovedInDjango110Warning
from .templatetags import custom, inclusion
from .utils import ROOT
@@ -270,23 +269,8 @@ class InclusionTagTests(TagTestCase):
self.verify_tag(inclusion.inclusion_only_unlimited_args, 'inclusion_only_unlimited_args')
self.verify_tag(inclusion.inclusion_tag_without_context_parameter, 'inclusion_tag_without_context_parameter')
self.verify_tag(inclusion.inclusion_tag_use_l10n, 'inclusion_tag_use_l10n')
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=RemovedInDjango110Warning)
def test_15070_current_app(self):
"""
Test that inclusion tag passes down `current_app` of context to the
Context of the included/rendered template as well.
"""
c = Context({})
t = self.engine.from_string('{% load inclusion %}{% inclusion_tag_current_app %}')
self.assertEqual(t.render(c).strip(), 'None')
# That part produces the deprecation warning
c = Context({}, current_app='advanced')
self.assertEqual(t.render(c).strip(), 'advanced')
def test_15070_use_l10n(self):
"""
Test that inclusion tag passes down `use_l10n` of context to the