mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
[4.1.x] Fixed #33653 -- Fixed template crash when calling methods for built-in types without required arguments.
Regression in09341856ed. Backport of0dd2920909from main
This commit is contained in:
@@ -183,6 +183,14 @@ class TemplateTestMixin:
|
||||
for node in template.nodelist:
|
||||
self.assertEqual(node.origin, template.origin)
|
||||
|
||||
def test_render_built_in_type_method(self):
|
||||
"""
|
||||
Templates should not crash when rendering methods for built-in types
|
||||
without required arguments.
|
||||
"""
|
||||
template = self._engine().from_string("{{ description.count }}")
|
||||
self.assertEqual(template.render(Context({"description": "test"})), "")
|
||||
|
||||
|
||||
class TemplateTests(TemplateTestMixin, SimpleTestCase):
|
||||
debug_engine = False
|
||||
|
||||
Reference in New Issue
Block a user