--- a/devtools/fake.py Wed May 25 11:42:31 2011 +0200
+++ b/devtools/fake.py Wed May 25 13:39:08 2011 +0200
@@ -58,7 +58,7 @@
if not (args or 'vreg' in kwargs):
kwargs['vreg'] = CubicWebVRegistry(FakeConfig(), initlog=False)
kwargs['https'] = False
- self._url = kwargs.pop('url', 'view?rql=Blop&vid=blop')
+ self._url = kwargs.pop('url', None) or 'view?rql=Blop&vid=blop'
super(FakeRequest, self).__init__(*args, **kwargs)
self._session_data = {}
self._headers_in = Headers()
--- a/devtools/httptest.py Wed May 25 11:42:31 2011 +0200
+++ b/devtools/httptest.py Wed May 25 13:39:08 2011 +0200
@@ -145,7 +145,7 @@
if passwd is None:
passwd = user
self.login(user)
- response = self.web_get("?__login=%s&__password=%s" %
+ response = self.web_get("login?__login=%s&__password=%s" %
(user, passwd))
assert response.status == httplib.SEE_OTHER, response.status
self._ident_cookie = response.getheader('Set-Cookie')
--- a/devtools/testlib.py Wed May 25 11:42:31 2011 +0200
+++ b/devtools/testlib.py Wed May 25 13:39:08 2011 +0200
@@ -613,9 +613,9 @@
return publisher
requestcls = fake.FakeRequest
- def request(self, rollbackfirst=False, **kwargs):
+ def request(self, rollbackfirst=False, url=None, **kwargs):
"""return a web ui request"""
- req = self.requestcls(self.vreg, form=kwargs)
+ req = self.requestcls(self.vreg, url=url, form=kwargs)
if rollbackfirst:
self.websession.cnx.rollback()
req.set_session(self.websession)
@@ -704,7 +704,7 @@
def init_authentication(self, authmode, anonuser=None):
self.set_auth_mode(authmode, anonuser)
- req = self.request()
+ req = self.request(url='login')
origsession = req.session
req.session = req.cnx = None
del req.execute # get back to class implementation
@@ -731,7 +731,8 @@
self.assertIsInstance(req.session, dbapi.DBAPISession)
self.assertEqual(req.session.cnx, None)
self.assertIsInstance(req.cnx, (dbapi._NeedAuthAccessMock, NoneType))
- self.assertEqual(len(self.open_sessions), nbsessions)
+ # + 1 since we should still have session without connection set
+ self.assertEqual(len(self.open_sessions), nbsessions + 1)
clear_cache(req, 'get_authorization')
# content validation #######################################################
--- a/web/views/basecontrollers.py Wed May 25 11:42:31 2011 +0200
+++ b/web/views/basecontrollers.py Wed May 25 13:39:08 2011 +0200
@@ -281,7 +281,7 @@
try:
args = [json.loads(arg) for arg in args]
except ValueError, exc:
- self.exception('error while decoding json arguments for js_%s: %s',
+ self.exception('error while decoding json arguments for js_%s: %s (err: %s)',
fname, args, exc)
raise RemoteCallFailed(exc_message(exc, self._cw.encoding))
try: