summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wanstrath <chris@ozmm.org>2009-11-12 19:26:09 -0800
committerChris Wanstrath <chris@ozmm.org>2009-11-12 19:26:09 -0800
commitb06c64aeb08501e16dfa4d838496e16c2c2b18bb (patch)
tree69bafd2c61b910f2fd47f15ea04f1efbdadfe05b
parent89d8c829e4fdab36a3716f80df8a169fa8f3025d (diff)
downloadpystache-b06c64aeb08501e16dfa4d838496e16c2c2b18bb.tar.gz
double section test
-rw-r--r--examples/double_section.mustache7
-rw-r--r--examples/double_section.py10
-rw-r--r--tests/test_examples.py6
3 files changed, 23 insertions, 0 deletions
diff --git a/examples/double_section.mustache b/examples/double_section.mustache
new file mode 100644
index 0000000..f5ad673
--- /dev/null
+++ b/examples/double_section.mustache
@@ -0,0 +1,7 @@
+{{#t}}
+ * first
+{{/t}}
+* {{two}}
+{{#t}}
+ * third
+{{/t}} \ No newline at end of file
diff --git a/examples/double_section.py b/examples/double_section.py
new file mode 100644
index 0000000..7085739
--- /dev/null
+++ b/examples/double_section.py
@@ -0,0 +1,10 @@
+import pystache
+
+class DoubleSection(pystache.View):
+ template_path = 'examples'
+
+ def t(self):
+ return True
+
+ def two(self):
+ return "second"
diff --git a/tests/test_examples.py b/tests/test_examples.py
index 070a814..3671386 100644
--- a/tests/test_examples.py
+++ b/tests/test_examples.py
@@ -2,8 +2,14 @@ import unittest
import pystache
from examples.comments import Comments
+from examples.double_section import DoubleSection
class TestView(unittest.TestCase):
def test_comments(self):
self.assertEquals(Comments().render(), """<h1>A Comedy of Errors</h1>
""")
+
+ def test_double_section(self):
+ self.assertEquals(DoubleSection().render(), """* first
+* second
+* third""")