7 return [(rschema.type, x) for rschema, tschemas, x in AEF.erelations_by_category(entity, category)] |
7 return [(rschema.type, x) for rschema, tschemas, x in AEF.erelations_by_category(entity, category)] |
8 |
8 |
9 class AutomaticEntityFormTC(EnvBasedTC): |
9 class AutomaticEntityFormTC(EnvBasedTC): |
10 |
10 |
11 def test_custom_widget(self): |
11 def test_custom_widget(self): |
12 AEF.rwidgets.tag_relation(AutoCompletionWidget, |
12 AEF.rwidgets.tag_relation('!CWUser', 'login', '*', AutoCompletionWidget) |
13 ('CWUser', 'login', '*'), 'subject') |
|
14 form = self.vreg.select_object('forms', 'edition', self.request(), None, |
13 form = self.vreg.select_object('forms', 'edition', self.request(), None, |
15 entity=self.user()) |
14 entity=self.user()) |
16 field = form.field_by_name('login') |
15 field = form.field_by_name('login') |
17 self.assertIsInstance(field.widget, AutoCompletionWidget) |
16 self.assertIsInstance(field.widget, AutoCompletionWidget) |
18 AEF.rwidgets.del_rtag(('CWUser', 'login', '*'),'subject') |
17 AEF.rwidgets.del_rtag('!CWUser', 'login', '*') |
19 |
18 |
20 |
19 |
21 def test_euser_relations_by_category(self): |
20 def test_euser_relations_by_category(self): |
22 #for (rtype, role, stype, otype), tag in AEF.rcategories._tagdefs.items(): |
21 #for (rtype, role, stype, otype), tag in AEF.rcategories._tagdefs.items(): |
23 # if rtype == 'tags': |
22 # if rtype == 'tags': |