equal
deleted
inserted
replaced
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 id = '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 id = 'raising' |
|
31 __select__ = implements('Bug',) |
|
32 |
|
33 def cell_call(self, row, col): |
|
34 raise ValueError() |
|