Permalink
Browse files

Merge pull request #1 from markpasc/master

Test for inverted sections with lists
  • Loading branch information...
2 parents de9f7d4 + a78d3f6 commit f9708e525a81e105c0f589b96d91c0d6e5ca663d Yuest Wang committed May 17, 2011
Showing with 14 additions and 1 deletion.
  1. +9 −0 examples/inverted.py
  2. +5 −1 tests/test_view.py
View
@@ -11,3 +11,12 @@ def f(self):
def two(self):
return 'two'
+
+class InvertedLists(Inverted):
+ template_name = 'inverted'
+
+ def t(self):
+ return [0, 1, 2]
+
+ def f(self):
+ return []
View
@@ -4,7 +4,7 @@
from examples.simple import Simple
from examples.complex_view import ComplexView
from examples.lambdas import Lambdas
-from examples.inverted import Inverted
+from examples.inverted import Inverted, InvertedLists
class TestView(unittest.TestCase):
def test_basic(self):
@@ -90,6 +90,10 @@ def test_inverted(self):
view = Inverted()
self.assertEquals(view.render(), """one, two, three""")
+ def test_inverted_lists(self):
+ view = InvertedLists()
+ self.assertEquals(view.render(), """one, two, three""")
+
if __name__ == '__main__':
unittest.main()

0 comments on commit f9708e5

Please sign in to comment.