1 # copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
1 # copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr |
2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr |
3 # |
3 # |
4 # This file is part of CubicWeb. |
4 # This file is part of CubicWeb. |
5 # |
5 # |
6 # CubicWeb is free software: you can redistribute it and/or modify it under the |
6 # CubicWeb is free software: you can redistribute it and/or modify it under the |
13 # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more |
13 # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more |
14 # details. |
14 # details. |
15 # |
15 # |
16 # You should have received a copy of the GNU Lesser General Public License along |
16 # You should have received a copy of the GNU Lesser General Public License along |
17 # with CubicWeb. If not, see <http://www.gnu.org/licenses/>. |
17 # with CubicWeb. If not, see <http://www.gnu.org/licenses/>. |
18 """ |
|
19 |
18 |
20 """ |
|
21 from logilab.common.testlib import unittest_main |
19 from logilab.common.testlib import unittest_main |
22 |
20 |
23 from cubicweb.devtools.testlib import CubicWebTC |
21 from cubicweb.devtools.testlib import CubicWebTC |
24 |
22 |
25 class ActionsTC(CubicWebTC): |
23 class ActionsTC(CubicWebTC): |
26 def test_view_action(self): |
24 def test_view_action(self): |
27 req = self.request(__message='bla bla bla', vid='rss', rql='CWUser X') |
25 req = self.request(vid='rss', rql='CWUser X') |
28 rset = self.execute('CWUser X') |
26 rset = self.execute('CWUser X') |
29 actions = self.vreg['actions'].poss_visible_objects(req, rset=rset) |
27 actions = self.vreg['actions'].poss_visible_objects(req, rset=rset) |
30 vaction = [action for action in actions if action.__regid__ == 'view'][0] |
28 vaction = [action for action in actions if action.__regid__ == 'view'][0] |
31 self.assertEqual(vaction.url(), 'http://testing.fr/cubicweb/view?rql=CWUser%20X') |
29 self.assertEqual(vaction.url(), 'http://testing.fr/cubicweb/view?rql=CWUser%20X') |
32 |
30 |