Changeset - acdd8d23e362
[Not reviewed]
default
0 2 0
Mads Kiilerich - 9 years ago 2016-11-15 22:53:41
madski@unity3d.com
repo_groups: set c.active when displaying repo creation form errors through repo_group_edit.html

Writing failing tests revealed a crash.
2 files changed with 16 insertions and 1 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/admin/repo_groups.py
Show inline comments
 
@@ -236,7 +236,7 @@ class RepoGroupsController(BaseControlle
 
            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,
kallithea/tests/functional/test_repo_groups.py
Show inline comments
 
@@ -17,6 +17,13 @@ class TestRepoGroupsController(TestContr
 

	
 
        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 @@ class TestRepoGroupsController(TestContr
 
        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 @@ class TestRepoGroupsController(TestContr
 
        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
0 comments (0 inline, 0 general)