{"action":"created","comment":{"url":"https://api.github.com/repos/fecgov/openFEC/pulls/comments/195435016","pull_request_review_id":128803435,"id":195435016,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NTQzNTAxNg==","diff_hunk":"@@ -0,0 +1,31 @@\n+\n+from tests import factories\n+from tests.common import ApiBaseTest\n+from webservices.rest import api\n+from webservices.resources.operations_log import OperationsLogView\n+\n+class TestOperationsLog(ApiBaseTest):\n+\n+    def setUp(self):\n+        super().setUp()\n+        factories.OperationsLogFactory(candidate_committee_id='00', report_year=2000, status_num=1),\n+        factories.OperationsLogFactory(candidate_committee_id='01', report_year=2012, status_num=0),\n+        factories.OperationsLogFactory(candidate_committee_id='02', report_year=2014, status_num=1),\n+        factories.OperationsLogFactory(candidate_committee_id='03', report_year=2016, status_num=0),\n+        factories.OperationsLogFactory(candidate_committee_id='04', report_year=2018, status_num=1),\n+        factories.OperationsLogFactory(candidate_committee_id='05', report_year=2020, status_num=1),\n+\n+    def test_empty_query(self):\n+\n+        results = self._results(api.url_for(OperationsLogView, candidate_committee_id='10', report_year=2030))\n+        self.assertEqual(len(results), 0)\n+\n+    def test_search_cand_cmte_id(self):\n+\n+        response = self.app.get(api.url_for(OperationsLogView, candidate_committee_id='01', report_year=2012))\n+        self.assertEquals(response.status_code, 200)\n+\n+    def test_search_cand_cmte_id_with_status_verified(self):\n+\n+        results = self._results(api.url_for(OperationsLogView, status_num=1))","path":"tests/test_operation_logs.py","position":30,"original_position":30,"commit_id":"b98138d3c30c10d4d3e704bd408926dc70313384","original_commit_id":"b98138d3c30c10d4d3e704bd408926dc70313384","user":{"login":"lbeaufort","id":31420082,"node_id":"MDQ6VXNlcjMxNDIwMDgy","avatar_url":"https://avatars1.githubusercontent.com/u/31420082?v=4","gravatar_id":"","url":"https://api.github.com/users/lbeaufort","html_url":"https://github.com/lbeaufort","followers_url":"https://api.github.com/users/lbeaufort/followers","following_url":"https://api.github.com/users/lbeaufort/following{/other_user}","gists_url":"https://api.github.com/users/lbeaufort/gists{/gist_id}","starred_url":"https://api.github.com/users/lbeaufort/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lbeaufort/subscriptions","organizations_url":"https://api.github.com/users/lbeaufort/orgs","repos_url":"https://api.github.com/users/lbeaufort/repos","events_url":"https://api.github.com/users/lbeaufort/events{/privacy}","received_events_url":"https://api.github.com/users/lbeaufort/received_events","type":"User","site_admin":false},"body":"@pkfec thanks for adding another test! Because we're testing that `status_num=1` maybe we could `assert` that all the results are `status_num=1`  rather than there being 4 results, in case we add more test data in the future. Something like this, but I'd test it out to be sure :)\r\n```\r\nfor result in results:\r\n    self.assert(result.get('status_num') == 1 )\r\n```","created_at":"2018-06-14T14:01:47Z","updated_at":"2018-06-14T14:01:48Z","html_url":"https://github.com/fecgov/openFEC/pull/3203#discussion_r195435016","pull_request_url":"https://api.github.com/repos/fecgov/openFEC/pulls/3203","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/fecgov/openFEC/pulls/comments/195435016"},"html":{"href":"https://github.com/fecgov/openFEC/pull/3203#discussion_r195435016"},"pull_request":{"href":"https://api.github.com/repos/fecgov/openFEC/pulls/3203"}}},"pull_request":{"url":"https://api.github.com/repos/fecgov/openFEC/pulls/3203","id":194023627,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk0MDIzNjI3","html_url":"https://github.com/fecgov/openFEC/pull/3203","diff_url":"https://github.com/fecgov/openFEC/pull/3203.diff","patch_url":"https://github.com/fecgov/openFEC/pull/3203.patch","issue_url":"https://api.github.com/repos/fecgov/openFEC/issues/3203","number":3203,"state":"open","locked":false,"title":"[WIP]create operations log endpoint","user":{"login":"pkfec","id":11650355,"node_id":"MDQ6VXNlcjExNjUwMzU1","avatar_url":"https://avatars1.githubusercontent.com/u/11650355?v=4","gravatar_id":"","url":"https://api.github.com/users/pkfec","html_url":"https://github.com/pkfec","followers_url":"https://api.github.com/users/pkfec/followers","following_url":"https://api.github.com/users/pkfec/following{/other_user}","gists_url":"https://api.github.com/users/pkfec/gists{/gist_id}","starred_url":"https://api.github.com/users/pkfec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pkfec/subscriptions","organizations_url":"https://api.github.com/users/pkfec/orgs","repos_url":"https://api.github.com/users/pkfec/repos","events_url":"https://api.github.com/users/pkfec/events{/privacy}","received_events_url":"https://api.github.com/users/pkfec/received_events","type":"User","site_admin":false},"body":"## Summary (required)\r\n\r\nCreate new endpoint for operations log and write python tests for this endpoint.\r\n\r\n- Resolves # https://github.com/fecgov/fec-cms/issues/2008\r\n\r\n_Include a summary of proposed changes._\r\n\r\nWrite up new model, resource and args to support this new endpoint.\r\n\r\n## How to test the changes locally\r\n\r\n- checkout the branch  **feature/create-operations-log-endpoint**\r\n- export SQLA_CONN to point to **dev** database\r\n- run the server (./manage.py runserver)\r\n- In a browser, open the API documentation\r\n- go to **operations-log ** endpoint which is under **/filings/** section \r\n\r\n\r\n- enter a **candidate_committe_id** (a required field) and search for results.\r\n\r\n## Impacted areas of the application\r\nList general components of the application that this PR will affect:\r\n\r\n-  A new API endpoint is created.\r\n","created_at":"2018-06-11T15:44:38Z","updated_at":"2018-06-14T14:01:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"12f65fef4b221b3460fc7c75b52677b32412ebce","assignee":null,"assignees":[],"requested_reviewers":[{"login":"rjayasekera","id":20324717,"node_id":"MDQ6VXNlcjIwMzI0NzE3","avatar_url":"https://avatars3.githubusercontent.com/u/20324717?v=4","gravatar_id":"","url":"https://api.github.com/users/rjayasekera","html_url":"https://github.com/rjayasekera","followers_url":"https://api.github.com/users/rjayasekera/followers","following_url":"https://api.github.com/users/rjayasekera/following{/other_user}","gists_url":"https://api.github.com/users/rjayasekera/gists{/gist_id}","starred_url":"https://api.github.com/users/rjayasekera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rjayasekera/subscriptions","organizations_url":"https://api.github.com/users/rjayasekera/orgs","repos_url":"https://api.github.com/users/rjayasekera/repos","events_url":"https://api.github.com/users/rjayasekera/events{/privacy}","received_events_url":"https://api.github.com/users/rjayasekera/received_events","type":"User","site_admin":false},{"login":"hcaofec","id":24396726,"node_id":"MDQ6VXNlcjI0Mzk2NzI2","avatar_url":"https://avatars3.githubusercontent.com/u/24396726?v=4","gravatar_id":"","url":"https://api.github.com/users/hcaofec","html_url":"https://github.com/hcaofec","followers_url":"https://api.github.com/users/hcaofec/followers","following_url":"https://api.github.com/users/hcaofec/following{/other_user}","gists_url":"https://api.github.com/users/hcaofec/gists{/gist_id}","starred_url":"https://api.github.com/users/hcaofec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hcaofec/subscriptions","organizations_url":"https://api.github.com/users/hcaofec/orgs","repos_url":"https://api.github.com/users/hcaofec/repos","events_url":"https://api.github.com/users/hcaofec/events{/privacy}","received_events_url":"https://api.github.com/users/hcaofec/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":205686417,"node_id":"MDU6TGFiZWwyMDU2ODY0MTc=","url":"https://api.github.com/repos/fecgov/openFEC/labels/plz-review","name":"plz-review","color":"5319e7","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/fecgov/openFEC/pulls/3203/commits","review_comments_url":"https://api.github.com/repos/fecgov/openFEC/pulls/3203/comments","review_comment_url":"https://api.github.com/repos/fecgov/openFEC/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fecgov/openFEC/issues/3203/comments","statuses_url":"https://api.github.com/repos/fecgov/openFEC/statuses/b98138d3c30c10d4d3e704bd408926dc70313384","head":{"label":"fecgov:feature/create-operations-log-endpoint","ref":"feature/create-operations-log-endpoint","sha":"b98138d3c30c10d4d3e704bd408926dc70313384","user":{"login":"fecgov","id":24719213,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI0NzE5MjEz","avatar_url":"https://avatars0.githubusercontent.com/u/24719213?v=4","gravatar_id":"","url":"https://api.github.com/users/fecgov","html_url":"https://github.com/fecgov","followers_url":"https://api.github.com/users/fecgov/followers","following_url":"https://api.github.com/users/fecgov/following{/other_user}","gists_url":"https://api.github.com/users/fecgov/gists{/gist_id}","starred_url":"https://api.github.com/users/fecgov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fecgov/subscriptions","organizations_url":"https://api.github.com/users/fecgov/orgs","repos_url":"https://api.github.com/users/fecgov/repos","events_url":"https://api.github.com/users/fecgov/events{/privacy}","received_events_url":"https://api.github.com/users/fecgov/received_events","type":"Organization","site_admin":false},"repo":{"id":23116127,"node_id":"MDEwOlJlcG9zaXRvcnkyMzExNjEyNw==","name":"openFEC","full_name":"fecgov/openFEC","owner":{"login":"fecgov","id":24719213,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI0NzE5MjEz","avatar_url":"https://avatars0.githubusercontent.com/u/24719213?v=4","gravatar_id":"","url":"https://api.github.com/users/fecgov","html_url":"https://github.com/fecgov","followers_url":"https://api.github.com/users/fecgov/followers","following_url":"https://api.github.com/users/fecgov/following{/other_user}","gists_url":"https://api.github.com/users/fecgov/gists{/gist_id}","starred_url":"https://api.github.com/users/fecgov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fecgov/subscriptions","organizations_url":"https://api.github.com/users/fecgov/orgs","repos_url":"https://api.github.com/users/fecgov/repos","events_url":"https://api.github.com/users/fecgov/events{/privacy}","received_events_url":"https://api.github.com/users/fecgov/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fecgov/openFEC","description":"The first RESTful API for the Federal Election Commission. We're aiming to make campaign finance more accessible for journalists, academics, developers, and other transparency seekers.","fork":false,"url":"https://api.github.com/repos/fecgov/openFEC","forks_url":"https://api.github.com/repos/fecgov/openFEC/forks","keys_url":"https://api.github.com/repos/fecgov/openFEC/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fecgov/openFEC/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fecgov/openFEC/teams","hooks_url":"https://api.github.com/repos/fecgov/openFEC/hooks","issue_events_url":"https://api.github.com/repos/fecgov/openFEC/issues/events{/number}","events_url":"https://api.github.com/repos/fecgov/openFEC/events","assignees_url":"https://api.github.com/repos/fecgov/openFEC/assignees{/user}","branches_url":"https://api.github.com/repos/fecgov/openFEC/branches{/branch}","tags_url":"https://api.github.com/repos/fecgov/openFEC/tags","blobs_url":"https://api.github.com/repos/fecgov/openFEC/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fecgov/openFEC/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fecgov/openFEC/git/refs{/sha}","trees_url":"https://api.github.com/repos/fecgov/openFEC/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fecgov/openFEC/statuses/{sha}","languages_url":"https://api.github.com/repos/fecgov/openFEC/languages","stargazers_url":"https://api.github.com/repos/fecgov/openFEC/stargazers","contributors_url":"https://api.github.com/repos/fecgov/openFEC/contributors","subscribers_url":"https://api.github.com/repos/fecgov/openFEC/subscribers","subscription_url":"https://api.github.com/repos/fecgov/openFEC/subscription","commits_url":"https://api.github.com/repos/fecgov/openFEC/commits{/sha}","git_commits_url":"https://api.github.com/repos/fecgov/openFEC/git/commits{/sha}","comments_url":"https://api.github.com/repos/fecgov/openFEC/comments{/number}","issue_comment_url":"https://api.github.com/repos/fecgov/openFEC/issues/comments{/number}","contents_url":"https://api.github.com/repos/fecgov/openFEC/contents/{+path}","compare_url":"https://api.github.com/repos/fecgov/openFEC/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fecgov/openFEC/merges","archive_url":"https://api.github.com/repos/fecgov/openFEC/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fecgov/openFEC/downloads","issues_url":"https://api.github.com/repos/fecgov/openFEC/issues{/number}","pulls_url":"https://api.github.com/repos/fecgov/openFEC/pulls{/number}","milestones_url":"https://api.github.com/repos/fecgov/openFEC/milestones{/number}","notifications_url":"https://api.github.com/repos/fecgov/openFEC/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fecgov/openFEC/labels{/name}","releases_url":"https://api.github.com/repos/fecgov/openFEC/releases{/id}","deployments_url":"https://api.github.com/repos/fecgov/openFEC/deployments","created_at":"2014-08-19T15:51:14Z","updated_at":"2018-06-13T00:19:42Z","pushed_at":"2018-06-14T02:52:16Z","git_url":"git://github.com/fecgov/openFEC.git","ssh_url":"git@github.com:fecgov/openFEC.git","clone_url":"https://github.com/fecgov/openFEC.git","svn_url":"https://github.com/fecgov/openFEC","homepage":"https://api.open.fec.gov/developers","size":428631,"stargazers_count":267,"watchers_count":267,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":69,"mirror_url":null,"archived":false,"open_issues_count":72,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":69,"open_issues":72,"watchers":267,"default_branch":"develop"}},"base":{"label":"fecgov:develop","ref":"develop","sha":"a0e154d91df8508fedd481a84a0874c941124ccf","user":{"login":"fecgov","id":24719213,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI0NzE5MjEz","avatar_url":"https://avatars0.githubusercontent.com/u/24719213?v=4","gravatar_id":"","url":"https://api.github.com/users/fecgov","html_url":"https://github.com/fecgov","followers_url":"https://api.github.com/users/fecgov/followers","following_url":"https://api.github.com/users/fecgov/following{/other_user}","gists_url":"https://api.github.com/users/fecgov/gists{/gist_id}","starred_url":"https://api.github.com/users/fecgov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fecgov/subscriptions","organizations_url":"https://api.github.com/users/fecgov/orgs","repos_url":"https://api.github.com/users/fecgov/repos","events_url":"https://api.github.com/users/fecgov/events{/privacy}","received_events_url":"https://api.github.com/users/fecgov/received_events","type":"Organization","site_admin":false},"repo":{"id":23116127,"node_id":"MDEwOlJlcG9zaXRvcnkyMzExNjEyNw==","name":"openFEC","full_name":"fecgov/openFEC","owner":{"login":"fecgov","id":24719213,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI0NzE5MjEz","avatar_url":"https://avatars0.githubusercontent.com/u/24719213?v=4","gravatar_id":"","url":"https://api.github.com/users/fecgov","html_url":"https://github.com/fecgov","followers_url":"https://api.github.com/users/fecgov/followers","following_url":"https://api.github.com/users/fecgov/following{/other_user}","gists_url":"https://api.github.com/users/fecgov/gists{/gist_id}","starred_url":"https://api.github.com/users/fecgov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fecgov/subscriptions","organizations_url":"https://api.github.com/users/fecgov/orgs","repos_url":"https://api.github.com/users/fecgov/repos","events_url":"https://api.github.com/users/fecgov/events{/privacy}","received_events_url":"https://api.github.com/users/fecgov/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fecgov/openFEC","description":"The first RESTful API for the Federal Election Commission. We're aiming to make campaign finance more accessible for journalists, academics, developers, and other transparency seekers.","fork":false,"url":"https://api.github.com/repos/fecgov/openFEC","forks_url":"https://api.github.com/repos/fecgov/openFEC/forks","keys_url":"https://api.github.com/repos/fecgov/openFEC/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fecgov/openFEC/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fecgov/openFEC/teams","hooks_url":"https://api.github.com/repos/fecgov/openFEC/hooks","issue_events_url":"https://api.github.com/repos/fecgov/openFEC/issues/events{/number}","events_url":"https://api.github.com/repos/fecgov/openFEC/events","assignees_url":"https://api.github.com/repos/fecgov/openFEC/assignees{/user}","branches_url":"https://api.github.com/repos/fecgov/openFEC/branches{/branch}","tags_url":"https://api.github.com/repos/fecgov/openFEC/tags","blobs_url":"https://api.github.com/repos/fecgov/openFEC/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fecgov/openFEC/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fecgov/openFEC/git/refs{/sha}","trees_url":"https://api.github.com/repos/fecgov/openFEC/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fecgov/openFEC/statuses/{sha}","languages_url":"https://api.github.com/repos/fecgov/openFEC/languages","stargazers_url":"https://api.github.com/repos/fecgov/openFEC/stargazers","contributors_url":"https://api.github.com/repos/fecgov/openFEC/contributors","subscribers_url":"https://api.github.com/repos/fecgov/openFEC/subscribers","subscription_url":"https://api.github.com/repos/fecgov/openFEC/subscription","commits_url":"https://api.github.com/repos/fecgov/openFEC/commits{/sha}","git_commits_url":"https://api.github.com/repos/fecgov/openFEC/git/commits{/sha}","comments_url":"https://api.github.com/repos/fecgov/openFEC/comments{/number}","issue_comment_url":"https://api.github.com/repos/fecgov/openFEC/issues/comments{/number}","contents_url":"https://api.github.com/repos/fecgov/openFEC/contents/{+path}","compare_url":"https://api.github.com/repos/fecgov/openFEC/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fecgov/openFEC/merges","archive_url":"https://api.github.com/repos/fecgov/openFEC/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fecgov/openFEC/downloads","issues_url":"https://api.github.com/repos/fecgov/openFEC/issues{/number}","pulls_url":"https://api.github.com/repos/fecgov/openFEC/pulls{/number}","milestones_url":"https://api.github.com/repos/fecgov/openFEC/milestones{/number}","notifications_url":"https://api.github.com/repos/fecgov/openFEC/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fecgov/openFEC/labels{/name}","releases_url":"https://api.github.com/repos/fecgov/openFEC/releases{/id}","deployments_url":"https://api.github.com/repos/fecgov/openFEC/deployments","created_at":"2014-08-19T15:51:14Z","updated_at":"2018-06-13T00:19:42Z","pushed_at":"2018-06-14T02:52:16Z","git_url":"git://github.com/fecgov/openFEC.git","ssh_url":"git@github.com:fecgov/openFEC.git","clone_url":"https://github.com/fecgov/openFEC.git","svn_url":"https://github.com/fecgov/openFEC","homepage":"https://api.open.fec.gov/developers","size":428631,"stargazers_count":267,"watchers_count":267,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":69,"mirror_url":null,"archived":false,"open_issues_count":72,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":69,"open_issues":72,"watchers":267,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/fecgov/openFEC/pulls/3203"},"html":{"href":"https://github.com/fecgov/openFEC/pull/3203"},"issue":{"href":"https://api.github.com/repos/fecgov/openFEC/issues/3203"},"comments":{"href":"https://api.github.com/repos/fecgov/openFEC/issues/3203/comments"},"review_comments":{"href":"https://api.github.com/repos/fecgov/openFEC/pulls/3203/comments"},"review_comment":{"href":"https://api.github.com/repos/fecgov/openFEC/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fecgov/openFEC/pulls/3203/commits"},"statuses":{"href":"https://api.github.com/repos/fecgov/openFEC/statuses/b98138d3c30c10d4d3e704bd408926dc70313384"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"lbeaufort"}}