web/test/unittest_views_editforms.py
changeset 2643 9976f511003b
parent 2637 07103211e511
child 2661 f8df42c9da6b
equal deleted inserted replaced
2642:2d30de60a8ff 2643:9976f511003b
    15 
    15 
    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(autocomplete_initfunc='get_logins')})
    21         form = self.vreg.select('forms', 'edition', self.request(),
    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')