Skip to content
This repository was archived by the owner on Nov 15, 2022. It is now read-only.

Commit ed5a13c

Browse files
committed
add test for kwarg in viewblock
1 parent 7c4af96 commit ed5a13c

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

tests/basic/tests.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,19 @@ def test_nested_block_views(self):
102102
def test_view_kwargs(self):
103103
res = self.get_with_context(
104104
"{% load view_composer %}"
105-
"{% view 'basic.views.KwargsTestView' food='spam' with ham='eggs' %}", {}
105+
"{% view 'basic.views.KwargsTestView' food='spam' with ham='eggs' %}",
106+
{},
107+
)
108+
test_ctx = jsonpickle.decode(res)
109+
self.assertEqual(test_ctx["food_kwarg"], "spam")
110+
self.assertEqual(test_ctx["ham"], "eggs")
111+
112+
def test_viewblock_kwargs(self):
113+
res = self.get_with_context(
114+
"{% load view_composer %}"
115+
"{% viewblock 'basic.views.KwargsTestView' food='spam' with ham='eggs' %}"
116+
"{% endviewblock %}",
117+
{},
106118
)
107119
test_ctx = jsonpickle.decode(res)
108120
self.assertEqual(test_ctx["food_kwarg"], "spam")

0 commit comments

Comments
 (0)