devtools/test/data/views.py
changeset 4470 34f57659f90e
parent 4212 ab6573088b4a
child 5421 8167de96c523
equal deleted inserted replaced
4469:310b5f01c982 4470:34f57659f90e
       
     1 """only for unit tests !
       
     2 
       
     3 :organization: Logilab
       
     4 :copyright: 2001-2010 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2.
       
     5 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
       
     6 :license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses
       
     7 """
       
     8 
       
     9 from cubicweb.view import EntityView
       
    10 from cubicweb.selectors import implements
       
    11 
       
    12 HTML_PAGE = u"""<html>
       
    13   <body>
       
    14     <h1>Hello World !</h1>
       
    15   </body>
       
    16 </html>
       
    17 """
       
    18 
       
    19 class SimpleView(EntityView):
       
    20     __regid__ = 'simple'
       
    21     __select__ = implements('Bug',)
       
    22 
       
    23     def call(self, **kwargs):
       
    24         self.cell_call(0, 0)
       
    25 
       
    26     def cell_call(self, row, col):
       
    27         self.w(HTML_PAGE)
       
    28 
       
    29 class RaisingView(EntityView):
       
    30     __regid__ = 'raising'
       
    31     __select__ = implements('Bug',)
       
    32 
       
    33     def cell_call(self, row, col):
       
    34         raise ValueError()