[forms] edited_entity must be set before calling session_key()
EntityFieldsForm.__init__ calls FieldsForm.__init__ which in turn
calls self.session_key().
self.session_key() uses self.edited_key to compute the correct session
key. We thus need edited_entity to be set **before** calling super's __init__.
The bug only occured when EntityFieldsForm was selected because of its
one_line_rset() selector instead of match_kwargs('entity').
from cubicweb.devtools.apptest import EnvBasedTC
from cubicweb.web import uicfg
class UICFGTC(EnvBasedTC):
def test_autoform_section_inlined(self):
self.assertEquals(uicfg.autoform_is_inlined.etype_get('CWUser', 'use_email', 'subject', 'EmailAddress'),
True)
self.assertEquals(uicfg.autoform_section.etype_get('CWUser', 'use_email', 'subject', 'EmailAddress'),
'generated')
if __name__ == '__main__':
from logilab.common.testlib import unittest_main
unittest_main()