# HG changeset patch # User Aurelien Campeas # Date 1270723367 -7200 # Node ID f3c2cb460ad9f2cdf8f100b8c42fafb1335c5a35 # Parent 92376b009b98fac81f30d038d9450a61f54a59e9 [doc] note on pytestconf, fixlets diff -r 92376b009b98 -r f3c2cb460ad9 doc/book/en/development/devweb/js.rst --- a/doc/book/en/development/devweb/js.rst Thu Apr 08 12:32:09 2010 +0200 +++ b/doc/book/en/development/devweb/js.rst Thu Apr 08 12:42:47 2010 +0200 @@ -5,7 +5,7 @@ *CubicWeb* uses quite a bit of javascript in its user interface and ships with jquery (1.3.x) and parts of the jquery UI library, plus a -number of homegrown files and also other thir party libraries. +number of homegrown files and also other third party libraries. All javascript files are stored in cubicweb/web/data/. There are around thirty js files there. In a cube it goes to data/. diff -r 92376b009b98 -r f3c2cb460ad9 doc/book/en/development/testing.rst --- a/doc/book/en/development/testing.rst Thu Apr 08 12:32:09 2010 +0200 +++ b/doc/book/en/development/testing.rst Thu Apr 08 12:42:47 2010 +0200 @@ -24,6 +24,10 @@ In most of the cases, you will inherit `EnvBasedTC` to write Unittest or functional tests for your entities, views, hooks, etc... +XXX pytestconf.py & options (e.g --source to use a different db +backend than sqlite) + + Managing connections or users +++++++++++++++++++++++++++++ @@ -33,10 +37,12 @@ By default, tests run with a user with admin privileges. This user/connection must never be closed. -qwq -Before a self.login, one has to release the connection pool in use with a self.commit, self.rollback or self.close. -When one is logged in as a normal user and wants to switch back to the admin user, one has to use self.restore_connection(). +Before a self.login, one has to release the connection pool in use +with a self.commit, self.rollback or self.close. + +When one is logged in as a normal user and wants to switch back to the +admin user, one has to use self.restore_connection(). Usually it looks like this: diff -r 92376b009b98 -r f3c2cb460ad9 web/_exceptions.py --- a/web/_exceptions.py Thu Apr 08 12:32:09 2010 +0200 +++ b/web/_exceptions.py Thu Apr 08 12:42:47 2010 +0200 @@ -53,8 +53,7 @@ """raised when a json remote call fails """ def __init__(self, reason=''): - #super(RequestError, self).__init__() # XXX require py >= 2.5 - RequestError.__init__(self) + super(RequestError, self).__init__() self.reason = reason def dumps(self): diff -r 92376b009b98 -r f3c2cb460ad9 web/data/cubicweb.ajax.js --- a/web/data/cubicweb.ajax.js Thu Apr 08 12:32:09 2010 +0200 +++ b/web/data/cubicweb.ajax.js Thu Apr 08 12:42:47 2010 +0200 @@ -240,6 +240,7 @@ setProgressCursor(); var props = {'fname' : fname, 'pageid' : pageid, 'arg': map(jQuery.toJSON, sliceList(arguments, 1))}; + // XXX we should inline the content of loadRemote here var deferred = loadRemote(JSON_BASE_URL, props, 'POST'); deferred = deferred.addErrback(remoteCallFailed); deferred = deferred.addErrback(resetCursor); diff -r 92376b009b98 -r f3c2cb460ad9 web/data/cubicweb.compat.js --- a/web/data/cubicweb.compat.js Thu Apr 08 12:32:09 2010 +0200 +++ b/web/data/cubicweb.compat.js Thu Apr 08 12:42:47 2010 +0200 @@ -6,22 +6,26 @@ } } +// XXX looks completely unused (candidate for removal) function getElementsByTagAndClassName(tag, klass, root) { root = root || document; // FIXME root is not used in this compat implementation return jQuery(tag + '.' + klass); } +/* jQUery flattens arrays returned by the mapping function: + >>> y = ['a:b:c', 'd:e'] + >>> jQuery.map(y, function(y) { return y.split(':');}) + ["a", "b", "c", "d", "e"] + // where one would expect: + [ ["a", "b", "c"], ["d", "e"] ] + XXX why not the same argument order as $.map and forEach ? +*/ function map(func, array) { - // XXX jQUery tends to simplify lists with only one element : - // >>> y = ['a:b:c'] - // >>> jQuery.map(y, function(y) { return y.split(':');}) - // ["a", "b", "c"] - // where I would expect : - // [ ["a", "b", "c"] ] - // return jQuery.map(array, func); var result = []; - for (var i=0,length=array.length;i