feat: allow to set query and fragment on get_component_url (#1160)

This commit is contained in:
Juro Oravec 2025-05-03 10:29:38 +02:00 committed by GitHub
parent bf7a204e92
commit c69980493d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 102 additions and 5 deletions

View file

@ -373,6 +373,16 @@ class TestComponent:
with pytest.raises(KeyError):
get_component_by_class_id("nonexistent")
def test_component_render_id(self):
class SimpleComponent(Component):
template = "render_id: {{ render_id }}"
def get_template_data(self, args, kwargs, slots, context):
return {"render_id": self.id}
rendered = SimpleComponent.render()
assert rendered == "render_id: ca1bc3e"
def test_get_context_data_returns_none(self):
class SimpleComponent(Component):
template = "Hello"