author | Aurelien Campeas <aurelien.campeas@logilab.fr> |
Mon, 03 Jan 2011 11:22:32 +0100 | |
branch | stable |
changeset 6756 | 46297c498842 |
parent 6340 | 470d8e828fda |
child 7791 | 31bb51ea5485 |
permissions | -rw-r--r-- |
5421
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
1 |
# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
2 |
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
3 |
# |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
4 |
# This file is part of CubicWeb. |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
5 |
# |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
6 |
# CubicWeb is free software: you can redistribute it and/or modify it under the |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
7 |
# terms of the GNU Lesser General Public License as published by the Free |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
8 |
# Software Foundation, either version 2.1 of the License, or (at your option) |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
9 |
# any later version. |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
10 |
# |
5424
8ecbcbff9777
replace logilab-common by CubicWeb in disclaimer
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5421
diff
changeset
|
11 |
# CubicWeb is distributed in the hope that it will be useful, but WITHOUT |
5421
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
13 |
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
14 |
# details. |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
15 |
# |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
16 |
# You should have received a copy of the GNU Lesser General Public License along |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
17 |
# with CubicWeb. If not, see <http://www.gnu.org/licenses/>. |
1977
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
18 |
""" |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
19 |
|
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
20 |
""" |
0 | 21 |
from logilab.common.testlib import unittest_main |
22 |
||
2773
b2530e3e0afb
[testlib] #345052 and #344207: major test lib refactoring/cleanup + update usage
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2650
diff
changeset
|
23 |
from cubicweb.devtools.testlib import CubicWebTC |
0 | 24 |
|
2773
b2530e3e0afb
[testlib] #345052 and #344207: major test lib refactoring/cleanup + update usage
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2650
diff
changeset
|
25 |
class ActionsTC(CubicWebTC): |
0 | 26 |
def test_view_action(self): |
1398
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
0
diff
changeset
|
27 |
req = self.request(__message='bla bla bla', vid='rss', rql='CWUser X') |
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
0
diff
changeset
|
28 |
rset = self.execute('CWUser X') |
2813
0cf6c8005bf6
R propagate deprecation of CWRegistry.possible_vobjects
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2773
diff
changeset
|
29 |
actions = self.vreg['actions'].poss_visible_objects(req, rset=rset) |
3466
beabe54a8664
[tests] make unittest_views_actions pass again
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
2813
diff
changeset
|
30 |
vaction = [action for action in actions if action.__regid__ == 'view'][0] |
6340
470d8e828fda
[test] update test to unittest2 api (still using lgc.testlib though)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5424
diff
changeset
|
31 |
self.assertEqual(vaction.url(), 'http://testing.fr/cubicweb/view?rql=CWUser%20X') |
0 | 32 |
|
33 |
def test_sendmail_action(self): |
|
34 |
req = self.request() |
|
35 |
rset = self.execute('Any X WHERE X login "admin"', req=req) |
|
2813
0cf6c8005bf6
R propagate deprecation of CWRegistry.possible_vobjects
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2773
diff
changeset
|
36 |
actions = self.vreg['actions'].poss_visible_objects(req, rset=rset) |
3466
beabe54a8664
[tests] make unittest_views_actions pass again
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
2813
diff
changeset
|
37 |
self.failUnless([action for action in actions if action.__regid__ == 'sendemail']) |
0 | 38 |
self.login('anon') |
39 |
req = self.request() |
|
40 |
rset = self.execute('Any X WHERE X login "anon"', req=req) |
|
2813
0cf6c8005bf6
R propagate deprecation of CWRegistry.possible_vobjects
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2773
diff
changeset
|
41 |
actions = self.vreg['actions'].poss_visible_objects(req, rset=rset) |
3466
beabe54a8664
[tests] make unittest_views_actions pass again
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
2813
diff
changeset
|
42 |
self.failIf([action for action in actions if action.__regid__ == 'sendemail']) |
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1398
diff
changeset
|
43 |
|
0 | 44 |
if __name__ == '__main__': |
45 |
unittest_main() |