devtools/test/data/views/bug.py
changeset 0 b97547f5f1fa
child 1358 a7438eb2420c
equal deleted inserted replaced
-1:000000000000 0:b97547f5f1fa
       
     1 """only for unit tests !"""
       
     2 
       
     3 from cubicweb.common.view import EntityView
       
     4 
       
     5 HTML_PAGE = u"""<html>
       
     6   <body>
       
     7     <h1>Hello World !</h1>
       
     8   </body>
       
     9 </html>
       
    10 """
       
    11 
       
    12 class SimpleView(EntityView):
       
    13     id = 'simple'
       
    14     accepts = ('Bug',)
       
    15 
       
    16     def call(self, **kwargs):
       
    17         self.cell_call(0, 0)
       
    18 
       
    19     def cell_call(self, row, col):
       
    20         self.w(HTML_PAGE)
       
    21 
       
    22 class RaisingView(EntityView):
       
    23     id = 'raising'
       
    24     accepts = ('Bug',)
       
    25 
       
    26     def cell_call(self, row, col):
       
    27         raise ValueError()