{"action":"created","comment":{"url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/pulls/comments/34365588","id":34365588,"diff_hunk":"@@ -0,0 +1,61 @@\n+# -*- coding: utf-8 -*-\n+\n+from purchasing_test.unit.test_base import BaseTestCase\n+from purchasing_test.unit.util import (\n+    insert_a_role, insert_a_user\n+)\n+\n+class TestCostarsUpload(BaseTestCase):\n+    def setUp(self):\n+        super(TestCostarsUpload, self).setUp()\n+\n+        self.conductor_role_id = insert_a_role('conductor')\n+        self.conductor = insert_a_user(role=self.conductor_role_id)\n+\n+        self.staff_role_id = insert_a_role('staff')\n+        self.staff = insert_a_user(email='foo2@foo.com', role=self.staff_role_id)\n+\n+        self.login_user(self.conductor)\n+\n+    def test_page_locked(self):\n+        '''Test page won't render for people without proper roles\n+        '''\n+        # test that you can't access upload page unless you are signed in with proper role\n+        request = self.client.get('/conductor/upload_new')\n+        self.assertEquals(request.status_code, 302)\n+        self.assert_flashes('You do not have sufficent permissions to do that!', 'alert-danger')\n+\n+        self.login_user(self.conductor)\n+        self.client.get('/conductor/upload_new')\n+\n+        self.login_user(self.admin_user)\n+        self.client.get('/conductor/upload_new')\n+\n+        self.login_user(self.superadmin_user)\n+        self.client.get('/conductor/upload_new')\n+\n+    def test_upload_locked(self):\n+        '''Test upload doesn't work without proper role\n+        '''\n+        request = self.client.post('/conductor/_process_file')\n+        self.assertEquals(request.status_code, 302)\n+        self.assert_flashes('You do not have sufficent permissions to do that!', 'alert-danger')\n+\n+        self.login_user(self.conductor)\n+        self.client.post('/conductor/_process_file')","path":"purchasing_test/unit/conductor/test_costars_upload.py","position":45,"original_position":45,"commit_id":"40107dd24f0045f5cdec683dda6100af2c62ac64","original_commit_id":"40107dd24f0045f5cdec683dda6100af2c62ac64","user":{"login":"bsmithgall","id":1957344,"avatar_url":"https://avatars.githubusercontent.com/u/1957344?v=3","gravatar_id":"","url":"https://api.github.com/users/bsmithgall","html_url":"https://github.com/bsmithgall","followers_url":"https://api.github.com/users/bsmithgall/followers","following_url":"https://api.github.com/users/bsmithgall/following{/other_user}","gists_url":"https://api.github.com/users/bsmithgall/gists{/gist_id}","starred_url":"https://api.github.com/users/bsmithgall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bsmithgall/subscriptions","organizations_url":"https://api.github.com/users/bsmithgall/orgs","repos_url":"https://api.github.com/users/bsmithgall/repos","events_url":"https://api.github.com/users/bsmithgall/events{/privacy}","received_events_url":"https://api.github.com/users/bsmithgall/received_events","type":"User","site_admin":false},"body":"This will probably fail because you aren't attaching a file.","created_at":"2015-07-10T15:28:29Z","updated_at":"2015-07-10T15:28:29Z","html_url":"https://github.com/codeforamerica/pittsburgh-purchasing-suite/pull/76#discussion_r34365588","pull_request_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/pulls/76","_links":{"self":{"href":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/pulls/comments/34365588"},"html":{"href":"https://github.com/codeforamerica/pittsburgh-purchasing-suite/pull/76#discussion_r34365588"},"pull_request":{"href":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/pulls/76"}}},"pull_request":{"url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/pulls/76","id":39140885,"html_url":"https://github.com/codeforamerica/pittsburgh-purchasing-suite/pull/76","diff_url":"https://github.com/codeforamerica/pittsburgh-purchasing-suite/pull/76.diff","patch_url":"https://github.com/codeforamerica/pittsburgh-purchasing-suite/pull/76.patch","issue_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/issues/76","number":76,"state":"open","locked":false,"title":"add data processing after testing, fixing merge conflicts","user":{"login":"hamhands","id":3640800,"avatar_url":"https://avatars.githubusercontent.com/u/3640800?v=3","gravatar_id":"","url":"https://api.github.com/users/hamhands","html_url":"https://github.com/hamhands","followers_url":"https://api.github.com/users/hamhands/followers","following_url":"https://api.github.com/users/hamhands/following{/other_user}","gists_url":"https://api.github.com/users/hamhands/gists{/gist_id}","starred_url":"https://api.github.com/users/hamhands/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hamhands/subscriptions","organizations_url":"https://api.github.com/users/hamhands/orgs","repos_url":"https://api.github.com/users/hamhands/repos","events_url":"https://api.github.com/users/hamhands/events{/privacy}","received_events_url":"https://api.github.com/users/hamhands/received_events","type":"User","site_admin":false},"body":"### What changed\r\n* Added data processing in costars form\r\n* Some cleanup for merge-ability\r\n* Addresses #61& #66\r\n\r\n### What's needed\r\n* [x] Style fixes\r\n* [x] Better status messages\r\n* [x] Require login/roles for uploads\r\n* [ ] Tests\r\n* [ ] Delete file after upload/processing\r\n\r\n### Screencap\r\n![costars](https://cloud.githubusercontent.com/assets/3640800/8491407/eb46c9a6-20ec-11e5-84d5-5aa3d558171f.gif)","created_at":"2015-07-03T02:03:39Z","updated_at":"2015-07-10T15:28:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ea68a7545ade71d2c1e9f88a7435bd494d0fa32b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/pulls/76/commits","review_comments_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/pulls/76/comments","review_comment_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/pulls/comments{/number}","comments_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/issues/76/comments","statuses_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/statuses/40107dd24f0045f5cdec683dda6100af2c62ac64","head":{"label":"codeforamerica:costars-form","ref":"costars-form","sha":"40107dd24f0045f5cdec683dda6100af2c62ac64","user":{"login":"codeforamerica","id":337792,"avatar_url":"https://avatars.githubusercontent.com/u/337792?v=3","gravatar_id":"","url":"https://api.github.com/users/codeforamerica","html_url":"https://github.com/codeforamerica","followers_url":"https://api.github.com/users/codeforamerica/followers","following_url":"https://api.github.com/users/codeforamerica/following{/other_user}","gists_url":"https://api.github.com/users/codeforamerica/gists{/gist_id}","starred_url":"https://api.github.com/users/codeforamerica/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeforamerica/subscriptions","organizations_url":"https://api.github.com/users/codeforamerica/orgs","repos_url":"https://api.github.com/users/codeforamerica/repos","events_url":"https://api.github.com/users/codeforamerica/events{/privacy}","received_events_url":"https://api.github.com/users/codeforamerica/received_events","type":"Organization","site_admin":false},"repo":{"id":34293060,"name":"pittsburgh-purchasing-suite","full_name":"codeforamerica/pittsburgh-purchasing-suite","owner":{"login":"codeforamerica","id":337792,"avatar_url":"https://avatars.githubusercontent.com/u/337792?v=3","gravatar_id":"","url":"https://api.github.com/users/codeforamerica","html_url":"https://github.com/codeforamerica","followers_url":"https://api.github.com/users/codeforamerica/followers","following_url":"https://api.github.com/users/codeforamerica/following{/other_user}","gists_url":"https://api.github.com/users/codeforamerica/gists{/gist_id}","starred_url":"https://api.github.com/users/codeforamerica/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeforamerica/subscriptions","organizations_url":"https://api.github.com/users/codeforamerica/orgs","repos_url":"https://api.github.com/users/codeforamerica/repos","events_url":"https://api.github.com/users/codeforamerica/events{/privacy}","received_events_url":"https://api.github.com/users/codeforamerica/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/codeforamerica/pittsburgh-purchasing-suite","description":"","fork":false,"url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite","forks_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/forks","keys_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/teams","hooks_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/hooks","issue_events_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/issues/events{/number}","events_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/events","assignees_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/assignees{/user}","branches_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/branches{/branch}","tags_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/tags","blobs_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/git/refs{/sha}","trees_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/statuses/{sha}","languages_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/languages","stargazers_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/stargazers","contributors_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/contributors","subscribers_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/subscribers","subscription_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/subscription","commits_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/commits{/sha}","git_commits_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/git/commits{/sha}","comments_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/comments{/number}","issue_comment_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/issues/comments{/number}","contents_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/contents/{+path}","compare_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/merges","archive_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/downloads","issues_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/issues{/number}","pulls_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/pulls{/number}","milestones_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/milestones{/number}","notifications_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/labels{/name}","releases_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/releases{/id}","created_at":"2015-04-20T23:52:09Z","updated_at":"2015-07-09T18:26:33Z","pushed_at":"2015-07-10T00:56:57Z","git_url":"git://github.com/codeforamerica/pittsburgh-purchasing-suite.git","ssh_url":"git@github.com:codeforamerica/pittsburgh-purchasing-suite.git","clone_url":"https://github.com/codeforamerica/pittsburgh-purchasing-suite.git","svn_url":"https://github.com/codeforamerica/pittsburgh-purchasing-suite","homepage":null,"size":2000,"stargazers_count":4,"watchers_count":4,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":29,"forks":1,"open_issues":29,"watchers":4,"default_branch":"master"}},"base":{"label":"codeforamerica:master","ref":"master","sha":"dba4710b7953054c35b16e602ffe266ecdf02f0e","user":{"login":"codeforamerica","id":337792,"avatar_url":"https://avatars.githubusercontent.com/u/337792?v=3","gravatar_id":"","url":"https://api.github.com/users/codeforamerica","html_url":"https://github.com/codeforamerica","followers_url":"https://api.github.com/users/codeforamerica/followers","following_url":"https://api.github.com/users/codeforamerica/following{/other_user}","gists_url":"https://api.github.com/users/codeforamerica/gists{/gist_id}","starred_url":"https://api.github.com/users/codeforamerica/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeforamerica/subscriptions","organizations_url":"https://api.github.com/users/codeforamerica/orgs","repos_url":"https://api.github.com/users/codeforamerica/repos","events_url":"https://api.github.com/users/codeforamerica/events{/privacy}","received_events_url":"https://api.github.com/users/codeforamerica/received_events","type":"Organization","site_admin":false},"repo":{"id":34293060,"name":"pittsburgh-purchasing-suite","full_name":"codeforamerica/pittsburgh-purchasing-suite","owner":{"login":"codeforamerica","id":337792,"avatar_url":"https://avatars.githubusercontent.com/u/337792?v=3","gravatar_id":"","url":"https://api.github.com/users/codeforamerica","html_url":"https://github.com/codeforamerica","followers_url":"https://api.github.com/users/codeforamerica/followers","following_url":"https://api.github.com/users/codeforamerica/following{/other_user}","gists_url":"https://api.github.com/users/codeforamerica/gists{/gist_id}","starred_url":"https://api.github.com/users/codeforamerica/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeforamerica/subscriptions","organizations_url":"https://api.github.com/users/codeforamerica/orgs","repos_url":"https://api.github.com/users/codeforamerica/repos","events_url":"https://api.github.com/users/codeforamerica/events{/privacy}","received_events_url":"https://api.github.com/users/codeforamerica/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/codeforamerica/pittsburgh-purchasing-suite","description":"","fork":false,"url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite","forks_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/forks","keys_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/teams","hooks_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/hooks","issue_events_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/issues/events{/number}","events_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/events","assignees_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/assignees{/user}","branches_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/branches{/branch}","tags_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/tags","blobs_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/git/refs{/sha}","trees_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/statuses/{sha}","languages_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/languages","stargazers_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/stargazers","contributors_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/contributors","subscribers_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/subscribers","subscription_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/subscription","commits_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/commits{/sha}","git_commits_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/git/commits{/sha}","comments_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/comments{/number}","issue_comment_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/issues/comments{/number}","contents_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/contents/{+path}","compare_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/merges","archive_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/downloads","issues_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/issues{/number}","pulls_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/pulls{/number}","milestones_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/milestones{/number}","notifications_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/labels{/name}","releases_url":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/releases{/id}","created_at":"2015-04-20T23:52:09Z","updated_at":"2015-07-09T18:26:33Z","pushed_at":"2015-07-10T00:56:57Z","git_url":"git://github.com/codeforamerica/pittsburgh-purchasing-suite.git","ssh_url":"git@github.com:codeforamerica/pittsburgh-purchasing-suite.git","clone_url":"https://github.com/codeforamerica/pittsburgh-purchasing-suite.git","svn_url":"https://github.com/codeforamerica/pittsburgh-purchasing-suite","homepage":null,"size":2000,"stargazers_count":4,"watchers_count":4,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":29,"forks":1,"open_issues":29,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/pulls/76"},"html":{"href":"https://github.com/codeforamerica/pittsburgh-purchasing-suite/pull/76"},"issue":{"href":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/issues/76"},"comments":{"href":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/issues/76/comments"},"review_comments":{"href":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/pulls/76/comments"},"review_comment":{"href":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/pulls/76/commits"},"statuses":{"href":"https://api.github.com/repos/codeforamerica/pittsburgh-purchasing-suite/statuses/40107dd24f0045f5cdec683dda6100af2c62ac64"}}}}