Mercurial > kallithea
changeset 6327:a2db1b9be04d
tests: add some test coverage of repo group management
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Tue, 15 Nov 2016 22:53:41 +0100 |
parents | 1b448d8a422f |
children | acdd8d23e362 |
files | kallithea/tests/functional/test_repo_groups.py |
diffstat | 1 files changed, 42 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/kallithea/tests/functional/test_repo_groups.py Mon Nov 07 15:09:13 2016 +0100 +++ b/kallithea/tests/functional/test_repo_groups.py Tue Nov 15 22:53:41 2016 +0100 @@ -12,6 +12,48 @@ self.log_user() response = self.app.get(url('new_repos_group')) + def test_create(self): + self.log_user() + + group_name = 'foo' + + # creation + response = self.app.post(url('repos_groups'), + {'group_name': group_name, + 'group_description': 'lala', + 'parent_group_id': '-1', + 'group_copy_permissions': 'True', + '_authentication_token': self.authentication_token()}) + self.checkSessionFlash(response, 'Created repository group %s' % group_name) + + # edit form + response = self.app.get(url('edit_repo_group', group_name=group_name)) + response.mustcontain('>lala<') + + # edit + response = self.app.post(url('update_repos_group', group_name=group_name), + {'group_name': group_name, + 'group_description': 'lolo', + '_authentication_token': self.authentication_token()}) + 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('>lolo<') + + # listing + response = self.app.get(url('repos_groups')) + response.mustcontain('"totalRecords": 1') + response.mustcontain('raw_name": "%s"' % group_name) + + # show + response = self.app.get(url('repos_group', group_name=group_name)) + response.mustcontain('href="/_admin/repo_groups/%s/edit"' % group_name) + + # delete + response = self.app.post(url('delete_repo_group', group_name=group_name), + {'_authentication_token': self.authentication_token()}) + self.checkSessionFlash(response, 'Removed repository group %s' % group_name) + def test_new_by_regular_user(self): self.log_user(TEST_USER_REGULAR_LOGIN, TEST_USER_REGULAR_PASS) response = self.app.get(url('new_repos_group'), status=403)