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
28233892
Commit
28233892
authored
Dec 21, 2011
by
Chris Jerdonek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made the engine argument a keyword argument.
parent
1ab8cf8c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
tests/test_renderengine.py
+5
-6
No files found.
tests/test_renderengine.py
View file @
28233892
...
...
@@ -33,19 +33,18 @@ class RenderEngineTestCase(unittest.TestCase):
engine
=
RenderEngine
(
literal
=
literal
,
escape
=
escape
,
load_template
=
load_template
)
return
engine
def
_assert_render
(
self
,
engine
,
expected
,
template
,
*
context
):
if
engine
is
None
:
engine
=
self
.
_engine
()
def
_assert_render
(
self
,
expected
,
template
,
*
context
,
**
kwargs
):
engine
=
kwargs
[
'engine'
]
if
kwargs
else
self
.
_engine
()
context
=
Context
(
*
context
)
actual
=
engine
.
render
(
template
,
context
)
self
.
assertEquals
(
actual
,
expected
)
def
test_render
(
self
):
self
.
_assert_render
(
None
,
'Hi Mom'
,
'Hi {{person}}'
,
{
'person'
:
'Mom'
})
self
.
_assert_render
(
'Hi Mom'
,
'Hi {{person}}'
,
{
'person'
:
'Mom'
})
def
test_render_with_partial
(
self
):
partials
=
{
'partial'
:
"{{person}}"
}
engine
=
self
.
_engine
(
partials
)
self
.
_assert_render
(
engine
,
'Hi Mom'
,
'Hi {{>partial}}'
,
{
'person'
:
'Mom'
}
)
self
.
_assert_render
(
'Hi Mom'
,
'Hi {{>partial}}'
,
{
'person'
:
'Mom'
},
engine
=
engine
)
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