summaryrefslogtreecommitdiff
path: root/tests/test_examples.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_examples.py')
-rw-r--r--tests/test_examples.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_examples.py b/tests/test_examples.py
index 4f64fac..e073efb 100644
--- a/tests/test_examples.py
+++ b/tests/test_examples.py
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
import unittest
import pystache
@@ -7,6 +9,7 @@ from examples.escaped import Escaped
from examples.unescaped import Unescaped
from examples.template_partial import TemplatePartial
from examples.delimiters import Delimiters
+from examples.unicode_output import UnicodeOutput
class TestView(unittest.TestCase):
def test_comments(self):
@@ -18,6 +21,12 @@ class TestView(unittest.TestCase):
* second
* third""")
+ def test_unicode_output(self):
+ self.assertEquals(UnicodeOutput().render(), u'<p>Name: Henri Poincaré</p>')
+
+ def test_encoded_output(self):
+ self.assertEquals(UnicodeOutput().render('utf8'), '<p>Name: Henri Poincar\xc3\xa9</p>')
+
def test_escaped(self):
self.assertEquals(Escaped().render(), "<h1>Bear &gt; Shark</h1>")