author | Sylvain Thénault <sylvain.thenault@logilab.fr> |
Mon, 25 May 2009 16:09:34 +0200 | |
branch | stable |
changeset 1922 | 1a0ddb675951 |
parent 1802 | d628defebc17 |
child 1977 | 606923dff11b |
permissions | -rw-r--r-- |
0 | 1 |
from logilab.common.testlib import unittest_main |
2 |
||
3 |
from cubicweb.devtools.apptest import EnvBasedTC |
|
4 |
||
5 |
class ActionsTC(EnvBasedTC): |
|
6 |
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
|
7 |
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
|
8 |
rset = self.execute('CWUser X') |
0 | 9 |
vaction = [action for action in self.vreg.possible_vobjects('actions', req, rset) |
10 |
if action.id == 'view'][0] |
|
1398
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
0
diff
changeset
|
11 |
self.assertEquals(vaction.url(), 'http://testing.fr/cubicweb/view?rql=CWUser%20X') |
0 | 12 |
|
13 |
def test_sendmail_action(self): |
|
14 |
req = self.request() |
|
15 |
rset = self.execute('Any X WHERE X login "admin"', req=req) |
|
16 |
self.failUnless([action for action in self.vreg.possible_vobjects('actions', req, rset) |
|
17 |
if action.id == 'sendemail']) |
|
18 |
self.login('anon') |
|
19 |
req = self.request() |
|
20 |
rset = self.execute('Any X WHERE X login "anon"', req=req) |
|
21 |
self.failIf([action for action in self.vreg.possible_vobjects('actions', req, rset) |
|
22 |
if action.id == 'sendemail']) |
|
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1398
diff
changeset
|
23 |
|
0 | 24 |
if __name__ == '__main__': |
25 |
unittest_main() |