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
87dfefc2
Commit
87dfefc2
authored
May 04, 2012
by
Chris Jerdonek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed a missing_tags unit test for Python 3.
parent
ad2686cf
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
pystache/tests/test_renderengine.py
+12
-2
No files found.
pystache/tests/test_renderengine.py
View file @
87dfefc2
...
...
@@ -5,6 +5,7 @@ Unit tests of renderengine.py.
"""
import
sys
import
unittest
from
pystache.context
import
ContextStack
,
KeyNotFoundError
...
...
@@ -14,6 +15,14 @@ from pystache.renderengine import context_get, RenderEngine
from
pystache.tests.common
import
AssertStringMixin
,
AssertExceptionMixin
,
Attachable
def
_get_unicode_char
():
if
sys
.
version_info
<
(
3
,
):
return
'u'
return
''
_UNICODE_CHAR
=
_get_unicode_char
()
def
mock_literal
(
s
):
"""
For use as the literal keyword argument to the RenderEngine constructor.
...
...
@@ -646,5 +655,6 @@ class RenderTests(unittest.TestCase, AssertStringMixin, AssertExceptionMixin):
self
.
_assert_render
(
u'A'
,
template
,
context
)
template
=
'{{#c}}{{a.b}}{{/c}}'
self
.
assertException
(
KeyNotFoundError
,
"Key u'a.b' not found: missing u'b'"
,
self
.
_assert_render
,
u'A.B :: (A :: )'
,
template
,
context
)
self
.
assertException
(
KeyNotFoundError
,
"Key
%(unicode)
s'a.b' not found: missing
%(unicode)
s'b'"
%
{
'unicode'
:
_UNICODE_CHAR
},
self
.
_assert_render
,
'A.B :: (A :: )'
,
template
,
context
)
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