test: test to illustrate bug in component caching when using include tag (#1135)

* test: test to illustrate bug in component caching when using include tag

* fix: add cleanup for render context in component rendering

* refactor: clarify cleanup comment in component rendering logic

* refactor: fix linter errors

* test: formatting and unnecessary test setup

---------

Co-authored-by: Juro Oravec <juraj.oravec.josefson@gmail.com>
This commit is contained in:
Oliver Haas 2025-04-20 11:53:06 +02:00 committed by GitHub
parent eed15d32ab
commit e0b718c314
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 34 additions and 1 deletions

View file

@ -1306,6 +1306,8 @@ class Component(
# The component rendering was short-circuited by an extension, skipping
# the rest of the rendering process. This may be for example a cached content.
if result_override is not None:
# Cleanup needs to be done even if short-circuited
context.render_context.pop()
return result_override
# We pass down the components the info about the component's parent.