mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Removed current_app argument to render() and TemplateResponse().
Per deprecation timeline.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user