Mercurial > kallithea
changeset 6328:acdd8d23e362
repo_groups: set c.active when displaying repo creation form errors through repo_group_edit.html
Writing failing tests revealed a crash.
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Tue, 15 Nov 2016 22:53:41 +0100 |
parents | a2db1b9be04d |
children | 16b685da1117 |
files | kallithea/controllers/admin/repo_groups.py kallithea/tests/functional/test_repo_groups.py |
diffstat | 2 files changed, 16 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/kallithea/controllers/admin/repo_groups.py Tue Nov 15 22:53:41 2016 +0100 +++ b/kallithea/controllers/admin/repo_groups.py Tue Nov 15 22:53:41 2016 +0100 @@ -236,7 +236,7 @@ group_name = new_gr.group_name #TODO: in future action_logger(, '', '', '', self.sa) except formencode.Invalid as errors: - + c.active = 'settings' return htmlfill.render( render('admin/repo_groups/repo_group_edit.html'), defaults=errors.value,
--- a/kallithea/tests/functional/test_repo_groups.py Tue Nov 15 22:53:41 2016 +0100 +++ b/kallithea/tests/functional/test_repo_groups.py Tue Nov 15 22:53:41 2016 +0100 @@ -17,6 +17,13 @@ group_name = 'foo' + # creation with form error + response = self.app.post(url('repos_groups'), + {'group_name': group_name, + '_authentication_token': self.authentication_token()}) + response.mustcontain('name="group_name" type="text" value="%s"' % group_name) + response.mustcontain('<!-- for: group_description -->') + # creation response = self.app.post(url('repos_groups'), {'group_name': group_name, @@ -30,6 +37,13 @@ response = self.app.get(url('edit_repo_group', group_name=group_name)) response.mustcontain('>lala<') + # edit with form error + response = self.app.post(url('update_repos_group', group_name=group_name), + {'group_name': group_name, + '_authentication_token': self.authentication_token()}) + response.mustcontain('name="group_name" type="text" value="%s"' % group_name) + response.mustcontain('<!-- for: group_description -->') + # edit response = self.app.post(url('update_repos_group', group_name=group_name), {'group_name': group_name, @@ -38,6 +52,7 @@ self.checkSessionFlash(response, 'Updated repository group %s' % group_name) response = response.follow() response.mustcontain('name="group_name" type="text" value="%s"' % group_name) + response.mustcontain(no='<!-- for: group_description -->') response.mustcontain('>lolo<') # listing