# HG changeset patch # User Sylvain Thénault # Date 1254229856 -7200 # Node ID 16880e7ee3fa5b9e70018b5cc36c600c2d5382d8 # Parent cde0ff4f7a8ce62ecdcfda580e60d1c1c3198635 don't accept None to avoid error diff -r cde0ff4f7a8c -r 16880e7ee3fa web/test/unittest_application.py --- a/web/test/unittest_application.py Tue Sep 29 15:10:13 2009 +0200 +++ b/web/test/unittest_application.py Tue Sep 29 15:10:56 2009 +0200 @@ -138,6 +138,11 @@ class ApplicationTC(EnvBasedTC): + def setUp(self): + super(ApplicationTC, self).setUp() + def raise_hdlr(*args, **kwargs): + raise + self.app.error_handler = raise_hdlr def publish(self, req, path='view'): return self.app.publish(path, req) @@ -411,6 +416,12 @@ self.assertRaises(AuthenticationError, self.publish, req, 'logout') self.assertEquals(len(self.open_sessions), 0) + def test_non_regr_optional_first_var(self): + req = self.request() + # expect a rset with None in [0][0] + req.form['rql'] = 'rql:Any OV1, X WHERE X custom_workflow OV1?' + self.publish(req) + print 'yuea' if __name__ == '__main__': unittest_main() diff -r cde0ff4f7a8c -r 16880e7ee3fa web/views/ibreadcrumbs.py --- a/web/views/ibreadcrumbs.py Tue Sep 29 15:10:13 2009 +0200 +++ b/web/views/ibreadcrumbs.py Tue Sep 29 15:10:56 2009 +0200 @@ -21,7 +21,7 @@ class BreadCrumbEntityVComponent(Component): id = 'breadcrumbs' - __select__ = one_line_rset() & implements(IBreadCrumbs) + __select__ = one_line_rset() & implements(IBreadCrumbs, accept_none=False) property_defs = { _('visible'): dict(type='Boolean', default=True, @@ -70,7 +70,8 @@ class BreadCrumbETypeVComponent(BreadCrumbEntityVComponent): - __select__ = two_lines_rset() & one_etype_rset() & implements(IBreadCrumbs) + __select__ = two_lines_rset() & one_etype_rset() & \ + implements(IBreadCrumbs, accept_none=False) def render_breadcrumbs(self, contextentity, path): # XXX hack: only display etype name or first non entity path part