--- a/dbapi.py Mon Oct 25 10:14:01 2010 +0200
+++ b/dbapi.py Mon Oct 25 10:15:47 2010 +0200
@@ -570,6 +570,7 @@
req.get_header = lambda x, default=None: default
req.set_session = lambda session, user=None: DBAPIRequest.set_session(
req, session, user)
+ req.relative_path = lambda includeparams=True: ''
else:
req = DBAPIRequest(self.vreg)
req.set_session(DBAPISession(self))
--- a/test/unittest_dbapi.py Mon Oct 25 10:14:01 2010 +0200
+++ b/test/unittest_dbapi.py Mon Oct 25 10:15:47 2010 +0200
@@ -76,7 +76,10 @@
self.cnx.use_web_compatible_requests('http://perdu.com')
req = self.cnx.request()
self.assertEqual(req.base_url(), 'http://perdu.com')
+ self.assertEqual(req.from_controller(), 'view')
+ self.assertEqual(req.relative_path(), '')
req.ajax_replace_url('domid') # don't crash
+ req.user.cw_adapt_to('IBreadCrumbs') # don't crash
if __name__ == '__main__':
from logilab.common.testlib import unittest_main