web/test/unittest_views_editforms.py
changeset 2058 7ef12c03447c
parent 1977 606923dff11b
child 2637 07103211e511
equal deleted inserted replaced
2057:0a0cbccafcb5 2058:7ef12c03447c
    16 class AutomaticEntityFormTC(EnvBasedTC):
    16 class AutomaticEntityFormTC(EnvBasedTC):
    17 
    17 
    18     def test_custom_widget(self):
    18     def test_custom_widget(self):
    19         AEF.rfields_kwargs.tag_subject_of(('CWUser', 'login', '*'),
    19         AEF.rfields_kwargs.tag_subject_of(('CWUser', 'login', '*'),
    20                                           {'widget':AutoCompletionWidget})
    20                                           {'widget':AutoCompletionWidget})
    21         form = self.vreg.select_object('forms', 'edition', self.request(), None,
    21         form = self.vreg.select('forms', 'edition', self.request(),
    22                                        entity=self.user())
    22                                 entity=self.user())
    23         field = form.field_by_name('login')
    23         field = form.field_by_name('login')
    24         self.assertIsInstance(field.widget, AutoCompletionWidget)
    24         self.assertIsInstance(field.widget, AutoCompletionWidget)
    25         AEF.rfields_kwargs.del_rtag('CWUser', 'login', '*', 'subject')
    25         AEF.rfields_kwargs.del_rtag('CWUser', 'login', '*', 'subject')
    26 
    26 
    27 
    27 
   112                                ('identity', 'object'),
   112                                ('identity', 'object'),
   113                                ])
   113                                ])
   114 
   114 
   115     def test_edition_form(self):
   115     def test_edition_form(self):
   116         rset = self.execute('CWUser X LIMIT 1')
   116         rset = self.execute('CWUser X LIMIT 1')
   117         form = self.vreg.select_object('forms', 'edition', rset.req, rset,
   117         form = self.vreg.select('forms', 'edition', rset.req, rset=rset,
   118                                        row=0, col=0)
   118                                 row=0, col=0)
   119         # should be also selectable by specifying entity
   119         # should be also selectable by specifying entity
   120         self.vreg.select_object('forms', 'edition', self.request(), None,
   120         self.vreg.select('forms', 'edition', rset.req,
   121                                 entity=rset.get_entity(0, 0))
   121                          entity=rset.get_entity(0, 0))
   122         self.failIf(any(f for f in form.fields if f is None))
   122         self.failIf(any(f for f in form.fields if f is None))
   123 
   123 
   124 
   124 
   125 class FormViewsTC(WebTest):
   125 class FormViewsTC(WebTest):
   126     def test_delete_conf_formview(self):
   126     def test_delete_conf_formview(self):