sponsfreixes / jinja2-fragments

Render Jinja2 template block as HTML page fragments on Python web frameworks.
MIT License
253 stars 14 forks source link

inject macros into context of block being rendered #30

Closed gconklin closed 4 months ago

gconklin commented 4 months ago

Related to #21 : This modification worked for my case to load the macros into the context of the fragment being rendered.

sponsfreixes commented 4 months ago

This looks great, and I see it doesn't break existing tests.

Would you be able to add at least one test case on test_render_block.py that uses macros? That way we make sure that future modifications don't break it.

gconklin commented 4 months ago

Hi @sponsfreixes - All of the async tests were failing (shame on me) so I modified that bit slightly.

I've also added a test to exercise macro usage.

sponsfreixes commented 4 months ago

Hi @sponsfreixes - All of the async tests were failing (shame on me) so I modified that bit slightly.

I just realized that when I ran the tests myself before I did it on main and not on the PR branch :expressionless:

I've also added a test to exercise macro usage.

Thank you very much, this is great!