Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pystache_custom
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
pystache_custom
Commits
d53165ed
Commit
d53165ed
authored
Apr 08, 2012
by
Chris Jerdonek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a RenderEngine test case that strings should not be interpreted as lists.
parent
ad539070
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
pystache/tests/test_renderengine.py
+13
-2
No files found.
pystache/tests/test_renderengine.py
View file @
d53165ed
...
...
@@ -242,8 +242,8 @@ class RenderTests(unittest.TestCase, AssertStringMixin):
# Make a copy to prevent changes to item[0].
self
.
_assert_builtin_attr
(
list
(
item
[
0
]),
attr_name
,
3
)
template
=
'{{#section}}{{
pop}}{{/section}}'
context
=
{
'section'
:
item
,
'pop'
:
7
}
template
=
'{{#section}}{{
%
s}}{{/section}}'
%
attr_name
context
=
{
'section'
:
item
,
attr_name
:
7
}
self
.
_assert_render
(
u'7'
,
template
,
context
)
def
test_implicit_iterator__literal
(
self
):
...
...
@@ -376,6 +376,17 @@ class RenderTests(unittest.TestCase, AssertStringMixin):
context
=
{
'section'
:
True
,
'template'
:
'{{planet}}'
,
'planet'
:
'Earth'
}
self
.
_assert_render
(
u'{{planet}}: Earth'
,
template
,
context
)
# TODO: have this test case added to the spec.
def
test_section__string_values_not_lists
(
self
):
"""
Check that string section values are not interpreted as lists.
"""
template
=
'{{#section}}foo{{/section}}'
context
=
{
'section'
:
'123'
}
# If strings were interpreted as lists, this would give "foofoofoo".
self
.
_assert_render
(
u'foo'
,
template
,
context
)
def
test_section__nested_truthy
(
self
):
"""
Check that "nested truthy" sections get rendered.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment