equal
deleted
inserted
replaced
1 """cubicweb extensions for twill""" |
1 """cubicweb extensions for twill |
|
2 |
|
3 :organization: Logilab |
|
4 :copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
|
5 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
|
6 """ |
2 |
7 |
3 import re |
8 import re |
4 from urllib import quote |
9 from urllib import quote |
5 |
10 |
6 from twill import commands as twc |
11 from twill import commands as twc |
22 linktext = match.group(2) |
27 linktext = match.group(2) |
23 if linktext == text: |
28 if linktext == text: |
24 # if url is specified linkurl must match |
29 # if url is specified linkurl must match |
25 if url and linkurl != url: |
30 if url and linkurl != url: |
26 continue |
31 continue |
27 return |
32 return |
28 raise AssertionError('link %s (%s) not found' % (text, url)) |
33 raise AssertionError('link %s (%s) not found' % (text, url)) |
29 |
34 |
30 |
35 |
31 def view(rql, vid=''): |
36 def view(rql, vid=''): |
32 """ |
37 """ |
33 >> view 'Project P' |
38 >> view 'Project P' |
34 |
39 |
54 calls edition view for <rql> |
59 calls edition view for <rql> |
55 """ |
60 """ |
56 twc.go('view?rql=%s&vid=edition' % quote(rql)) |
61 twc.go('view?rql=%s&vid=edition' % quote(rql)) |
57 |
62 |
58 |
63 |
59 |
64 |
60 |
65 |
61 def setvalue(formname, fieldname, value): |
66 def setvalue(formname, fieldname, value): |
62 """ |
67 """ |
63 >> setvalue entityForm name pylint |
68 >> setvalue entityForm name pylint |
64 |
69 |
102 else: |
107 else: |
103 raise ValueError('could not find form named <%s>' % formname) |
108 raise ValueError('could not find form named <%s>' % formname) |
104 browser._browser.form = form |
109 browser._browser.form = form |
105 browser.submit(submit_button) |
110 browser.submit(submit_button) |
106 |
111 |
107 |
112 |
108 # missing actions: delete, copy, changeview |
113 # missing actions: delete, copy, changeview |