# HG changeset patch # User Sylvain Thénault # Date 1329994696 -3600 # Node ID 88a7d2c49d39b42e73502c47ea847a80bbf77503 # Parent df7d6c57a6c83877130cb2994a445b2e6945ea34# Parent d54fc706d623f1b0458893096f481cd4909d480d backport stable diff -r df7d6c57a6c8 -r 88a7d2c49d39 .hgignore --- a/.hgignore Wed Feb 22 09:31:54 2012 +0100 +++ b/.hgignore Thu Feb 23 11:58:16 2012 +0100 @@ -14,6 +14,7 @@ .*/data/database/.*\.sqlite .*/data/database/.*\.config .*/data/database/tmpdb.* +.*/data/ldapdb/.* ^doc/html/ ^doc/doctrees/ ^doc/book/en/devweb/js_api/ diff -r df7d6c57a6c8 -r 88a7d2c49d39 devtools/devctl.py --- a/devtools/devctl.py Wed Feb 22 09:31:54 2012 +0100 +++ b/devtools/devctl.py Thu Feb 23 11:58:16 2012 +0100 @@ -303,7 +303,7 @@ from logilab.common.shellutils import globfind, find, rm from logilab.common.modutils import get_module_files from cubicweb.i18n import extract_from_tal, execute - tempdir = tempfile.mkdtemp() + tempdir = tempfile.mkdtemp(prefix='cw-') cwi18ndir = WebConfiguration.i18n_lib_dir() print '-> extract schema messages.' schemapot = osp.join(tempdir, 'schema.pot') diff -r df7d6c57a6c8 -r 88a7d2c49d39 devtools/qunit.py --- a/devtools/qunit.py Wed Feb 22 09:31:54 2012 +0100 +++ b/devtools/qunit.py Thu Feb 23 11:58:16 2012 +0100 @@ -64,7 +64,7 @@ def __init__(self, url=None): self._process = None - self._tmp_dir = mkdtemp() + self._tmp_dir = mkdtemp(prefix='cwtest-ffxprof-') self._profile_data = {'uid': uuid4()} self._profile_name = self.profile_name_mask % self._profile_data fnull = open(os.devnull, 'w') diff -r df7d6c57a6c8 -r 88a7d2c49d39 ext/test/unittest_rest.py --- a/ext/test/unittest_rest.py Wed Feb 22 09:31:54 2012 +0100 +++ b/ext/test/unittest_rest.py Thu Feb 23 11:58:16 2012 +0100 @@ -1,4 +1,4 @@ -# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of CubicWeb. @@ -15,9 +15,6 @@ # # You should have received a copy of the GNU Lesser General Public License along # with CubicWeb. If not, see . -""" - -""" from logilab.common.testlib import unittest_main from cubicweb.devtools.testlib import CubicWebTC @@ -60,23 +57,23 @@ def test_rql_role_with_vid(self): context = self.context() out = rest_publish(context, ':rql:`Any X WHERE X is CWUser:table`') - self.assert_(out.endswith('anon' - '\n\n

\n')) + self.assertTrue(out.endswith('anon' + '\n

\n')) def test_rql_role_with_vid_empty_rset(self): context = self.context() out = rest_publish(context, ':rql:`Any X WHERE X is CWUser, X login "nono":table`') - self.assert_(out.endswith('

No result matching query
\n

\n')) + self.assertTrue(out.endswith('

No result matching query
\n

\n')) def test_rql_role_with_unknown_vid(self): context = self.context() out = rest_publish(context, ':rql:`Any X WHERE X is CWUser:toto`') - self.assert_(out.startswith("

an error occured while interpreting this rql directive: ObjectNotFound(u'toto',)

")) + self.assertTrue(out.startswith("

an error occured while interpreting this rql directive: ObjectNotFound(u'toto',)

")) def test_rql_role_without_vid(self): context = self.context() out = rest_publish(context, ':rql:`Any X WHERE X is CWUser`') - self.assertEqual(out, u'

cwuser_plural

\n') + self.assertEqual(out, u'

CWUser_plural

\n') if __name__ == '__main__': unittest_main() diff -r df7d6c57a6c8 -r 88a7d2c49d39 schema.py diff -r df7d6c57a6c8 -r 88a7d2c49d39 web/controller.py --- a/web/controller.py Wed Feb 22 09:31:54 2012 +0100 +++ b/web/controller.py Thu Feb 23 11:58:16 2012 +0100 @@ -207,10 +207,12 @@ if '__redirectpath' in self._cw.form: # if redirect path was explicitly specified in the form, use it path = self._cw.form['__redirectpath'] - url = self._cw.build_url(path, **newparams) + url = self._cw.build_url(path) url = append_url_params(url, self._cw.form.get('__redirectparams')) else: url = self._cw.last_visited_page() + # The newparams must update the params in all cases + url = self._cw.rebuild_url(url, **newparams) raise Redirect(url)