diff options
author | Chris Jerdonek <chris.jerdonek@gmail.com> | 2012-05-04 06:59:44 -0700 |
---|---|---|
committer | Chris Jerdonek <chris.jerdonek@gmail.com> | 2012-05-04 06:59:44 -0700 |
commit | 87dfefc237ddbc89a03dd07aacb734f651ba2531 (patch) | |
tree | 107223279cce0caea2cecbe600b8b66cdb842995 /pystache/tests | |
parent | ad2686cf400c66f3d61dc6502b8acf9f3a8a6e21 (diff) | |
download | pystache-87dfefc237ddbc89a03dd07aacb734f651ba2531.tar.gz |
Fixed a missing_tags unit test for Python 3.
Diffstat (limited to 'pystache/tests')
-rw-r--r-- | pystache/tests/test_renderengine.py | 14 |
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) |