summaryrefslogtreecommitdiff
path: root/tests/test_examples.py
diff options
context:
space:
mode:
authorChris Jerdonek <chris.jerdonek@gmail.com>2012-03-23 21:30:54 -0700
committerChris Jerdonek <chris.jerdonek@gmail.com>2012-03-23 21:30:54 -0700
commiteaee99c66735a7c2bb052bd14e828545f619c0b8 (patch)
treeda5028a5553e02130775b9898b26c92a096ef43c /tests/test_examples.py
parent4260e313f56b242ad91cb93093c4a5fa2c64553c (diff)
downloadpystache-eaee99c66735a7c2bb052bd14e828545f619c0b8.tar.gz
Converted assert_strings() to a mixin.
Diffstat (limited to 'tests/test_examples.py')
-rw-r--r--tests/test_examples.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/test_examples.py b/tests/test_examples.py
index 5c95de9..e4b41bf 100644
--- a/tests/test_examples.py
+++ b/tests/test_examples.py
@@ -12,21 +12,21 @@ from examples.unicode_output import UnicodeOutput
from examples.unicode_input import UnicodeInput
from examples.nested_context import NestedContext
from pystache import Renderer
-from tests.common import assert_strings
+from tests.common import AssertStringMixin
-class TestView(unittest.TestCase):
+class TestView(unittest.TestCase, AssertStringMixin):
def _assert(self, obj, expected):
renderer = Renderer()
actual = renderer.render(obj)
- assert_strings(self, actual, expected)
+ self.assertString(actual, expected)
def test_comments(self):
- self._assert(Comments(), "<h1>A Comedy of Errors</h1>")
+ self._assert(Comments(), u"<h1>A Comedy of Errors</h1>")
def test_double_section(self):
- self._assert(DoubleSection(), "* first\n* second\n* third")
+ self._assert(DoubleSection(), u"* first\n* second\n* third")
def test_unicode_output(self):
self.assertEquals(UnicodeOutput().render(), u'<p>Name: Henri Poincaré</p>')
@@ -36,7 +36,7 @@ class TestView(unittest.TestCase):
u'<p>If alive today, Henri Poincaré would be 156 years old.</p>')
def test_escaping(self):
- self._assert(Escaped(), "<h1>Bear &gt; Shark</h1>")
+ self._assert(Escaped(), u"<h1>Bear &gt; Shark</h1>")
def test_literal(self):
self.assertEquals(Unescaped().render(), "<h1>Bear > Shark</h1>")
@@ -48,7 +48,7 @@ Again, Welcome!""")
def test_template_partial_extension(self):
view = TemplatePartial()
view.template_extension = 'txt'
- assert_strings(self, view.render(), u"""Welcome
+ self.assertString(view.render(), u"""Welcome
-------
## Again, Welcome! ##""")
@@ -56,7 +56,7 @@ Again, Welcome!""")
def test_delimiters(self):
renderer = Renderer()
actual = renderer.render(Delimiters())
- assert_strings(self, actual, """\
+ self.assertString(actual, u"""\
* It worked the first time.
* And it worked the second time.
* Then, surprisingly, it worked the third time.