equal
deleted
inserted
replaced
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') |