diff --git a/tests/test_progit_flask_ui_docs.py b/tests/test_progit_flask_ui_docs.py index a380299..1581e48 100644 --- a/tests/test_progit_flask_ui_docs.py +++ b/tests/test_progit_flask_ui_docs.py @@ -83,7 +83,7 @@ class PagureFlaskDocstests(tests.Modeltests): 'git clone git@pagure.fedorahosted.org:docs/test.git' in output.data) - repo.project_docs = False + repo.save_settings({'project_documentation': False}) self.session.add(repo) self.session.commit() diff --git a/tests/test_progit_flask_ui_issues.py b/tests/test_progit_flask_ui_issues.py index 9b722d8..dce6193 100644 --- a/tests/test_progit_flask_ui_issues.py +++ b/tests/test_progit_flask_ui_issues.py @@ -180,7 +180,7 @@ class PagureFlaskIssuestests(tests.Modeltests): # Project w/o issue tracker repo = pagure.lib.get_project(self.session, 'test') - repo.issue_tracker = False + repo.save_settings({'issue_tracker': False}) self.session.add(repo) self.session.commit() @@ -282,7 +282,7 @@ class PagureFlaskIssuestests(tests.Modeltests): # Project w/o issue tracker repo = pagure.lib.get_project(self.session, 'test') - repo.issue_tracker = False + repo.save_settings({'issue_tracker': False}) self.session.add(repo) self.session.commit() @@ -526,7 +526,7 @@ class PagureFlaskIssuestests(tests.Modeltests): # Project w/o issue tracker repo = pagure.lib.get_project(self.session, 'test') - repo.issue_tracker = False + repo.save_settings({'issue_tracker': False}) self.session.add(repo) self.session.commit() @@ -623,7 +623,7 @@ class PagureFlaskIssuestests(tests.Modeltests): # Project w/o issue tracker repo = pagure.lib.get_project(self.session, 'test') - repo.issue_tracker = False + repo.save_settings({'issue_tracker': False}) self.session.add(repo) self.session.commit() diff --git a/tests/test_progit_flask_ui_repo.py b/tests/test_progit_flask_ui_repo.py index dcb7027..2efdf2f 100644 --- a/tests/test_progit_flask_ui_repo.py +++ b/tests/test_progit_flask_ui_repo.py @@ -233,11 +233,11 @@ class PagureFlaskRepotests(tests.Modeltests): '' in output.data) # Both checkbox checked before self.assertTrue( - '' in output.data) + '' in output.data) self.assertTrue( - '' in output.data) + '' in output.data) csrf_token = output.data.split( 'name="csrf_token" type="hidden" value="')[1].split('">')[0] @@ -259,11 +259,11 @@ class PagureFlaskRepotests(tests.Modeltests): self.assertTrue( '' in output.data) self.assertTrue( - '' in output.data) + '' in output.data) self.assertTrue( - '' in output.data) + '' in output.data) data = {'csrf_token': csrf_token} output = self.app.post( @@ -285,11 +285,11 @@ class PagureFlaskRepotests(tests.Modeltests): self.assertTrue( '' in output.data) self.assertTrue( - '' in output.data) + '' in output.data) self.assertTrue( - '' in output.data) + '' in output.data) def test_view_forks(self): """ Test the view_forks endpoint. """ diff --git a/tests/test_progit_lib.py b/tests/test_progit_lib.py index 7675dce..95989d3 100644 --- a/tests/test_progit_lib.py +++ b/tests/test_progit_lib.py @@ -801,14 +801,17 @@ class PagureLibtests(tests.Modeltests): # Before repo = pagure.lib.get_project(self.session, 'test2') - self.assertTrue(repo.issue_tracker) - self.assertTrue(repo.project_docs) + self.assertTrue(repo.settings['issue_tracker']) + self.assertTrue(repo.settings['project_documentation']) msg = pagure.lib.update_project_settings( session=self.session, repo=repo, - issue_tracker=True, - project_docs=True, + settings={ + 'issue_tracker': True, + 'project_documentation': True, + 'pull_requests': True + }, user='pingou', ) self.assertEqual(msg, 'No settings to change') @@ -816,16 +819,19 @@ class PagureLibtests(tests.Modeltests): msg = pagure.lib.update_project_settings( session=self.session, repo=repo, - issue_tracker=False, - project_docs=False, + settings={ + 'issue_tracker': False, + 'project_documentation': False, + }, user='pingou', ) self.assertEqual(msg, 'Edited successfully settings of repo: test2') # After repo = pagure.lib.get_project(self.session, 'test2') - self.assertFalse(repo.issue_tracker) - self.assertFalse(repo.project_docs) + self.assertFalse(repo.settings['issue_tracker']) + self.assertFalse(repo.settings['project_documentation']) + self.assertFalse(repo.settings['pull_requests']) def test_search_projects(self): """ Test the search_projects of pagure.lib. """ diff --git a/tests/test_progit_lib_git.py b/tests/test_progit_lib_git.py index b8900b9..0aef788 100644 --- a/tests/test_progit_lib_git.py +++ b/tests/test_progit_lib_git.py @@ -538,7 +538,11 @@ index 458821a..77674a8 "uid": "d4182a2ac2d541d884742d3037c26e56", "repo": { "parent": None, - "issue_tracker": True, + "settings": { + "issue_tracker": True, + "project_documentation": True, + "pull_requests": True, + }, "name": "test", "date_created": "1426500194", "user": { @@ -546,7 +550,6 @@ index 458821a..77674a8 "name": "fake", "emails": ["fake@fedoraproject.org"] }, - "project_docs": True, "id": 1, "description": "test project" }, @@ -611,7 +614,6 @@ index 458821a..77674a8 "repo_from": { "parent": { "parent": None, - "issue_tracker": True, "name": "test", "date_created": "1426500194", "user": { @@ -621,11 +623,19 @@ index 458821a..77674a8 "py@pingoured.fr" ] }, - "project_docs": True, + "settings": { + "issue_tracker": True, + "project_documentation": True, + "pull_requests": True, + }, "id": 1, "description": "test project" }, - "issue_tracker": True, + "settings": { + "issue_tracker": True, + "project_documentation": True, + "pull_requests": True, + }, "name": "test", "date_created": "1426843440", "user": { @@ -635,7 +645,6 @@ index 458821a..77674a8 "pingou@fedoraproject.org" ] }, - "project_docs": True, "id": 6, "description": "test project" }, @@ -685,7 +694,6 @@ index 458821a..77674a8 "uid": "d4182a2ac2d541d884742d3037c26e57", "repo": { "parent": None, - "issue_tracker": True, "name": "test", "date_created": "1426500194", "user": { @@ -693,7 +701,11 @@ index 458821a..77674a8 "name": "fake", "emails": ["fake@fedoraproject.org"] }, - "project_docs": True, + "settings": { + "issue_tracker": True, + "project_documentation": True, + "pull_requests": True, + }, "id": 1, "description": "test project" }, @@ -711,7 +723,6 @@ index 458821a..77674a8 "repo_from": { "parent": { "parent": None, - "issue_tracker": True, "name": "test", "date_created": "1426500194", "user": { @@ -721,11 +732,19 @@ index 458821a..77674a8 "py@pingoured.fr" ] }, - "project_docs": True, + "settings": { + "issue_tracker": True, + "project_documentation": True, + "pull_requests": True, + }, "id": 1, "description": "test project" }, - "issue_tracker": True, + "settings": { + "issue_tracker": True, + "project_documentation": True, + "pull_requests": True, + }, "name": "test", "date_created": "1426843440", "user": {