Mercurial > bitten > bitten-test
changeset 329:9644b07b90c6 0.5.x
Ported [341] to 0.5.x.
author | cmlenz |
---|---|
date | Tue, 10 Jan 2006 12:31:15 +0000 |
parents | 72682b71eb3d |
children | 6a7b7b1cdbea |
files | ChangeLog bitten/__init__.py bitten/trac_ext/tests/web_ui.py bitten/trac_ext/web_ui.py |
diffstat | 4 files changed, 28 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Version 0.5.1 +(10 January 2006, from 0.5.x branch) +http://bitten.cmlenz.net/repos/bitten/tags/0.5.1 + + * Fixes compatibility with Trac 0.9.3 release, as well as the current trunk. + * Improves PostgreSQL compatibility. + * Fixes encoding of non-ASCII characters in command output. + * Fix for missing log output when using <java:ant> on Windows. + Version 0.5 (6 October 2005, from 0.5.x branch) http://bitten.cmlenz.net/repos/bitten/tags/0.5
--- a/bitten/__init__.py +++ b/bitten/__init__.py @@ -7,4 +7,4 @@ # you should have received as part of this distribution. The terms # are also available at http://bitten.cmlenz.net/wiki/License. -__version__ = '0.5' +__version__ = '0.5.1'
--- a/bitten/trac_ext/tests/web_ui.py +++ b/bitten/trac_ext/tests/web_ui.py @@ -186,6 +186,18 @@ assert module.match_request(req) self.assertRaises(TracError, module.process_request, req) + def test_new_config_submit_with_invalid_name(self): + PermissionSystem(self.env).grant_permission('joe', 'BUILD_ADMIN') + req = Mock(Request, method='POST', cgi_location='', path_info='/build', + hdf=HDFWrapper(), perm=PermissionCache(self.env, 'joe'), + args={'action': 'new', 'name': 'Foo bar', + 'path': 'test/trunk', 'label': 'Test', + 'description': 'Bla bla'}) + + module = BuildConfigController(self.env) + assert module.match_request(req) + self.assertRaises(TracError, module.process_request, req) + def test_new_config_submit_invalid_path(self): PermissionSystem(self.env).grant_permission('joe', 'BUILD_ADMIN') req = Mock(Request, method='POST', cgi_location='', path_info='/build',
--- a/bitten/trac_ext/web_ui.py +++ b/bitten/trac_ext/web_ui.py @@ -220,8 +220,12 @@ req.redirect(self.env.href.build(config.name)) def _process_config(self, req, config): - if not req.args.get('name'): + name = req.args.get('name') + if not name: raise TracError('Missing required field "name"', 'Missing field') + if not re.match(r'^[\w.-]+$', name): + raise TracError('The field "name" may only contain letters, ' + 'digits, periods, or dashes.', 'Invalid field') path = req.args.get('path', '') repos = self.env.get_repository(req.authname) @@ -247,7 +251,7 @@ except InvalidRecipeError, e: raise TracError(e, 'Invalid recipe') - config.name = req.args.get('name') + config.name = name config.path = repos.normalize_path(path) config.recipe = recipe_xml config.min_rev = req.args.get('min_rev')