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
e18826ed
Commit
e18826ed
authored
Dec 18, 2011
by
Chris Jerdonek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a passing unit test for issue #8.
parent
c180cc76
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
tests/test_template.py
+17
-0
No files found.
tests/test_template.py
View file @
e18826ed
...
@@ -159,3 +159,20 @@ class TemplateTestCase(unittest.TestCase):
...
@@ -159,3 +159,20 @@ class TemplateTestCase(unittest.TestCase):
template
.
disable_escape
=
True
template
.
disable_escape
=
True
self
.
assertEquals
(
template
.
render
(
context
),
'1 < 2'
)
self
.
assertEquals
(
template
.
render
(
context
),
'1 < 2'
)
def
test_render__list_referencing_outer_context
(
self
):
"""
Check that list items can access the parent context.
For sections whose value is a list, check that items in the list
have access to the values inherited from the parent context
when rendering.
"""
context
=
{
"list"
:
[{
"name"
:
"Al"
},
{
"name"
:
"Bo"
}],
"greeting"
:
"Hi"
,
}
template
=
Template
(
"{{#list}}{{name}}: {{greeting}}; {{/list}}"
)
self
.
assertEquals
(
template
.
render
(
context
),
"Al: Hi; Bo: Hi; "
)
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