summaryrefslogtreecommitdiff
path: root/tests/test_examples.py
diff options
context:
space:
mode:
authorEric Naeseth <enaeseth@gmail.com>2010-01-17 06:35:50 +0800
committerChris Wanstrath <chris@ozmm.org>2010-02-09 18:35:26 +0800
commit112ac76d615bd7051daeaabc170298a854d4c0f1 (patch)
tree72340129f79043df1b05214c0813646b7879b9bd /tests/test_examples.py
parente38a953b8f3f835756a9c92aac2a073f7a76ef60 (diff)
downloadpystache-112ac76d615bd7051daeaabc170298a854d4c0f1.tar.gz
Adding support for Unicode and non-ASCII-encoded bytestring output.
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>")