author | Aurelien Campeas <aurelien.campeas@logilab.fr> |
Wed, 09 May 2012 17:15:44 +0200 | |
changeset 8394 | b8b23af60019 |
parent 7791 | 31bb51ea5485 |
child 8665 | e65af61bde7d |
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:
4758
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:
4758
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:
4758
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:
4758
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:
4758
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:
4758
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:
4758
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:
4758
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:
4758
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:
4758
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:
4758
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:
4758
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:
4758
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:
4758
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:
4758
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:
4758
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:
1797
diff
changeset
|
18 |
""" |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1797
diff
changeset
|
19 |
|
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1797
diff
changeset
|
20 |
""" |
3930
c0ae3148b893
fix test: required to fake parent form
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
3771
diff
changeset
|
21 |
from logilab.common.testlib import unittest_main, mock_object |
3757 | 22 |
from logilab.common.compat import any |
3722 | 23 |
|
2773
b2530e3e0afb
[testlib] #345052 and #344207: major test lib refactoring/cleanup + update usage
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2661
diff
changeset
|
24 |
from cubicweb.devtools.testlib import CubicWebTC |
4080 | 25 |
from cubicweb.web import uicfg |
1359 | 26 |
from cubicweb.web.formwidgets import AutoCompletionWidget |
3722 | 27 |
|
4080 | 28 |
AFFK = uicfg.autoform_field_kwargs |
29 |
AFS = uicfg.autoform_section |
|
1287 | 30 |
|
4080 | 31 |
def rbc(entity, formtype, section): |
4570
ede247bbbf62
follow yams api change: attributes permissions are now defined for
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
32 |
if section in ('attributes', 'metadata', 'hidden'): |
ede247bbbf62
follow yams api change: attributes permissions are now defined for
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
33 |
permission = 'update' |
ede247bbbf62
follow yams api change: attributes permissions are now defined for
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
34 |
else: |
ede247bbbf62
follow yams api change: attributes permissions are now defined for
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
35 |
permission = 'add' |
ede247bbbf62
follow yams api change: attributes permissions are now defined for
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
36 |
return [(rschema.type, x) for rschema, tschemas, x in AFS.relations_by_section(entity, formtype, section, permission)] |
1287 | 37 |
|
2773
b2530e3e0afb
[testlib] #345052 and #344207: major test lib refactoring/cleanup + update usage
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2661
diff
changeset
|
38 |
class AutomaticEntityFormTC(CubicWebTC): |
1287 | 39 |
|
1359 | 40 |
def test_custom_widget(self): |
4080 | 41 |
AFFK.tag_subject_of(('CWUser', 'login', '*'), |
42 |
{'widget': AutoCompletionWidget(autocomplete_initfunc='get_logins')}) |
|
2661
f8df42c9da6b
[vreg api update] remove some deprecation warnings
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2643
diff
changeset
|
43 |
form = self.vreg['forms'].select('edition', self.request(), |
f8df42c9da6b
[vreg api update] remove some deprecation warnings
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2643
diff
changeset
|
44 |
entity=self.user()) |
4172
4d4cef034eec
all web tests OK
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4080
diff
changeset
|
45 |
field = form.field_by_name('login', 'subject') |
1359 | 46 |
self.assertIsInstance(field.widget, AutoCompletionWidget) |
4080 | 47 |
AFFK.del_rtag('CWUser', 'login', '*', 'subject') |
1533 | 48 |
|
1359 | 49 |
|
2637
07103211e511
R [test] update and fix deprecation warnings
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2058
diff
changeset
|
50 |
def test_cwuser_relations_by_category(self): |
2773
b2530e3e0afb
[testlib] #345052 and #344207: major test lib refactoring/cleanup + update usage
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2661
diff
changeset
|
51 |
e = self.vreg['etypes'].etype_class('CWUser')(self.request()) |
2637
07103211e511
R [test] update and fix deprecation warnings
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2058
diff
changeset
|
52 |
# see custom configuration in views.cwuser |
6340
470d8e828fda
[test] update test to unittest2 api (still using lgc.testlib though)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6315
diff
changeset
|
53 |
self.assertEqual(rbc(e, 'main', 'attributes'), |
1287 | 54 |
[('login', 'subject'), |
55 |
('upassword', 'subject'), |
|
4080 | 56 |
('firstname', 'subject'), |
57 |
('surname', 'subject'), |
|
1287 | 58 |
('in_group', 'subject'), |
59 |
]) |
|
6340
470d8e828fda
[test] update test to unittest2 api (still using lgc.testlib though)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6315
diff
changeset
|
60 |
self.assertListEqual(rbc(e, 'muledit', 'attributes'), |
4080 | 61 |
[('login', 'subject'), |
62 |
('upassword', 'subject'), |
|
63 |
('in_group', 'subject'), |
|
1287 | 64 |
]) |
6340
470d8e828fda
[test] update test to unittest2 api (still using lgc.testlib though)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6315
diff
changeset
|
65 |
self.assertListEqual(rbc(e, 'main', 'metadata'), |
1287 | 66 |
[('last_login_time', 'subject'), |
7400
2391a6f526bf
[web test] fix test broken by making cw_source editable by managers
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6427
diff
changeset
|
67 |
('cw_source', 'subject'), |
6427
c8a5ac2d1eaa
[schema / sources] store data sources as cubicweb entities
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6340
diff
changeset
|
68 |
('creation_date', 'subject'), |
c8a5ac2d1eaa
[schema / sources] store data sources as cubicweb entities
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6340
diff
changeset
|
69 |
('cwuri', 'subject'), |
3771 | 70 |
('modification_date', 'subject'), |
1287 | 71 |
('created_by', 'subject'), |
72 |
('owned_by', 'subject'), |
|
73 |
('bookmarked_by', 'object'), |
|
1533 | 74 |
]) |
4726
1357833f5595
[test] XXX fix to have pytest succeed on whole cw
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4719
diff
changeset
|
75 |
# XXX skip 'tags' relation here and in the hidden category because |
1357833f5595
[test] XXX fix to have pytest succeed on whole cw
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4719
diff
changeset
|
76 |
# of some test interdependancy when pytest is launched on whole cw |
1357833f5595
[test] XXX fix to have pytest succeed on whole cw
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4719
diff
changeset
|
77 |
# (appears here while expected in hidden |
6340
470d8e828fda
[test] update test to unittest2 api (still using lgc.testlib though)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6315
diff
changeset
|
78 |
self.assertListEqual([x for x in rbc(e, 'main', 'relations') |
4726
1357833f5595
[test] XXX fix to have pytest succeed on whole cw
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4719
diff
changeset
|
79 |
if x != ('tags', 'object')], |
7742
1273c1bc0237
[web test] fix test needed after change of primary_email definition
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7400
diff
changeset
|
80 |
[('connait', 'subject'), |
2920
64322aa83a1d
start a new workflow engine
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2661
diff
changeset
|
81 |
('custom_workflow', 'subject'), |
7742
1273c1bc0237
[web test] fix test needed after change of primary_email definition
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7400
diff
changeset
|
82 |
('primary_email', 'subject'), |
1287 | 83 |
('checked_by', 'object'), |
84 |
]) |
|
6340
470d8e828fda
[test] update test to unittest2 api (still using lgc.testlib though)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6315
diff
changeset
|
85 |
self.assertListEqual(rbc(e, 'main', 'inlined'), |
4080 | 86 |
[('use_email', 'subject'), |
87 |
]) |
|
1398
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
1359
diff
changeset
|
88 |
# owned_by is defined both as subject and object relations on CWUser |
6340
470d8e828fda
[test] update test to unittest2 api (still using lgc.testlib though)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6315
diff
changeset
|
89 |
self.assertListEqual(sorted(x for x in rbc(e, 'main', 'hidden') |
4726
1357833f5595
[test] XXX fix to have pytest succeed on whole cw
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4719
diff
changeset
|
90 |
if x != ('tags', 'object')), |
4758
0efdcf0fa4c7
fix code and tests broken by 4744:13a5d3a7410e (proper permission on eid/has_text/identity relations)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4726
diff
changeset
|
91 |
sorted([('for_user', 'object'), |
4570
ede247bbbf62
follow yams api change: attributes permissions are now defined for
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
92 |
('created_by', 'object'), |
ede247bbbf62
follow yams api change: attributes permissions are now defined for
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
93 |
('wf_info_for', 'object'), |
ede247bbbf62
follow yams api change: attributes permissions are now defined for
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
94 |
('owned_by', 'object'), |
ede247bbbf62
follow yams api change: attributes permissions are now defined for
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
95 |
])) |
1298 | 96 |
|
97 |
def test_inlined_view(self): |
|
7791
31bb51ea5485
[deprecation] fix unittest pending deprecation warnings on failIf/failUnless methods family
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7742
diff
changeset
|
98 |
self.assertTrue('main_inlined' in AFS.etype_get('CWUser', 'use_email', 'subject', 'EmailAddress')) |
31bb51ea5485
[deprecation] fix unittest pending deprecation warnings on failIf/failUnless methods family
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7742
diff
changeset
|
99 |
self.assertFalse('main_inlined' in AFS.etype_get('CWUser', 'primary_email', 'subject', 'EmailAddress')) |
31bb51ea5485
[deprecation] fix unittest pending deprecation warnings on failIf/failUnless methods family
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7742
diff
changeset
|
100 |
self.assertTrue('main_relations' in AFS.etype_get('CWUser', 'primary_email', 'subject', 'EmailAddress')) |
1533 | 101 |
|
1287 | 102 |
def test_personne_relations_by_category(self): |
2773
b2530e3e0afb
[testlib] #345052 and #344207: major test lib refactoring/cleanup + update usage
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2661
diff
changeset
|
103 |
e = self.vreg['etypes'].etype_class('Personne')(self.request()) |
6340
470d8e828fda
[test] update test to unittest2 api (still using lgc.testlib though)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6315
diff
changeset
|
104 |
self.assertListEqual(rbc(e, 'main', 'attributes'), |
1287 | 105 |
[('nom', 'subject'), |
4080 | 106 |
('prenom', 'subject'), |
1287 | 107 |
('sexe', 'subject'), |
108 |
('promo', 'subject'), |
|
109 |
('titre', 'subject'), |
|
110 |
('ass', 'subject'), |
|
111 |
('web', 'subject'), |
|
112 |
('tel', 'subject'), |
|
113 |
('fax', 'subject'), |
|
114 |
('datenaiss', 'subject'), |
|
115 |
('test', 'subject'), |
|
116 |
('description', 'subject'), |
|
4080 | 117 |
('salary', 'subject'), |
1287 | 118 |
]) |
6340
470d8e828fda
[test] update test to unittest2 api (still using lgc.testlib though)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6315
diff
changeset
|
119 |
self.assertListEqual(rbc(e, 'muledit', 'attributes'), |
4080 | 120 |
[('nom', 'subject'), |
121 |
]) |
|
6340
470d8e828fda
[test] update test to unittest2 api (still using lgc.testlib though)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6315
diff
changeset
|
122 |
self.assertListEqual(rbc(e, 'main', 'metadata'), |
7400
2391a6f526bf
[web test] fix test broken by making cw_source editable by managers
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6427
diff
changeset
|
123 |
[('cw_source', 'subject'), |
2391a6f526bf
[web test] fix test broken by making cw_source editable by managers
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6427
diff
changeset
|
124 |
('creation_date', 'subject'), |
2637
07103211e511
R [test] update and fix deprecation warnings
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2058
diff
changeset
|
125 |
('cwuri', 'subject'), |
1287 | 126 |
('modification_date', 'subject'), |
3771 | 127 |
('created_by', 'subject'), |
1287 | 128 |
('owned_by', 'subject'), |
1533 | 129 |
]) |
6340
470d8e828fda
[test] update test to unittest2 api (still using lgc.testlib though)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6315
diff
changeset
|
130 |
self.assertListEqual(rbc(e, 'main', 'relations'), |
1287 | 131 |
[('travaille', 'subject'), |
6315
8ca3ee849bee
[test] fix broken tests and minor cleanups
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5424
diff
changeset
|
132 |
('manager', 'object'), |
8ca3ee849bee
[test] fix broken tests and minor cleanups
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5424
diff
changeset
|
133 |
('connait', 'object'), |
1287 | 134 |
]) |
6340
470d8e828fda
[test] update test to unittest2 api (still using lgc.testlib though)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
6315
diff
changeset
|
135 |
self.assertListEqual(rbc(e, 'main', 'hidden'), |
4758
0efdcf0fa4c7
fix code and tests broken by 4744:13a5d3a7410e (proper permission on eid/has_text/identity relations)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4726
diff
changeset
|
136 |
[]) |
1533 | 137 |
|
1300 | 138 |
def test_edition_form(self): |
1398
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
1359
diff
changeset
|
139 |
rset = self.execute('CWUser X LIMIT 1') |
2661
f8df42c9da6b
[vreg api update] remove some deprecation warnings
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2643
diff
changeset
|
140 |
form = self.vreg['forms'].select('edition', rset.req, rset=rset, |
2058
7ef12c03447c
nicer vreg api, try to make rset an optional named argument in select and derivated (including selectors)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
141 |
row=0, col=0) |
1300 | 142 |
# should be also selectable by specifying entity |
2661
f8df42c9da6b
[vreg api update] remove some deprecation warnings
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2643
diff
changeset
|
143 |
self.vreg['forms'].select('edition', rset.req, |
2058
7ef12c03447c
nicer vreg api, try to make rset an optional named argument in select and derivated (including selectors)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
144 |
entity=rset.get_entity(0, 0)) |
7791
31bb51ea5485
[deprecation] fix unittest pending deprecation warnings on failIf/failUnless methods family
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
7742
diff
changeset
|
145 |
self.assertFalse(any(f for f in form.fields if f is None)) |
1533 | 146 |
|
147 |
||
2773
b2530e3e0afb
[testlib] #345052 and #344207: major test lib refactoring/cleanup + update usage
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2661
diff
changeset
|
148 |
class FormViewsTC(CubicWebTC): |
1300 | 149 |
def test_delete_conf_formview(self): |
1398
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
1359
diff
changeset
|
150 |
rset = self.execute('CWGroup X') |
1300 | 151 |
self.view('deleteconf', rset, template=None).source |
1533 | 152 |
|
1300 | 153 |
def test_automatic_edition_formview(self): |
1398
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
1359
diff
changeset
|
154 |
rset = self.execute('CWUser X') |
1300 | 155 |
self.view('edition', rset, row=0, template=None).source |
1533 | 156 |
|
1300 | 157 |
def test_automatic_edition_formview(self): |
1398
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
1359
diff
changeset
|
158 |
rset = self.execute('CWUser X') |
1300 | 159 |
self.view('copy', rset, row=0, template=None).source |
1533 | 160 |
|
1300 | 161 |
def test_automatic_creation_formview(self): |
1398
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
1359
diff
changeset
|
162 |
self.view('creation', None, etype='CWUser', template=None).source |
1533 | 163 |
|
1300 | 164 |
def test_automatic_muledit_formview(self): |
1398
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
1359
diff
changeset
|
165 |
rset = self.execute('CWUser X') |
1300 | 166 |
self.view('muledit', rset, template=None).source |
1533 | 167 |
|
1300 | 168 |
def test_automatic_reledit_formview(self): |
1398
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
1359
diff
changeset
|
169 |
rset = self.execute('CWUser X') |
1300 | 170 |
self.view('reledit', rset, row=0, rtype='login', template=None).source |
1533 | 171 |
|
1300 | 172 |
def test_automatic_inline_edit_formview(self): |
1398
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
1359
diff
changeset
|
173 |
geid = self.execute('CWGroup X LIMIT 1')[0][0] |
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
1359
diff
changeset
|
174 |
rset = self.execute('CWUser X LIMIT 1') |
3361
be0605689fed
[tests] fix inline-creation/edition unit tests
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
2920
diff
changeset
|
175 |
self.view('inline-edition', rset, row=0, col=0, rtype='in_group', |
4677
c701aac36f5c
[test] inline-creation requires petype argument to be selectable. Fix arguments order to make it clearer that 'template' is an argument of the test class .view method
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4570
diff
changeset
|
176 |
peid=geid, role='object', i18nctx='', pform=MOCKPFORM, |
c701aac36f5c
[test] inline-creation requires petype argument to be selectable. Fix arguments order to make it clearer that 'template' is an argument of the test class .view method
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4570
diff
changeset
|
177 |
template=None).source |
1533 | 178 |
|
1300 | 179 |
def test_automatic_inline_creation_formview(self): |
1398
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
1359
diff
changeset
|
180 |
geid = self.execute('CWGroup X LIMIT 1')[0][0] |
3361
be0605689fed
[tests] fix inline-creation/edition unit tests
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
2920
diff
changeset
|
181 |
self.view('inline-creation', None, etype='CWUser', rtype='in_group', |
4677
c701aac36f5c
[test] inline-creation requires petype argument to be selectable. Fix arguments order to make it clearer that 'template' is an argument of the test class .view method
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4570
diff
changeset
|
182 |
peid=geid, petype='CWGroup', i18nctx='', role='object', pform=MOCKPFORM, |
c701aac36f5c
[test] inline-creation requires petype argument to be selectable. Fix arguments order to make it clearer that 'template' is an argument of the test class .view method
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4570
diff
changeset
|
183 |
template=None) |
1300 | 184 |
|
3930
c0ae3148b893
fix test: required to fake parent form
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
3771
diff
changeset
|
185 |
MOCKPFORM = mock_object(form_previous_values={}, form_valerror=None) |
1533 | 186 |
|
1287 | 187 |
if __name__ == '__main__': |
188 |
unittest_main() |
|
2637
07103211e511
R [test] update and fix deprecation warnings
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2058
diff
changeset
|
189 |