3 :organization: Logilab |
3 :organization: Logilab |
4 :copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2. |
4 :copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2. |
5 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
5 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
6 :license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses |
6 :license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses |
7 """ |
7 """ |
8 from logilab.common.testlib import unittest_main |
8 from logilab.common.testlib import unittest_main, mock_object |
9 from logilab.common.compat import any |
9 from logilab.common.compat import any |
10 |
10 |
11 from cubicweb.devtools.testlib import CubicWebTC |
11 from cubicweb.devtools.testlib import CubicWebTC |
12 from cubicweb.web.views.autoform import AutomaticEntityForm as AEF |
12 from cubicweb.web.views.autoform import AutomaticEntityForm as AEF |
13 from cubicweb.web.formwidgets import AutoCompletionWidget |
13 from cubicweb.web.formwidgets import AutoCompletionWidget |
153 |
153 |
154 def test_automatic_inline_edit_formview(self): |
154 def test_automatic_inline_edit_formview(self): |
155 geid = self.execute('CWGroup X LIMIT 1')[0][0] |
155 geid = self.execute('CWGroup X LIMIT 1')[0][0] |
156 rset = self.execute('CWUser X LIMIT 1') |
156 rset = self.execute('CWUser X LIMIT 1') |
157 self.view('inline-edition', rset, row=0, col=0, rtype='in_group', |
157 self.view('inline-edition', rset, row=0, col=0, rtype='in_group', |
158 peid=geid, role='object', template=None, i18nctx='').source |
158 peid=geid, role='object', template=None, i18nctx='', |
|
159 pform=MOCKPFORM).source |
159 |
160 |
160 def test_automatic_inline_creation_formview(self): |
161 def test_automatic_inline_creation_formview(self): |
161 geid = self.execute('CWGroup X LIMIT 1')[0][0] |
162 geid = self.execute('CWGroup X LIMIT 1')[0][0] |
162 self.view('inline-creation', None, etype='CWUser', rtype='in_group', |
163 self.view('inline-creation', None, etype='CWUser', rtype='in_group', |
163 peid=geid, template=None, i18nctx='', role='object').source |
164 peid=geid, template=None, i18nctx='', role='object', |
|
165 pform=MOCKPFORM).source |
164 |
166 |
|
167 MOCKPFORM = mock_object(form_previous_values={}, form_valerror=None) |
165 |
168 |
166 if __name__ == '__main__': |
169 if __name__ == '__main__': |
167 unittest_main() |
170 unittest_main() |
168 |
171 |