devtools/test/data/views/bug.py
author Aurelien Campeas <aurelien.campeas@logilab.fr>
Tue, 19 May 2009 15:42:32 +0200
branchstable
changeset 1870 015dfeaf1d89
parent 1358 a7438eb2420c
child 1977 606923dff11b
permissions -rw-r--r--
trailing space cleanup, js lint, a small indent for preference sections

"""only for unit tests !"""

from cubicweb.view import EntityView
from cubicweb.selectors import implements

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

class SimpleView(EntityView):
    id = 'simple'
    __select__ = implements('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'
    __select__ = implements('Bug',)

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