[ajax] refactor/cleanup low-level ajax functions
* loadxhtml/replacePageChunck/reload_component/reload_box deprecated in favor of loadXHTML / ajaxFuncArgs
* some other cleanups in cubicweb.ajax.js
* add js_render which will replace js_component (more generic, nicer argument passing handling)
# -*- coding: iso-8859-1 -*-"""unit tests for cubicweb.web.application:organization: Logilab:copyright: 2001-2010 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"""fromcubicweb.devtools.testlibimportCubicWebTCclassSessionTC(CubicWebTC):deftest_auto_reconnection(self):sm=self.app.session_handler.session_manager# make is if the web session has been opened by the session managersm._sessions[self.cnx.sessionid]=self.websessionsessionid=self.websession.sessionidself.assertEquals(len(sm._sessions),1)self.assertEquals(self.websession.sessionid,self.websession.cnx.sessionid)# fake the repo session is expiringself.repo.close(sessionid)# fake an incoming http query with sessionid in session cookie# don't use self.request() which try to call req.set_sessionreq=self.requestcls(self.vreg)websession=sm.get_session(req,sessionid)self.assertEquals(len(sm._sessions),1)self.assertIs(websession,self.websession)self.assertEquals(websession.sessionid,sessionid)self.assertNotEquals(websession.sessionid,websession.cnx.sessionid)if__name__=='__main__':fromlogilab.common.testlibimportunittest_mainunittest_main()