feat: allow to set defaults (#1072)

* feat: allow to set defaults

* docs: update changelog

* refactor: fix new linter errors
This commit is contained in:
Juro Oravec 2025-03-31 10:38:41 +02:00 committed by GitHub
parent 48dd3b7a5a
commit f07818fc7d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 553 additions and 36 deletions

View file

@ -293,7 +293,7 @@ class TestComponent:
class TestComponent(Component):
@no_type_check
def get_context_data(self, var1, var2, variable, another, **attrs):
assert self.input.args == (123, "str")
assert self.input.args == [123, "str"]
assert self.input.kwargs == {"variable": "test", "another": 1}
assert isinstance(self.input.context, Context)
assert list(self.input.slots.keys()) == ["my_slot"]
@ -305,7 +305,7 @@ class TestComponent:
@no_type_check
def get_template(self, context):
assert self.input.args == (123, "str")
assert self.input.args == [123, "str"]
assert self.input.kwargs == {"variable": "test", "another": 1}
assert isinstance(self.input.context, Context)
assert list(self.input.slots.keys()) == ["my_slot"]