1 # copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
1 # copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr |
2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr |
3 # |
3 # |
4 # This file is part of CubicWeb. |
4 # This file is part of CubicWeb. |
5 # |
5 # |
6 # CubicWeb is free software: you can redistribute it and/or modify it under the |
6 # CubicWeb is free software: you can redistribute it and/or modify it under the |
23 def test_pyvaltable(self): |
23 def test_pyvaltable(self): |
24 view = self.vreg['views'].select('pyvaltable', self.request(), |
24 view = self.vreg['views'].select('pyvaltable', self.request(), |
25 pyvalue=[[1, 'a'], [2, 'b']]) |
25 pyvalue=[[1, 'a'], [2, 'b']]) |
26 content = view.render(pyvalue=[[1, 'a'], [2, 'b']], |
26 content = view.render(pyvalue=[[1, 'a'], [2, 'b']], |
27 headers=['num', 'char']) |
27 headers=['num', 'char']) |
28 self.assertEqual(content.strip(), '''<table class="listing"> |
28 self.assertEqual(content.strip(), '''<table class="listing"><tbody>\ |
29 <thead><tr><th>num</th><th>char</th></tr> |
29 <tr class="even" onmouseout="$(this).removeClass("highlighted")" onmouseover="$(this).addClass("highlighted");"><td >1</td><td >a</td></tr> |
30 </thead><tbody><tr><td>1</td><td>a</td></tr> |
30 <tr class="odd" onmouseout="$(this).removeClass("highlighted")" onmouseover="$(this).addClass("highlighted");"><td >2</td><td >b</td></tr> |
31 <tr><td>2</td><td>b</td></tr> |
|
32 </tbody></table>''') |
31 </tbody></table>''') |
33 |
32 |
34 def test_pyvallist(self): |
33 def test_pyvallist(self): |
35 view = self.vreg['views'].select('pyvallist', self.request(), |
34 view = self.vreg['views'].select('pyvallist', self.request(), |
36 pyvalue=[1, 'a']) |
35 pyvalue=[1, 'a']) |