[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').
""":organization: Logilab:copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2.:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr:license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses"""fromlogilab.common.testlibimportTestCase,unittest_main,mock_objectfromcubicweb.server.sessionimport_make_descriptionclassVariable:def__init__(self,name):self.name=nameself.children=[]defget_type(self,solution,args=None):returnsolution[self.name]defas_string(self):returnself.nameclassFunction:def__init__(self,name,varname):self.name=nameself.children=[Variable(varname)]defget_type(self,solution,args=None):return'Int'classMakeDescriptionTC(TestCase):deftest_known_values(self):solution={'A':'Int','B':'CWUser'}self.assertEquals(_make_description((Function('max','A'),Variable('B')),{},solution),['Int','CWUser'])if__name__=='__main__':unittest_main()