Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
clokep committed Jun 28, 2024
1 parent d24fb5a commit f5b8c8e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion render_block/django.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ def django_render_block(


def _build_block_context(template: Template, context: Context) -> None:
"""Populate the block context with BlockNodes from this template and parent templates."""
"""
Populate the block context with BlockNodes from this template and parent templates.
"""

# Ensure there's a BlockContext before rendering. This allows blocks in
# ExtendsNodes to be found by sub-templates (allowing {{ block.super }} and
Expand Down
8 changes: 6 additions & 2 deletions tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ def test_inherit(self) -> None:

def test_inherit_context(self) -> None:
"""This block is inherited from test1."""
result = render_block_to_string("test2.html", "block2", Context({"suffix2": " blah"}))
result = render_block_to_string(
"test2.html", "block2", Context({"suffix2": " blah"})
)
self.assertEqual(result, "block2 from test1 blah")

def test_multi_inherited(self) -> None:
Expand All @@ -43,7 +45,9 @@ def test_multi_inherited(self) -> None:

def test_multi_inherited_context(self) -> None:
"""A block from an included template should be available."""
result = render_block_to_string("test4.html", "block2", Context({"suffix2": " blah"}))
result = render_block_to_string(
"test4.html", "block2", Context({"suffix2": " blah"})
)
self.assertEqual(result, "block2 from test1 blah")

def test_no_block(self) -> None:
Expand Down

0 comments on commit f5b8c8e

Please sign in to comment.