From 932d90b508a397a3f9018385c9e405859e1f8f5d Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Apr 15 2015 03:08:16 +0000 Subject: Adjust the code and unit-tests to user the project's setter for the settings --- diff --git a/pagure/lib/__init__.py b/pagure/lib/__init__.py index 286f843..dd9e245 100644 --- a/pagure/lib/__init__.py +++ b/pagure/lib/__init__.py @@ -824,7 +824,7 @@ def update_project_settings(session, repo, settings, user): if not update: return 'No settings to change' else: - repo.save_settings(new_settings) + repo.settings = new_settings session.add(repo) session.flush() pagure.lib.notify.fedmsg_publish( diff --git a/tests/test_progit_flask_ui_docs.py b/tests/test_progit_flask_ui_docs.py index 1e7f172..e0893d2 100644 --- a/tests/test_progit_flask_ui_docs.py +++ b/tests/test_progit_flask_ui_docs.py @@ -82,7 +82,7 @@ class PagureFlaskDocstests(tests.Modeltests): self.assertTrue( 'git clone git@pagure.org:docs/test.git' in output.data) - repo.save_settings({'project_documentation': False}) + repo.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 af4ed7c..992928a 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.save_settings({'issue_tracker': False}) + repo.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.save_settings({'issue_tracker': False}) + repo.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.save_settings({'issue_tracker': False}) + repo.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.save_settings({'issue_tracker': False}) + repo.settings = {'issue_tracker': False} self.session.add(repo) self.session.commit()