author | Adrien Di Mascio <Adrien.DiMascio@logilab.fr> |
Thu, 23 Jul 2009 15:28:41 +0200 | |
changeset 2456 | aa25d6b244c8 |
parent 1977 | 606923dff11b |
child 4212 | ab6573088b4a |
permissions | -rw-r--r-- |
1977
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1358
diff
changeset
|
1 |
"""only for unit tests ! |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1358
diff
changeset
|
2 |
|
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1358
diff
changeset
|
3 |
:organization: Logilab |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1358
diff
changeset
|
4 |
:copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2. |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1358
diff
changeset
|
5 |
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1358
diff
changeset
|
6 |
:license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1358
diff
changeset
|
7 |
""" |
0 | 8 |
|
1358 | 9 |
from cubicweb.view import EntityView |
10 |
from cubicweb.selectors import implements |
|
0 | 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' |
|
1358 | 21 |
__select__ = implements('Bug',) |
0 | 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' |
|
1358 | 31 |
__select__ = implements('Bug',) |
0 | 32 |
|
33 |
def cell_call(self, row, col): |
|
34 |
raise ValueError() |