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 |
|
9 from logilab.common.compat import any |
|
10 |
9 from cubicweb.devtools.testlib import CubicWebTC |
11 from cubicweb.devtools.testlib import CubicWebTC |
10 from cubicweb.web.views.autoform import AutomaticEntityForm as AEF |
12 from cubicweb.web.views.autoform import AutomaticEntityForm as AEF |
11 from cubicweb.web.formwidgets import AutoCompletionWidget |
13 from cubicweb.web.formwidgets import AutoCompletionWidget |
|
14 |
12 def rbc(entity, category): |
15 def rbc(entity, category): |
13 return [(rschema.type, x) for rschema, tschemas, x in AEF.erelations_by_category(entity, category)] |
16 return [(rschema.type, x) for rschema, tschemas, x in AEF.erelations_by_category(entity, category)] |
14 |
17 |
15 class AutomaticEntityFormTC(CubicWebTC): |
18 class AutomaticEntityFormTC(CubicWebTC): |
16 |
19 |