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
39a0d591
Commit
39a0d591
authored
Apr 25, 2012
by
Chris Jerdonek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add RenderEngine test cases for "falsey" context values.
parent
340c2991
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
pystache/tests/test_renderengine.py
+21
-0
No files found.
pystache/tests/test_renderengine.py
View file @
39a0d591
...
...
@@ -204,6 +204,27 @@ class RenderTests(unittest.TestCase, AssertStringMixin):
context
=
{
'test'
:
'{{#hello}}'
}
self
.
_assert_render
(
u'{{#hello}}'
,
template
,
context
)
## Test interpolation with "falsey" values
#
# In these test cases, we test the part of the spec that says that
# "data should be coerced into a string (and escaped, if appropriate)
# before interpolation." We test this for data that is "falsey."
def
test_interpolation__falsey__zero
(
self
):
template
=
'{{.}}'
context
=
0
self
.
_assert_render
(
u'0'
,
template
,
context
)
def
test_interpolation__falsey__none
(
self
):
template
=
'{{.}}'
context
=
None
self
.
_assert_render
(
u'None'
,
template
,
context
)
def
test_interpolation__falsey__zero
(
self
):
template
=
'{{.}}'
context
=
False
self
.
_assert_render
(
u'False'
,
template
,
context
)
# Built-in types:
#
# Confirm that we not treat instances of built-in types as objects,
...
...
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