devtools/test/data/views/bug.py
author Sandrine Ribeau <sandrine.ribeau@logilab.fr>
Thu, 13 Nov 2008 17:28:44 -0800
changeset 72 df10dcecbd02
parent 0 b97547f5f1fa
child 1358 a7438eb2420c
permissions -rw-r--r--
merge

"""only for unit tests !"""

from cubicweb.common.view import EntityView

HTML_PAGE = u"""<html>
  <body>
    <h1>Hello World !</h1>
  </body>
</html>
"""

class SimpleView(EntityView):
    id = 'simple'
    accepts = ('Bug',)

    def call(self, **kwargs):
        self.cell_call(0, 0)

    def cell_call(self, row, col):
        self.w(HTML_PAGE)

class RaisingView(EntityView):
    id = 'raising'
    accepts = ('Bug',)

    def cell_call(self, row, col):
        raise ValueError()