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
152c4e02
Commit
152c4e02
authored
May 14, 2010
by
Chris Wanstrath
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Contexts still can't see outer scope. Add failing test.
parent
5cd466a6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
3 deletions
+5
-3
examples/nested_context.mustache
+1
-2
examples/nested_context.py
+3
-0
tests/test_examples.py
+1
-1
No files found.
examples/nested_context.mustache
View file @
152c4e02
{{#
foo
}}{{
thing1
}}
and
{{
thing2
}}{{/
foo
}}{{^
foo
}}
Not foo!
{{/
foo
}}
\ No newline at end of file
{{#
foo
}}{{
thing1
}}
and
{{
thing2
}}
and
{{
outer_thing
}}{{/
foo
}}{{^
foo
}}
Not foo!
{{/
foo
}}
examples/nested_context.py
View file @
152c4e02
...
...
@@ -3,5 +3,8 @@ import pystache
class
NestedContext
(
pystache
.
View
):
template_path
=
'examples'
def
outer_thing
(
self
):
return
"two"
def
foo
(
self
):
return
{
'thing1'
:
'one'
,
'thing2'
:
'foo'
}
tests/test_examples.py
View file @
152c4e02
...
...
@@ -69,7 +69,7 @@ Again, Welcome!
"""
)
def
test_nested_context
(
self
):
self
.
assertEquals
(
NestedContext
()
.
render
(),
"one and foo"
)
self
.
assertEquals
(
NestedContext
()
.
render
(),
"one and foo
and two
"
)
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