web/test/unittest_uicfg.py
author Aurelien Campeas <aurelien.campeas@logilab.fr>
Thu, 10 Jan 2013 18:34:10 +0100
changeset 8665 e65af61bde7d
parent 8030 552d85fcb587
child 8666 1dd655788ece
permissions -rw-r--r--
[uicfg] uicfg.py moves from web/ to web/views/ (prepares #2406609) We are about to make uicfg selectable. Registrable / selectable views and helpers live in web/views. Hence the move. Backward compat is put in place. However CubicWeb imports of uicfg are updated to the new location.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5421
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4997
diff changeset
     1
# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4997
diff changeset
     2
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4997
diff changeset
     3
#
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4997
diff changeset
     4
# This file is part of CubicWeb.
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4997
diff changeset
     5
#
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4997
diff changeset
     6
# CubicWeb is free software: you can redistribute it and/or modify it under the
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4997
diff changeset
     7
# terms of the GNU Lesser General Public License as published by the Free
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4997
diff changeset
     8
# Software Foundation, either version 2.1 of the License, or (at your option)
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4997
diff changeset
     9
# any later version.
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4997
diff changeset
    10
#
5424
8ecbcbff9777 replace logilab-common by CubicWeb in disclaimer
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5421
diff changeset
    11
# CubicWeb is distributed in the hope that it will be useful, but WITHOUT
5421
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4997
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4997
diff changeset
    13
# FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4997
diff changeset
    14
# details.
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4997
diff changeset
    15
#
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4997
diff changeset
    16
# You should have received a copy of the GNU Lesser General Public License along
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4997
diff changeset
    17
# with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
8030
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
    18
import copy
5842
10efd227648e [fix] fix a uicfg bug in autoform_section
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 5424
diff changeset
    19
from logilab.common.testlib import tag
3464
99bd1ea0394a [tests] make unittest_uicfg pass again by using the correct test class
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 3125
diff changeset
    20
from cubicweb.devtools.testlib import CubicWebTC
8665
e65af61bde7d [uicfg] uicfg.py moves from web/ to web/views/ (prepares #2406609)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 8030
diff changeset
    21
from cubicweb.web import uihelper, formwidgets as fwdgs
e65af61bde7d [uicfg] uicfg.py moves from web/ to web/views/ (prepares #2406609)
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 8030
diff changeset
    22
from cubicweb.web.views import uicfg
3125
52b6b8c2ccc5 [uicfg, autoform] when a relation is inlined, put it in the generated section by default
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    23
4997
aed7bdb9da54 [web test] a basic test, to be completed
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4083
diff changeset
    24
abaa = uicfg.actionbox_appearsin_addmenu
aed7bdb9da54 [web test] a basic test, to be completed
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4083
diff changeset
    25
3464
99bd1ea0394a [tests] make unittest_uicfg pass again by using the correct test class
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 3125
diff changeset
    26
class UICFGTC(CubicWebTC):
3125
52b6b8c2ccc5 [uicfg, autoform] when a relation is inlined, put it in the generated section by default
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    27
4997
aed7bdb9da54 [web test] a basic test, to be completed
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4083
diff changeset
    28
    def test_default_actionbox_appearsin_addmenu_config(self):
7791
31bb51ea5485 [deprecation] fix unittest pending deprecation warnings on failIf/failUnless methods family
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6340
diff changeset
    29
        self.assertFalse(abaa.etype_get('TrInfo', 'wf_info_for', 'object', 'CWUser'))
3125
52b6b8c2ccc5 [uicfg, autoform] when a relation is inlined, put it in the generated section by default
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    30
5842
10efd227648e [fix] fix a uicfg bug in autoform_section
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 5424
diff changeset
    31
10efd227648e [fix] fix a uicfg bug in autoform_section
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 5424
diff changeset
    32
10efd227648e [fix] fix a uicfg bug in autoform_section
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 5424
diff changeset
    33
class DefinitionOrderTC(CubicWebTC):
10efd227648e [fix] fix a uicfg bug in autoform_section
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 5424
diff changeset
    34
    """This test check that when multiple definition could match a key, only
10efd227648e [fix] fix a uicfg bug in autoform_section
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 5424
diff changeset
    35
    the more accurate apply"""
10efd227648e [fix] fix a uicfg bug in autoform_section
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 5424
diff changeset
    36
10efd227648e [fix] fix a uicfg bug in autoform_section
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 5424
diff changeset
    37
    def setUp(self):
8030
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
    38
        super(DefinitionOrderTC, self).setUp()
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
    39
        for rtag in (uicfg.autoform_section, uicfg.autoform_field_kwargs):
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
    40
            rtag._old_tagdefs = copy.deepcopy(rtag._tagdefs)
5842
10efd227648e [fix] fix a uicfg bug in autoform_section
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 5424
diff changeset
    41
        new_def = (
10efd227648e [fix] fix a uicfg bug in autoform_section
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 5424
diff changeset
    42
                    (('*', 'login', '*'),
10efd227648e [fix] fix a uicfg bug in autoform_section
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 5424
diff changeset
    43
                         {'formtype':'main', 'section':'hidden'}),
10efd227648e [fix] fix a uicfg bug in autoform_section
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 5424
diff changeset
    44
                    (('*', 'login', '*'),
10efd227648e [fix] fix a uicfg bug in autoform_section
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 5424
diff changeset
    45
                         {'formtype':'muledit', 'section':'hidden'}),
10efd227648e [fix] fix a uicfg bug in autoform_section
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 5424
diff changeset
    46
                    (('CWUser', 'login', '*'),
10efd227648e [fix] fix a uicfg bug in autoform_section
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 5424
diff changeset
    47
                         {'formtype':'main', 'section':'attributes'}),
10efd227648e [fix] fix a uicfg bug in autoform_section
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 5424
diff changeset
    48
                    (('CWUser', 'login', '*'),
10efd227648e [fix] fix a uicfg bug in autoform_section
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 5424
diff changeset
    49
                         {'formtype':'muledit', 'section':'attributes'}),
10efd227648e [fix] fix a uicfg bug in autoform_section
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 5424
diff changeset
    50
                    (('CWUser', 'login', 'String'),
10efd227648e [fix] fix a uicfg bug in autoform_section
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 5424
diff changeset
    51
                         {'formtype':'main', 'section':'inlined'}),
10efd227648e [fix] fix a uicfg bug in autoform_section
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 5424
diff changeset
    52
                    (('CWUser', 'login', 'String'),
10efd227648e [fix] fix a uicfg bug in autoform_section
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 5424
diff changeset
    53
                         {'formtype':'inlined', 'section':'attributes'}),
10efd227648e [fix] fix a uicfg bug in autoform_section
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 5424
diff changeset
    54
                    )
10efd227648e [fix] fix a uicfg bug in autoform_section
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 5424
diff changeset
    55
        for key, kwargs in new_def:
10efd227648e [fix] fix a uicfg bug in autoform_section
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 5424
diff changeset
    56
            uicfg.autoform_section.tag_subject_of(key, **kwargs)
10efd227648e [fix] fix a uicfg bug in autoform_section
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 5424
diff changeset
    57
8030
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
    58
    def tearDown(self):
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
    59
        super(DefinitionOrderTC, self).tearDown()
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
    60
        for rtag in (uicfg.autoform_section, uicfg.autoform_field_kwargs):
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
    61
            rtag._tagdefs = rtag._old_tagdefs
5842
10efd227648e [fix] fix a uicfg bug in autoform_section
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 5424
diff changeset
    62
10efd227648e [fix] fix a uicfg bug in autoform_section
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 5424
diff changeset
    63
    @tag('uicfg')
10efd227648e [fix] fix a uicfg bug in autoform_section
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 5424
diff changeset
    64
    def test_definition_order_hidden(self):
10efd227648e [fix] fix a uicfg bug in autoform_section
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 5424
diff changeset
    65
        result = uicfg.autoform_section.get('CWUser', 'login', 'String', 'subject')
10efd227648e [fix] fix a uicfg bug in autoform_section
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 5424
diff changeset
    66
        expected = set(['main_inlined', 'muledit_attributes', 'inlined_attributes'])
6340
470d8e828fda [test] update test to unittest2 api (still using lgc.testlib though)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5842
diff changeset
    67
        self.assertSetEqual(result, expected)
5842
10efd227648e [fix] fix a uicfg bug in autoform_section
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 5424
diff changeset
    68
8030
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
    69
    @tag('uihelper', 'order', 'func')
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
    70
    def test_uihelper_set_fields_order(self):
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
    71
        afk_get = uicfg.autoform_field_kwargs.get
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
    72
        self.assertEqual(afk_get('CWUser', 'firstname', 'String', 'subject'), {})
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
    73
        uihelper.set_fields_order('CWUser', ('login', 'firstname', 'surname'))
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
    74
        self.assertEqual(afk_get('CWUser', 'firstname', 'String', 'subject'), {'order': 1})
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
    75
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
    76
    @tag('uihelper', 'kwargs', 'func')
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
    77
    def test_uihelper_set_field_kwargs(self):
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
    78
        afk_get = uicfg.autoform_field_kwargs.get
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
    79
        self.assertEqual(afk_get('CWUser', 'firstname', 'String', 'subject'), {})
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
    80
        wdg = fwdgs.TextInput({'size': 30})
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
    81
        uihelper.set_field_kwargs('CWUser', 'firstname', widget=wdg)
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
    82
        self.assertEqual(afk_get('CWUser', 'firstname', 'String', 'subject'), {'widget': wdg})
5842
10efd227648e [fix] fix a uicfg bug in autoform_section
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 5424
diff changeset
    83
8030
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
    84
    @tag('uihelper', 'hidden', 'func')
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
    85
    def test_uihelper_hide_fields(self):
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
    86
        # original conf : in_group is edited in 'attributes' section everywhere
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
    87
        section_conf = uicfg.autoform_section.get('CWUser', 'in_group', '*', 'subject')
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
    88
        self.assertItemsEqual(section_conf, ['main_attributes', 'muledit_attributes'])
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
    89
        # hide field in main form
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
    90
        uihelper.hide_fields('CWUser', ('login', 'in_group'))
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
    91
        section_conf = uicfg.autoform_section.get('CWUser', 'in_group', '*', 'subject')
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
    92
        self.assertItemsEqual(section_conf, ['main_hidden', 'muledit_attributes'])
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
    93
        # hide field in muledit form
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
    94
        uihelper.hide_fields('CWUser', ('login', 'in_group'), formtype='muledit')
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
    95
        section_conf = uicfg.autoform_section.get('CWUser', 'in_group', '*', 'subject')
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
    96
        self.assertItemsEqual(section_conf, ['main_hidden', 'muledit_hidden'])
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
    97
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
    98
    @tag('uihelper', 'hidden', 'formconfig')
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
    99
    def test_uihelper_formconfig(self):
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
   100
        afk_get = uicfg.autoform_field_kwargs.get
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
   101
        class CWUserFormConfig(uihelper.FormConfig):
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
   102
            etype = 'CWUser'
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
   103
            hidden = ('in_group',)
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
   104
            fields_order = ('login', 'firstname')
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
   105
        section_conf = uicfg.autoform_section.get('CWUser', 'in_group', '*', 'subject')
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
   106
        self.assertItemsEqual(section_conf, ['main_hidden', 'muledit_attributes'])
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
   107
        self.assertEqual(afk_get('CWUser', 'firstname', 'String', 'subject'), {'order': 1})
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
   108
552d85fcb587 [uicfg] add uihelper module with high-level helpers (closes #1809414)
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 7791
diff changeset
   109
5842
10efd227648e [fix] fix a uicfg bug in autoform_section
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 5424
diff changeset
   110
3125
52b6b8c2ccc5 [uicfg, autoform] when a relation is inlined, put it in the generated section by default
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
   111
if __name__ == '__main__':
52b6b8c2ccc5 [uicfg, autoform] when a relation is inlined, put it in the generated section by default
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
   112
    from logilab.common.testlib import unittest_main
52b6b8c2ccc5 [uicfg, autoform] when a relation is inlined, put it in the generated section by default
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
   113
    unittest_main()