backport stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 23 Feb 2012 11:58:16 +0100
changeset 8258 88a7d2c49d39
parent 8253 df7d6c57a6c8 (current diff)
parent 8257 d54fc706d623 (diff)
child 8259 1c5be4a1afd1
backport stable
devtools/devctl.py
schema.py
web/controller.py
--- 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/
--- 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')
--- 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')
--- 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 <http://www.gnu.org/licenses/>.
-"""
-
-"""
 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('<a href="http://testing.fr/cubicweb/cwuser/anon" title="">anon</a>'
-                                  '</td></tr></tbody></table></div>\n</div>\n</p>\n'))
+        self.assertTrue(out.endswith('<a href="http://testing.fr/cubicweb/cwuser/anon" title="">anon</a>'
+                                     '</td></tr>\n</tbody></table></div></p>\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('<p><div class="searchMessage"><strong>No result matching query</strong></div>\n</p>\n'))
+        self.assertTrue(out.endswith('<p><div class="searchMessage"><strong>No result matching query</strong></div>\n</p>\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("<p>an error occured while interpreting this rql directive: ObjectNotFound(u'toto',)</p>"))
+        self.assertTrue(out.startswith("<p>an error occured while interpreting this rql directive: ObjectNotFound(u'toto',)</p>"))
 
     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'<p><h1>cwuser_plural</h1><div class="section"><a href="http://testing.fr/cubicweb/cwuser/admin" title="">admin</a></div><div class="section"><a href="http://testing.fr/cubicweb/cwuser/anon" title="">anon</a></div></p>\n')
+        self.assertEqual(out, u'<p><h1>CWUser_plural</h1><div class="section"><a href="http://testing.fr/cubicweb/cwuser/admin" title="">admin</a></div><div class="section"><a href="http://testing.fr/cubicweb/cwuser/anon" title="">anon</a></div></p>\n')
 
 if __name__ == '__main__':
     unittest_main()
--- 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)