summaryrefslogtreecommitdiff
path: root/pystache/tests
diff options
context:
space:
mode:
authorChris Jerdonek <chris.jerdonek@gmail.com>2012-05-04 06:59:44 -0700
committerChris Jerdonek <chris.jerdonek@gmail.com>2012-05-04 06:59:44 -0700
commit87dfefc237ddbc89a03dd07aacb734f651ba2531 (patch)
tree107223279cce0caea2cecbe600b8b66cdb842995 /pystache/tests
parentad2686cf400c66f3d61dc6502b8acf9f3a8a6e21 (diff)
downloadpystache-87dfefc237ddbc89a03dd07aacb734f651ba2531.tar.gz
Fixed a missing_tags unit test for Python 3.
Diffstat (limited to 'pystache/tests')
-rw-r--r--pystache/tests/test_renderengine.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/pystache/tests/test_renderengine.py b/pystache/tests/test_renderengine.py
index e411ce9..3629708 100644
--- a/pystache/tests/test_renderengine.py
+++ b/pystache/tests/test_renderengine.py
@@ -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)