{"action":"created","comment":{"url":"https://api.github.com/repos/4teamwork/opengever.core/pulls/comments/64540886","id":64540886,"diff_hunk":"@@ -154,3 +158,104 @@ def test_committee_group_is_not_editable_for_users_with_missing_permission(self,\n         browser.login(username='hugo.boss').visit(committee, view='edit')\n         with self.assertRaises(FormFieldNotFound):\n             browser.fill({self.group_field_name: 'client1_users'})\n+\n+\n+\n+\n+class TestCommitteeWorkflow(FunctionalTestCase):\n+\n+    def test_initial_state_is_active(self):\n+        committee = create(Builder('committee').titled(u'My Committee'))\n+        self.assertEqual(Committee.STATE_ACTIVE,\n+                         committee.load_model().get_state())\n+\n+    @browsing\n+    def test_can_be_deactivated(self, browser):\n+        committee = create(Builder('committee').titled(u'My Committee'))\n+\n+        browser.login().open(committee)\n+        browser.find('Deactivate').click()\n+\n+        self.assertEqual(Committee.STATE_INACTIVE,\n+                         committee.load_model().get_state())\n+        self.assertEqual(['Committee deactivated successfully'],\n+                         info_messages())\n+\n+    @browsing\n+    def test_deactivating_is_not_possible_when_pending_meetings_exists(self, browser):\n+        committee = create(Builder('committee').titled(u'My Committee'))\n+        create(Builder('meeting').having(committee=committee))\n+\n+        browser.login().open(committee)\n+        browser.find('Deactivate').click()\n+\n+        self.assertEqual(['Not all meetings are closed.'], error_messages())\n+        self.assertEqual(Committee.STATE_ACTIVE,\n+                         committee.load_model().get_state())\n+\n+    @browsing\n+    def test_when_unscheduled_proposals_exist(self, browser):\n+        repo = create(Builder('repository'))\n+        dossier = create(Builder('dossier').within(repo))\n+        committee = create(Builder('committee').titled(u'My Committee'))\n+        proposal = create(Builder('proposal')\n+                          .within(dossier)\n+                          .having(committee=committee.load_model()))\n+        create(Builder('submitted_proposal').submitting(proposal))\n+\n+        browser.login().open(committee)\n+        browser.find('Deactivate').click()\n+\n+        self.assertEqual(\n+            ['There are unscheduled proposals submitted to this committee.'],\n+            error_messages())\n+        self.assertEqual(Committee.STATE_ACTIVE,\n+                         committee.load_model().get_state())\n+\n+    @browsing\n+    def test_deactivated_comittee_can_be_reactivated(self, browser):\n+        committee = create(Builder('committee')\n+                           .titled(u'My Committee')\n+                           .in_state('committee-state-inactive'))\n+        model = committee.load_model()\n+\n+        model.workflow.execute_transition(committee, model, 'active-inactive')\n+        transaction.commit()\n+\n+        browser.login().open(committee)\n+        browser.find('Activate').click()\n+\n+        self.assertEqual(Committee.STATE_ACTIVE,\n+                         committee.load_model().get_state())\n+        self.assertEqual(['Committee reactivated successfully'],\n+                         info_messages())\n+\n+    @browsing\n+    def test_add_meeting_is_not_available_on_inactive_committee(self, browser):\n+        committee = create(Builder('committee')\n+                           .titled(u'My Committee')\n+                           .in_state('committee-state-inactive'))\n+        model = committee.load_model()\n+\n+        model.workflow.execute_transition(committee, model, 'active-inactive')\n+        transaction.commit()\n+\n+        browser.login().open(committee)\n+        self.assertEqual(\n+            [],\n+            browser.css('#plone-contentmenu-factories #add-meeting'))\n+\n+    @browsing\n+    def test_add_membership_is_not_available_on_inactive_committee(self, browser):\n+        committee = create(Builder('committee')\n+                           .titled(u'My Committee')\n+                           .in_state('committee-state-inactive'))","path":"opengever/meeting/tests/test_committee.py","position":109,"original_position":109,"commit_id":"8d6646ece9b8de02c43664276f523d6aab41b8cb","original_commit_id":"8d6646ece9b8de02c43664276f523d6aab41b8cb","user":{"login":"deiferni","id":736583,"avatar_url":"https://avatars.githubusercontent.com/u/736583?v=3","gravatar_id":"","url":"https://api.github.com/users/deiferni","html_url":"https://github.com/deiferni","followers_url":"https://api.github.com/users/deiferni/followers","following_url":"https://api.github.com/users/deiferni/following{/other_user}","gists_url":"https://api.github.com/users/deiferni/gists{/gist_id}","starred_url":"https://api.github.com/users/deiferni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deiferni/subscriptions","organizations_url":"https://api.github.com/users/deiferni/orgs","repos_url":"https://api.github.com/users/deiferni/repos","events_url":"https://api.github.com/users/deiferni/events{/privacy}","received_events_url":"https://api.github.com/users/deiferni/received_events","type":"User","site_admin":false},"body":"same here","created_at":"2016-05-25T09:19:55Z","updated_at":"2016-05-25T09:19:55Z","html_url":"https://github.com/4teamwork/opengever.core/pull/1849#discussion_r64540886","pull_request_url":"https://api.github.com/repos/4teamwork/opengever.core/pulls/1849","_links":{"self":{"href":"https://api.github.com/repos/4teamwork/opengever.core/pulls/comments/64540886"},"html":{"href":"https://github.com/4teamwork/opengever.core/pull/1849#discussion_r64540886"},"pull_request":{"href":"https://api.github.com/repos/4teamwork/opengever.core/pulls/1849"}}},"pull_request":{"url":"https://api.github.com/repos/4teamwork/opengever.core/pulls/1849","id":71336300,"html_url":"https://github.com/4teamwork/opengever.core/pull/1849","diff_url":"https://github.com/4teamwork/opengever.core/pull/1849.diff","patch_url":"https://github.com/4teamwork/opengever.core/pull/1849.patch","issue_url":"https://api.github.com/repos/4teamwork/opengever.core/issues/1849","number":1849,"state":"open","locked":false,"title":"Add Committee workflow (active/inactive)","user":{"login":"phgross","id":485755,"avatar_url":"https://avatars.githubusercontent.com/u/485755?v=3","gravatar_id":"","url":"https://api.github.com/users/phgross","html_url":"https://github.com/phgross","followers_url":"https://api.github.com/users/phgross/followers","following_url":"https://api.github.com/users/phgross/following{/other_user}","gists_url":"https://api.github.com/users/phgross/gists{/gist_id}","starred_url":"https://api.github.com/users/phgross/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phgross/subscriptions","organizations_url":"https://api.github.com/users/phgross/orgs","repos_url":"https://api.github.com/users/phgross/repos","events_url":"https://api.github.com/users/phgross/events{/privacy}","received_events_url":"https://api.github.com/users/phgross/received_events","type":"User","site_admin":false},"body":"Add new Workflow for the `Committee` Model including an active and an inactive state. Deactivating a dossier is only possible, if all meetings are closed and no unscheduled proposals are assigned to the committee exists.\r\n\r\nThe choice of committee when creating a proposal is limited to only active committees. Also submitting a proposal to a inactive committtee is prohibited by the system. Adding new content (Meeting, Membership) to a inactive committee is not possible.\r\n\r\nThe committees view is extendend with a statefilter and shows only active committees by default. Besides inactive dossiers are styled a bit darker than active ones.\r\n\r\n@deiferni \r\n\r\nCloses #1805 ","created_at":"2016-05-25T06:24:43Z","updated_at":"2016-05-25T09:19:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3ca760d462c8cda3c81114c0d1c84bebb4fee854","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/4teamwork/opengever.core/pulls/1849/commits","review_comments_url":"https://api.github.com/repos/4teamwork/opengever.core/pulls/1849/comments","review_comment_url":"https://api.github.com/repos/4teamwork/opengever.core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/4teamwork/opengever.core/issues/1849/comments","statuses_url":"https://api.github.com/repos/4teamwork/opengever.core/statuses/8d6646ece9b8de02c43664276f523d6aab41b8cb","head":{"label":"4teamwork:pg_deactivate_committee","ref":"pg_deactivate_committee","sha":"8d6646ece9b8de02c43664276f523d6aab41b8cb","user":{"login":"4teamwork","id":681821,"avatar_url":"https://avatars.githubusercontent.com/u/681821?v=3","gravatar_id":"","url":"https://api.github.com/users/4teamwork","html_url":"https://github.com/4teamwork","followers_url":"https://api.github.com/users/4teamwork/followers","following_url":"https://api.github.com/users/4teamwork/following{/other_user}","gists_url":"https://api.github.com/users/4teamwork/gists{/gist_id}","starred_url":"https://api.github.com/users/4teamwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/4teamwork/subscriptions","organizations_url":"https://api.github.com/users/4teamwork/orgs","repos_url":"https://api.github.com/users/4teamwork/repos","events_url":"https://api.github.com/users/4teamwork/events{/privacy}","received_events_url":"https://api.github.com/users/4teamwork/received_events","type":"Organization","site_admin":false},"repo":{"id":9788097,"name":"opengever.core","full_name":"4teamwork/opengever.core","owner":{"login":"4teamwork","id":681821,"avatar_url":"https://avatars.githubusercontent.com/u/681821?v=3","gravatar_id":"","url":"https://api.github.com/users/4teamwork","html_url":"https://github.com/4teamwork","followers_url":"https://api.github.com/users/4teamwork/followers","following_url":"https://api.github.com/users/4teamwork/following{/other_user}","gists_url":"https://api.github.com/users/4teamwork/gists{/gist_id}","starred_url":"https://api.github.com/users/4teamwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/4teamwork/subscriptions","organizations_url":"https://api.github.com/users/4teamwork/orgs","repos_url":"https://api.github.com/users/4teamwork/repos","events_url":"https://api.github.com/users/4teamwork/events{/privacy}","received_events_url":"https://api.github.com/users/4teamwork/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/4teamwork/opengever.core","description":"OneGov GEVER core package","fork":false,"url":"https://api.github.com/repos/4teamwork/opengever.core","forks_url":"https://api.github.com/repos/4teamwork/opengever.core/forks","keys_url":"https://api.github.com/repos/4teamwork/opengever.core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/4teamwork/opengever.core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/4teamwork/opengever.core/teams","hooks_url":"https://api.github.com/repos/4teamwork/opengever.core/hooks","issue_events_url":"https://api.github.com/repos/4teamwork/opengever.core/issues/events{/number}","events_url":"https://api.github.com/repos/4teamwork/opengever.core/events","assignees_url":"https://api.github.com/repos/4teamwork/opengever.core/assignees{/user}","branches_url":"https://api.github.com/repos/4teamwork/opengever.core/branches{/branch}","tags_url":"https://api.github.com/repos/4teamwork/opengever.core/tags","blobs_url":"https://api.github.com/repos/4teamwork/opengever.core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/4teamwork/opengever.core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/4teamwork/opengever.core/git/refs{/sha}","trees_url":"https://api.github.com/repos/4teamwork/opengever.core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/4teamwork/opengever.core/statuses/{sha}","languages_url":"https://api.github.com/repos/4teamwork/opengever.core/languages","stargazers_url":"https://api.github.com/repos/4teamwork/opengever.core/stargazers","contributors_url":"https://api.github.com/repos/4teamwork/opengever.core/contributors","subscribers_url":"https://api.github.com/repos/4teamwork/opengever.core/subscribers","subscription_url":"https://api.github.com/repos/4teamwork/opengever.core/subscription","commits_url":"https://api.github.com/repos/4teamwork/opengever.core/commits{/sha}","git_commits_url":"https://api.github.com/repos/4teamwork/opengever.core/git/commits{/sha}","comments_url":"https://api.github.com/repos/4teamwork/opengever.core/comments{/number}","issue_comment_url":"https://api.github.com/repos/4teamwork/opengever.core/issues/comments{/number}","contents_url":"https://api.github.com/repos/4teamwork/opengever.core/contents/{+path}","compare_url":"https://api.github.com/repos/4teamwork/opengever.core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/4teamwork/opengever.core/merges","archive_url":"https://api.github.com/repos/4teamwork/opengever.core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/4teamwork/opengever.core/downloads","issues_url":"https://api.github.com/repos/4teamwork/opengever.core/issues{/number}","pulls_url":"https://api.github.com/repos/4teamwork/opengever.core/pulls{/number}","milestones_url":"https://api.github.com/repos/4teamwork/opengever.core/milestones{/number}","notifications_url":"https://api.github.com/repos/4teamwork/opengever.core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/4teamwork/opengever.core/labels{/name}","releases_url":"https://api.github.com/repos/4teamwork/opengever.core/releases{/id}","deployments_url":"https://api.github.com/repos/4teamwork/opengever.core/deployments","created_at":"2013-05-01T08:28:16Z","updated_at":"2016-01-11T16:37:49Z","pushed_at":"2016-05-25T09:18:58Z","git_url":"git://github.com/4teamwork/opengever.core.git","ssh_url":"git@github.com:4teamwork/opengever.core.git","clone_url":"https://github.com/4teamwork/opengever.core.git","svn_url":"https://github.com/4teamwork/opengever.core","homepage":"","size":23822,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":171,"forks":1,"open_issues":171,"watchers":2,"default_branch":"master"}},"base":{"label":"4teamwork:master","ref":"master","sha":"9a4f8e052234fc81d2a335afe3a1e20ebd7a3b96","user":{"login":"4teamwork","id":681821,"avatar_url":"https://avatars.githubusercontent.com/u/681821?v=3","gravatar_id":"","url":"https://api.github.com/users/4teamwork","html_url":"https://github.com/4teamwork","followers_url":"https://api.github.com/users/4teamwork/followers","following_url":"https://api.github.com/users/4teamwork/following{/other_user}","gists_url":"https://api.github.com/users/4teamwork/gists{/gist_id}","starred_url":"https://api.github.com/users/4teamwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/4teamwork/subscriptions","organizations_url":"https://api.github.com/users/4teamwork/orgs","repos_url":"https://api.github.com/users/4teamwork/repos","events_url":"https://api.github.com/users/4teamwork/events{/privacy}","received_events_url":"https://api.github.com/users/4teamwork/received_events","type":"Organization","site_admin":false},"repo":{"id":9788097,"name":"opengever.core","full_name":"4teamwork/opengever.core","owner":{"login":"4teamwork","id":681821,"avatar_url":"https://avatars.githubusercontent.com/u/681821?v=3","gravatar_id":"","url":"https://api.github.com/users/4teamwork","html_url":"https://github.com/4teamwork","followers_url":"https://api.github.com/users/4teamwork/followers","following_url":"https://api.github.com/users/4teamwork/following{/other_user}","gists_url":"https://api.github.com/users/4teamwork/gists{/gist_id}","starred_url":"https://api.github.com/users/4teamwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/4teamwork/subscriptions","organizations_url":"https://api.github.com/users/4teamwork/orgs","repos_url":"https://api.github.com/users/4teamwork/repos","events_url":"https://api.github.com/users/4teamwork/events{/privacy}","received_events_url":"https://api.github.com/users/4teamwork/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/4teamwork/opengever.core","description":"OneGov GEVER core package","fork":false,"url":"https://api.github.com/repos/4teamwork/opengever.core","forks_url":"https://api.github.com/repos/4teamwork/opengever.core/forks","keys_url":"https://api.github.com/repos/4teamwork/opengever.core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/4teamwork/opengever.core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/4teamwork/opengever.core/teams","hooks_url":"https://api.github.com/repos/4teamwork/opengever.core/hooks","issue_events_url":"https://api.github.com/repos/4teamwork/opengever.core/issues/events{/number}","events_url":"https://api.github.com/repos/4teamwork/opengever.core/events","assignees_url":"https://api.github.com/repos/4teamwork/opengever.core/assignees{/user}","branches_url":"https://api.github.com/repos/4teamwork/opengever.core/branches{/branch}","tags_url":"https://api.github.com/repos/4teamwork/opengever.core/tags","blobs_url":"https://api.github.com/repos/4teamwork/opengever.core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/4teamwork/opengever.core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/4teamwork/opengever.core/git/refs{/sha}","trees_url":"https://api.github.com/repos/4teamwork/opengever.core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/4teamwork/opengever.core/statuses/{sha}","languages_url":"https://api.github.com/repos/4teamwork/opengever.core/languages","stargazers_url":"https://api.github.com/repos/4teamwork/opengever.core/stargazers","contributors_url":"https://api.github.com/repos/4teamwork/opengever.core/contributors","subscribers_url":"https://api.github.com/repos/4teamwork/opengever.core/subscribers","subscription_url":"https://api.github.com/repos/4teamwork/opengever.core/subscription","commits_url":"https://api.github.com/repos/4teamwork/opengever.core/commits{/sha}","git_commits_url":"https://api.github.com/repos/4teamwork/opengever.core/git/commits{/sha}","comments_url":"https://api.github.com/repos/4teamwork/opengever.core/comments{/number}","issue_comment_url":"https://api.github.com/repos/4teamwork/opengever.core/issues/comments{/number}","contents_url":"https://api.github.com/repos/4teamwork/opengever.core/contents/{+path}","compare_url":"https://api.github.com/repos/4teamwork/opengever.core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/4teamwork/opengever.core/merges","archive_url":"https://api.github.com/repos/4teamwork/opengever.core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/4teamwork/opengever.core/downloads","issues_url":"https://api.github.com/repos/4teamwork/opengever.core/issues{/number}","pulls_url":"https://api.github.com/repos/4teamwork/opengever.core/pulls{/number}","milestones_url":"https://api.github.com/repos/4teamwork/opengever.core/milestones{/number}","notifications_url":"https://api.github.com/repos/4teamwork/opengever.core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/4teamwork/opengever.core/labels{/name}","releases_url":"https://api.github.com/repos/4teamwork/opengever.core/releases{/id}","deployments_url":"https://api.github.com/repos/4teamwork/opengever.core/deployments","created_at":"2013-05-01T08:28:16Z","updated_at":"2016-01-11T16:37:49Z","pushed_at":"2016-05-25T09:18:58Z","git_url":"git://github.com/4teamwork/opengever.core.git","ssh_url":"git@github.com:4teamwork/opengever.core.git","clone_url":"https://github.com/4teamwork/opengever.core.git","svn_url":"https://github.com/4teamwork/opengever.core","homepage":"","size":23822,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":171,"forks":1,"open_issues":171,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/4teamwork/opengever.core/pulls/1849"},"html":{"href":"https://github.com/4teamwork/opengever.core/pull/1849"},"issue":{"href":"https://api.github.com/repos/4teamwork/opengever.core/issues/1849"},"comments":{"href":"https://api.github.com/repos/4teamwork/opengever.core/issues/1849/comments"},"review_comments":{"href":"https://api.github.com/repos/4teamwork/opengever.core/pulls/1849/comments"},"review_comment":{"href":"https://api.github.com/repos/4teamwork/opengever.core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/4teamwork/opengever.core/pulls/1849/commits"},"statuses":{"href":"https://api.github.com/repos/4teamwork/opengever.core/statuses/8d6646ece9b8de02c43664276f523d6aab41b8cb"}}}}
{"actor":{"display_login":"deiferni"}}