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
7e130676
Commit
7e130676
authored
Dec 19, 2011
by
Chris Jerdonek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added simpler test case for issue #53.
parent
7ccb55fd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletions
+16
-1
tests/test_pystache.py
+16
-1
No files found.
tests/test_pystache.py
View file @
7e130676
...
...
@@ -68,12 +68,27 @@ class TestPystache(unittest.TestCase):
context
=
{
'users'
:
[
{
'name'
:
'Chris'
},
{
'name'
:
'Tom'
},
{
'name'
:
'PJ'
}
]
}
ret
=
pystache
.
render
(
template
,
context
)
self
.
assertEquals
(
ret
,
"""<ul><li>Chris</li><li>Tom</li><li>PJ</li></ul>"""
)
def
test_implicit_iterator
(
self
):
template
=
"""<ul>{{#users}}<li>{{.}}</li>{{/users}}</ul>"""
context
=
{
'users'
:
[
'Chris'
,
'Tom'
,
'PJ'
]
}
ret
=
pystache
.
render
(
template
,
context
)
self
.
assertEquals
(
ret
,
"""<ul><li>Chris</li><li>Tom</li><li>PJ</li></ul>"""
)
def
test_later_list_section_with_escapable_character
(
self
):
"""
This is a simple test case intended to cover issue #53.
The incorrect result was the following, when markupsafe is available
(unnecessary escaping of the second section's contents)--
AssertionError: Markup(u'foo <') != 'foo <'
"""
template
=
"""{{#s1}}foo{{/s1}} {{#s2}}<{{/s2}}"""
context
=
{
's1'
:
True
,
's2'
:
[
True
]}
actual
=
pystache
.
render
(
template
,
context
)
self
.
assertEquals
(
actual
,
"""foo <"""
)
if
__name__
==
'__main__'
:
unittest
.
main
()
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