{"action":"created","comment":{"url":"https://api.github.com/repos/calblueprint/revolv/pulls/comments/28120189","id":28120189,"diff_hunk":"@@ -0,0 +1,193 @@\n+import mock\n+import json\n+from django.test import TestCase\n+from django_webtest import WebTest\n+from revolv.lib.testing import TestUserMixin, UserTestingMixin\n+from revolv.project.models import Project, ProjectUpdate\n+\n+\n+class PostProjectUpdatesTest(TestUserMixin, UserTestingMixin, TestCase):\n+\n+    def assert_user_can_create_project_update(self):\n+        \"\"\"\n+        Tests that administrators and ambassadors can create project updates. This assert function logs in, creates a project,\n+        posts an update to the project, and then verifies that the posted update exists.\n+        \"\"\"\n+        response = self.send_test_user_login_request()\n+        self.assertUserAuthed(response)\n+        project = Project.factories.base.create()\n+        response = self.client.post('/project/%d/update' % project.pk, {'update_text': 'This is an update'})\n+        new_updates = ProjectUpdate.objects.filter(update_text = 'This is an update')\n+        self.assertEqual(len(new_updates),1)\n+        self.assertEqual(new_updates[0].project, project)\n+\n+    def test_admin_form_submission(self):\n+        \"\"\"\n+        Tests that administrators can create project updates.\n+        This function makes an administrator and then calls the assert_user_can_create_project_update function.\n+        \"\"\"\n+        self.test_profile.make_administrator()\n+        self.assert_user_can_create_project_update()\n+\n+    def test_ambassador_form_submission(self):\n+        \"\"\"\n+        Tests that ambassadors can create project updates.\n+        This function makes an ambassador and then calls the assert_user_can_create_project_update function.\n+        \"\"\"\n+        self.test_profile.make_ambassador()\n+        self.assert_user_can_create_project_update()\n+\n+    def test_donor_form_submission(self):\n+        \"\"\"\n+        Tests that donors can't create project updates.\n+        This function makes a donor, logs in, creates a project, and then attempts to post an update to the project.\n+        \"\"\"\n+        self.test_profile.make_donor()\n+        response = self.send_test_user_login_request()\n+        self.assertUserAuthed(response)\n+        project = Project.factories.base.create()\n+        response = self.client.post('/project/%d/update' % project.pk, {'update_text': 'This is an update'})\n+        \n+        # the deny_access method is called in the view from the userdatamixin, which returns a redirect to the homepage\n+        self.assertEqual(response.status_code, 302)\n+        \n+class EditProjectUpdatesTest(TestUserMixin, UserTestingMixin, TestCase):\n+\n+    def assert_make_update(self, project, text):","path":"revolv/project/tests/test_integration.py","position":56,"original_position":56,"commit_id":"2a57a4343ae64a5ea4a0b6326347109020978279","original_commit_id":"2a57a4343ae64a5ea4a0b6326347109020978279","user":{"login":"noahsark769","id":1168853,"avatar_url":"https://avatars.githubusercontent.com/u/1168853?v=3","gravatar_id":"","url":"https://api.github.com/users/noahsark769","html_url":"https://github.com/noahsark769","followers_url":"https://api.github.com/users/noahsark769/followers","following_url":"https://api.github.com/users/noahsark769/following{/other_user}","gists_url":"https://api.github.com/users/noahsark769/gists{/gist_id}","starred_url":"https://api.github.com/users/noahsark769/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/noahsark769/subscriptions","organizations_url":"https://api.github.com/users/noahsark769/orgs","repos_url":"https://api.github.com/users/noahsark769/repos","events_url":"https://api.github.com/users/noahsark769/events{/privacy}","received_events_url":"https://api.github.com/users/noahsark769/received_events","type":"User","site_admin":false},"body":"Sorry to be pedantic about this, but the point of this function isn't really to assert anything. Sure, it asserts that the user is authed at one point, but the point is to make a new update, so I think it's fine to call it `make_update`. I think that methods whose point is to check that something is the same as expected (or even check that more than one thing is the same as expected) should start with `assert_` but methods like this don't need to.","created_at":"2015-04-10T03:03:54Z","updated_at":"2015-04-10T03:03:54Z","html_url":"https://github.com/calblueprint/revolv/pull/212#discussion_r28120189","pull_request_url":"https://api.github.com/repos/calblueprint/revolv/pulls/212","_links":{"self":{"href":"https://api.github.com/repos/calblueprint/revolv/pulls/comments/28120189"},"html":{"href":"https://github.com/calblueprint/revolv/pull/212#discussion_r28120189"},"pull_request":{"href":"https://api.github.com/repos/calblueprint/revolv/pulls/212"}}},"pull_request":{"url":"https://api.github.com/repos/calblueprint/revolv/pulls/212","id":32289393,"html_url":"https://github.com/calblueprint/revolv/pull/212","diff_url":"https://github.com/calblueprint/revolv/pull/212.diff","patch_url":"https://github.com/calblueprint/revolv/pull/212.patch","issue_url":"https://api.github.com/repos/calblueprint/revolv/issues/212","number":212,"state":"open","locked":false,"title":"Sameera project page styles","user":{"login":"sameerav","id":7706852,"avatar_url":"https://avatars.githubusercontent.com/u/7706852?v=3","gravatar_id":"","url":"https://api.github.com/users/sameerav","html_url":"https://github.com/sameerav","followers_url":"https://api.github.com/users/sameerav/followers","following_url":"https://api.github.com/users/sameerav/following{/other_user}","gists_url":"https://api.github.com/users/sameerav/gists{/gist_id}","starred_url":"https://api.github.com/users/sameerav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sameerav/subscriptions","organizations_url":"https://api.github.com/users/sameerav/orgs","repos_url":"https://api.github.com/users/sameerav/repos","events_url":"https://api.github.com/users/sameerav/events{/privacy}","received_events_url":"https://api.github.com/users/sameerav/received_events","type":"User","site_admin":false},"body":"List of things that still don't work:\r\n\r\n1. The iframe still isn't clickable\r\n2. The top donate button only somehow has half the button being clickable (weird anchor tag positioning). (FIGURED THIS OUT! this is because the modal is covering it, so as soon as the modal thing is fixed this should be good).\r\n3. The donate modal doesn't have a top attribute of 0 when the page is scrolled down, so when we click the donate button at the bottom of the page, it doesn't work.\r\n4. There's a tiny little margin at the top of the project page image.","created_at":"2015-03-31T03:58:03Z","updated_at":"2015-04-10T03:03:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0c835ce5933ecafdcd6765846593789d7286d2fa","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/calblueprint/revolv/pulls/212/commits","review_comments_url":"https://api.github.com/repos/calblueprint/revolv/pulls/212/comments","review_comment_url":"https://api.github.com/repos/calblueprint/revolv/pulls/comments{/number}","comments_url":"https://api.github.com/repos/calblueprint/revolv/issues/212/comments","statuses_url":"https://api.github.com/repos/calblueprint/revolv/statuses/2a57a4343ae64a5ea4a0b6326347109020978279","head":{"label":"calblueprint:sameera-project-page-styles","ref":"sameera-project-page-styles","sha":"2a57a4343ae64a5ea4a0b6326347109020978279","user":{"login":"calblueprint","id":2729578,"avatar_url":"https://avatars.githubusercontent.com/u/2729578?v=3","gravatar_id":"","url":"https://api.github.com/users/calblueprint","html_url":"https://github.com/calblueprint","followers_url":"https://api.github.com/users/calblueprint/followers","following_url":"https://api.github.com/users/calblueprint/following{/other_user}","gists_url":"https://api.github.com/users/calblueprint/gists{/gist_id}","starred_url":"https://api.github.com/users/calblueprint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calblueprint/subscriptions","organizations_url":"https://api.github.com/users/calblueprint/orgs","repos_url":"https://api.github.com/users/calblueprint/repos","events_url":"https://api.github.com/users/calblueprint/events{/privacy}","received_events_url":"https://api.github.com/users/calblueprint/received_events","type":"Organization","site_admin":false},"repo":{"id":24279940,"name":"revolv","full_name":"calblueprint/revolv","owner":{"login":"calblueprint","id":2729578,"avatar_url":"https://avatars.githubusercontent.com/u/2729578?v=3","gravatar_id":"","url":"https://api.github.com/users/calblueprint","html_url":"https://github.com/calblueprint","followers_url":"https://api.github.com/users/calblueprint/followers","following_url":"https://api.github.com/users/calblueprint/following{/other_user}","gists_url":"https://api.github.com/users/calblueprint/gists{/gist_id}","starred_url":"https://api.github.com/users/calblueprint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calblueprint/subscriptions","organizations_url":"https://api.github.com/users/calblueprint/orgs","repos_url":"https://api.github.com/users/calblueprint/repos","events_url":"https://api.github.com/users/calblueprint/events{/privacy}","received_events_url":"https://api.github.com/users/calblueprint/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/calblueprint/revolv","description":"Crowdfunding application for the npo RE-volv. Travis: https://travis-ci.org/calblueprint/revolv","fork":false,"url":"https://api.github.com/repos/calblueprint/revolv","forks_url":"https://api.github.com/repos/calblueprint/revolv/forks","keys_url":"https://api.github.com/repos/calblueprint/revolv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/calblueprint/revolv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/calblueprint/revolv/teams","hooks_url":"https://api.github.com/repos/calblueprint/revolv/hooks","issue_events_url":"https://api.github.com/repos/calblueprint/revolv/issues/events{/number}","events_url":"https://api.github.com/repos/calblueprint/revolv/events","assignees_url":"https://api.github.com/repos/calblueprint/revolv/assignees{/user}","branches_url":"https://api.github.com/repos/calblueprint/revolv/branches{/branch}","tags_url":"https://api.github.com/repos/calblueprint/revolv/tags","blobs_url":"https://api.github.com/repos/calblueprint/revolv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/calblueprint/revolv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/calblueprint/revolv/git/refs{/sha}","trees_url":"https://api.github.com/repos/calblueprint/revolv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/calblueprint/revolv/statuses/{sha}","languages_url":"https://api.github.com/repos/calblueprint/revolv/languages","stargazers_url":"https://api.github.com/repos/calblueprint/revolv/stargazers","contributors_url":"https://api.github.com/repos/calblueprint/revolv/contributors","subscribers_url":"https://api.github.com/repos/calblueprint/revolv/subscribers","subscription_url":"https://api.github.com/repos/calblueprint/revolv/subscription","commits_url":"https://api.github.com/repos/calblueprint/revolv/commits{/sha}","git_commits_url":"https://api.github.com/repos/calblueprint/revolv/git/commits{/sha}","comments_url":"https://api.github.com/repos/calblueprint/revolv/comments{/number}","issue_comment_url":"https://api.github.com/repos/calblueprint/revolv/issues/comments{/number}","contents_url":"https://api.github.com/repos/calblueprint/revolv/contents/{+path}","compare_url":"https://api.github.com/repos/calblueprint/revolv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/calblueprint/revolv/merges","archive_url":"https://api.github.com/repos/calblueprint/revolv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/calblueprint/revolv/downloads","issues_url":"https://api.github.com/repos/calblueprint/revolv/issues{/number}","pulls_url":"https://api.github.com/repos/calblueprint/revolv/pulls{/number}","milestones_url":"https://api.github.com/repos/calblueprint/revolv/milestones{/number}","notifications_url":"https://api.github.com/repos/calblueprint/revolv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/calblueprint/revolv/labels{/name}","releases_url":"https://api.github.com/repos/calblueprint/revolv/releases{/id}","created_at":"2014-09-21T02:30:04Z","updated_at":"2015-04-07T03:14:51Z","pushed_at":"2015-04-09T05:24:53Z","git_url":"git://github.com/calblueprint/revolv.git","ssh_url":"git@github.com:calblueprint/revolv.git","clone_url":"https://github.com/calblueprint/revolv.git","svn_url":"https://github.com/calblueprint/revolv","homepage":"","size":7696,"stargazers_count":9,"watchers_count":9,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":49,"forks":0,"open_issues":49,"watchers":9,"default_branch":"master"}},"base":{"label":"calblueprint:master","ref":"master","sha":"ce816a288f33a98e88305d9f10ca6a75964653bf","user":{"login":"calblueprint","id":2729578,"avatar_url":"https://avatars.githubusercontent.com/u/2729578?v=3","gravatar_id":"","url":"https://api.github.com/users/calblueprint","html_url":"https://github.com/calblueprint","followers_url":"https://api.github.com/users/calblueprint/followers","following_url":"https://api.github.com/users/calblueprint/following{/other_user}","gists_url":"https://api.github.com/users/calblueprint/gists{/gist_id}","starred_url":"https://api.github.com/users/calblueprint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calblueprint/subscriptions","organizations_url":"https://api.github.com/users/calblueprint/orgs","repos_url":"https://api.github.com/users/calblueprint/repos","events_url":"https://api.github.com/users/calblueprint/events{/privacy}","received_events_url":"https://api.github.com/users/calblueprint/received_events","type":"Organization","site_admin":false},"repo":{"id":24279940,"name":"revolv","full_name":"calblueprint/revolv","owner":{"login":"calblueprint","id":2729578,"avatar_url":"https://avatars.githubusercontent.com/u/2729578?v=3","gravatar_id":"","url":"https://api.github.com/users/calblueprint","html_url":"https://github.com/calblueprint","followers_url":"https://api.github.com/users/calblueprint/followers","following_url":"https://api.github.com/users/calblueprint/following{/other_user}","gists_url":"https://api.github.com/users/calblueprint/gists{/gist_id}","starred_url":"https://api.github.com/users/calblueprint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calblueprint/subscriptions","organizations_url":"https://api.github.com/users/calblueprint/orgs","repos_url":"https://api.github.com/users/calblueprint/repos","events_url":"https://api.github.com/users/calblueprint/events{/privacy}","received_events_url":"https://api.github.com/users/calblueprint/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/calblueprint/revolv","description":"Crowdfunding application for the npo RE-volv. Travis: https://travis-ci.org/calblueprint/revolv","fork":false,"url":"https://api.github.com/repos/calblueprint/revolv","forks_url":"https://api.github.com/repos/calblueprint/revolv/forks","keys_url":"https://api.github.com/repos/calblueprint/revolv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/calblueprint/revolv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/calblueprint/revolv/teams","hooks_url":"https://api.github.com/repos/calblueprint/revolv/hooks","issue_events_url":"https://api.github.com/repos/calblueprint/revolv/issues/events{/number}","events_url":"https://api.github.com/repos/calblueprint/revolv/events","assignees_url":"https://api.github.com/repos/calblueprint/revolv/assignees{/user}","branches_url":"https://api.github.com/repos/calblueprint/revolv/branches{/branch}","tags_url":"https://api.github.com/repos/calblueprint/revolv/tags","blobs_url":"https://api.github.com/repos/calblueprint/revolv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/calblueprint/revolv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/calblueprint/revolv/git/refs{/sha}","trees_url":"https://api.github.com/repos/calblueprint/revolv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/calblueprint/revolv/statuses/{sha}","languages_url":"https://api.github.com/repos/calblueprint/revolv/languages","stargazers_url":"https://api.github.com/repos/calblueprint/revolv/stargazers","contributors_url":"https://api.github.com/repos/calblueprint/revolv/contributors","subscribers_url":"https://api.github.com/repos/calblueprint/revolv/subscribers","subscription_url":"https://api.github.com/repos/calblueprint/revolv/subscription","commits_url":"https://api.github.com/repos/calblueprint/revolv/commits{/sha}","git_commits_url":"https://api.github.com/repos/calblueprint/revolv/git/commits{/sha}","comments_url":"https://api.github.com/repos/calblueprint/revolv/comments{/number}","issue_comment_url":"https://api.github.com/repos/calblueprint/revolv/issues/comments{/number}","contents_url":"https://api.github.com/repos/calblueprint/revolv/contents/{+path}","compare_url":"https://api.github.com/repos/calblueprint/revolv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/calblueprint/revolv/merges","archive_url":"https://api.github.com/repos/calblueprint/revolv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/calblueprint/revolv/downloads","issues_url":"https://api.github.com/repos/calblueprint/revolv/issues{/number}","pulls_url":"https://api.github.com/repos/calblueprint/revolv/pulls{/number}","milestones_url":"https://api.github.com/repos/calblueprint/revolv/milestones{/number}","notifications_url":"https://api.github.com/repos/calblueprint/revolv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/calblueprint/revolv/labels{/name}","releases_url":"https://api.github.com/repos/calblueprint/revolv/releases{/id}","created_at":"2014-09-21T02:30:04Z","updated_at":"2015-04-07T03:14:51Z","pushed_at":"2015-04-09T05:24:53Z","git_url":"git://github.com/calblueprint/revolv.git","ssh_url":"git@github.com:calblueprint/revolv.git","clone_url":"https://github.com/calblueprint/revolv.git","svn_url":"https://github.com/calblueprint/revolv","homepage":"","size":7696,"stargazers_count":9,"watchers_count":9,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":49,"forks":0,"open_issues":49,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/calblueprint/revolv/pulls/212"},"html":{"href":"https://github.com/calblueprint/revolv/pull/212"},"issue":{"href":"https://api.github.com/repos/calblueprint/revolv/issues/212"},"comments":{"href":"https://api.github.com/repos/calblueprint/revolv/issues/212/comments"},"review_comments":{"href":"https://api.github.com/repos/calblueprint/revolv/pulls/212/comments"},"review_comment":{"href":"https://api.github.com/repos/calblueprint/revolv/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/calblueprint/revolv/pulls/212/commits"},"statuses":{"href":"https://api.github.com/repos/calblueprint/revolv/statuses/2a57a4343ae64a5ea4a0b6326347109020978279"}}}}