Skip to content

Commit 92f3d38

Browse files
author
User
committed
Fix formatting and lint issues for Jinja2 support
- Run ruff format fix on test_jinja.py (single-line .from_string call) - Run ruff check --fix on jinja.py (sorted imports per project convention)
1 parent 3e88f99 commit 92f3d38

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

src/reactpy_django/templatetags/jinja.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,14 @@ def environment(**options):
4747
COMPONENT_TEMPLATE,
4848
PYSCRIPT_COMPONENT_TEMPLATE,
4949
PYSCRIPT_SETUP_TEMPLATE,
50+
)
51+
from reactpy_django.templatetags.reactpy import (
5052
component as django_component_tag,
53+
)
54+
from reactpy_django.templatetags.reactpy import (
5155
pyscript_component as django_pyscript_component_tag,
56+
)
57+
from reactpy_django.templatetags.reactpy import (
5258
pyscript_setup as django_pyscript_setup_tag,
5359
)
5460

tests/test_app/tests/test_jinja.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,7 @@ def test_jinja_component_renders_without_error(self):
8585
request.method = "GET"
8686

8787
jinja2_engine = engines["jinja2"]
88-
template = jinja2_engine.from_string(
89-
"{{ component('test_app.components.hello_world') }}"
90-
)
88+
template = jinja2_engine.from_string("{{ component('test_app.components.hello_world') }}")
9189
rendered = template.render({"request": request})
9290
assert isinstance(rendered, str)
9391
assert "data-reactpy" in rendered

0 commit comments

Comments
 (0)