From d48502c40b235e2a64b02d6bd8c07bc1468fa06c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emil=20Stenstr=C3=B6m?= Date: Sat, 20 Feb 2021 23:57:46 +0100 Subject: [PATCH] Add test for calling component with positional name. --- tests/test_templatetags.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_templatetags.py b/tests/test_templatetags.py index d47e2e3b..b2ae5154 100644 --- a/tests/test_templatetags.py +++ b/tests/test_templatetags.py @@ -104,6 +104,15 @@ class ComponentTemplateTagTest(SimpleTestCase): rendered = template.render(Context({})) self.assertHTMLEqual(rendered, "Variable: variable\n") + def test_single_component_positional_name(self): + component.registry.register(name="test", component=SimpleComponent) + + template = Template( + '{% load component_tags %}{% component "test" variable="variable" %}' + ) + rendered = template.render(Context({})) + self.assertHTMLEqual(rendered, "Variable: variable\n") + def test_call_component_with_two_variables(self): component.registry.register(name="test", component=IffedComponent)