{"action":"created","comment":{"url":"https://api.github.com/repos/osu-cass/whats-fresh-api/pulls/comments/35182425","id":35182425,"diff_hunk":"@@ -0,0 +1,125 @@\n+from django.test import TestCase\n+from django.core.urlresolvers import reverse\n+from whats_fresh.whats_fresh_api.models import Image\n+from django.contrib.auth.models import User, Group\n+import os\n+\n+\n+class InlineImageTestCase(TestCase):\n+\n+    \"\"\"\n+    Test that the Inline Image form works as expected.\n+\n+    Things tested:\n+        URLs reverse correctly\n+        The outputted popup form has the correct form fields\n+        POSTing \"correct\" data will result in the creation of a new\n+            object with the specified details\n+        POSTing data with all fields missing (hitting \"save\" without entering\n+            data) returns the same field with notations of missing fields\n+    \"\"\"\n+\n+    def setUp(self):\n+        user = User.objects.create_user(\n+            'temporary', 'temporary@gmail.com', 'temporary')\n+        user.save()\n+\n+        admin_group = Group(name='Administration Users')\n+        admin_group.save()\n+        user.groups.add(admin_group)\n+\n+        response = self.client.login(\n+            username='temporary', password='temporary')\n+        self.assertEqual(response, True)\n+\n+        self.test_media_directory = os.path.abspath(os.path.join(\n+            os.path.dirname(__file__), '..', '..', 'testdata', 'media'))\n+\n+        self.image = open(\n+            os.path.join(self.test_media_directory, 'cat.jpg'), 'r')\n+\n+    def tearDown(self):\n+        self.image.close()\n+\n+    def test_not_logged_in(self):\n+        self.client.logout()\n+\n+        response = self.client.get(\n+            reverse('image_ajax'))\n+        self.assertRedirects(response, '/login?next=/entry/stories/new/images/new')  # noqa\n+\n+    def test_url_endpoint(self):\n+        url = reverse('image_ajax')\n+        self.assertEqual(url, '/entry/stories/new/images/new')\n+\n+    def test_form_fields(self):\n+        \"\"\"\n+        Tests to see if the form contains all of the right fields\n+        \"\"\"\n+        response = self.client.get(reverse('image_ajax'))\n+\n+        fields = {'image': 'file', 'caption': 'input', 'name': 'input'}\n+        form = response.context['image_form']\n+\n+        for field in fields:\n+            # for the Edit tests, you should be able to access\n+            # form[field].value\n+            self.assertIn(fields[field], str(form[field]))\n+\n+    def test_successful_image_creation_minimal(self):","path":"whats_fresh/whats_fresh_api/tests/views/entry/test_inline_image.py","position":69,"original_position":69,"commit_id":"58712ea6e356d2327ffdca6722b63c66e4684eb2","original_commit_id":"58712ea6e356d2327ffdca6722b63c66e4684eb2","user":{"login":"iCHAIT","id":8472314,"avatar_url":"https://avatars.githubusercontent.com/u/8472314?v=3","gravatar_id":"","url":"https://api.github.com/users/iCHAIT","html_url":"https://github.com/iCHAIT","followers_url":"https://api.github.com/users/iCHAIT/followers","following_url":"https://api.github.com/users/iCHAIT/following{/other_user}","gists_url":"https://api.github.com/users/iCHAIT/gists{/gist_id}","starred_url":"https://api.github.com/users/iCHAIT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iCHAIT/subscriptions","organizations_url":"https://api.github.com/users/iCHAIT/orgs","repos_url":"https://api.github.com/users/iCHAIT/repos","events_url":"https://api.github.com/users/iCHAIT/events{/privacy}","received_events_url":"https://api.github.com/users/iCHAIT/received_events","type":"User","site_admin":false},"body":"So shouldn't they be removed from test_new_image.py and test_new_video.py as well ?","created_at":"2015-07-22T05:25:28Z","updated_at":"2015-07-22T05:25:28Z","html_url":"https://github.com/osu-cass/whats-fresh-api/pull/70#discussion_r35182425","pull_request_url":"https://api.github.com/repos/osu-cass/whats-fresh-api/pulls/70","_links":{"self":{"href":"https://api.github.com/repos/osu-cass/whats-fresh-api/pulls/comments/35182425"},"html":{"href":"https://github.com/osu-cass/whats-fresh-api/pull/70#discussion_r35182425"},"pull_request":{"href":"https://api.github.com/repos/osu-cass/whats-fresh-api/pulls/70"}}},"pull_request":{"url":"https://api.github.com/repos/osu-cass/whats-fresh-api/pulls/70","id":40006088,"html_url":"https://github.com/osu-cass/whats-fresh-api/pull/70","diff_url":"https://github.com/osu-cass/whats-fresh-api/pull/70.diff","patch_url":"https://github.com/osu-cass/whats-fresh-api/pull/70.patch","issue_url":"https://api.github.com/repos/osu-cass/whats-fresh-api/issues/70","number":70,"state":"open","locked":false,"title":"Inline image/video forms for story.html","user":{"login":"iCHAIT","id":8472314,"avatar_url":"https://avatars.githubusercontent.com/u/8472314?v=3","gravatar_id":"","url":"https://api.github.com/users/iCHAIT","html_url":"https://github.com/iCHAIT","followers_url":"https://api.github.com/users/iCHAIT/followers","following_url":"https://api.github.com/users/iCHAIT/following{/other_user}","gists_url":"https://api.github.com/users/iCHAIT/gists{/gist_id}","starred_url":"https://api.github.com/users/iCHAIT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iCHAIT/subscriptions","organizations_url":"https://api.github.com/users/iCHAIT/orgs","repos_url":"https://api.github.com/users/iCHAIT/repos","events_url":"https://api.github.com/users/iCHAIT/events{/privacy}","received_events_url":"https://api.github.com/users/iCHAIT/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-07-15T10:02:31Z","updated_at":"2015-07-22T05:25:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9fd3e93208d536c89a6badb595414cfe0d240cc8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/osu-cass/whats-fresh-api/pulls/70/commits","review_comments_url":"https://api.github.com/repos/osu-cass/whats-fresh-api/pulls/70/comments","review_comment_url":"https://api.github.com/repos/osu-cass/whats-fresh-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/osu-cass/whats-fresh-api/issues/70/comments","statuses_url":"https://api.github.com/repos/osu-cass/whats-fresh-api/statuses/58712ea6e356d2327ffdca6722b63c66e4684eb2","head":{"label":"iCHAIT:sub-forms","ref":"sub-forms","sha":"58712ea6e356d2327ffdca6722b63c66e4684eb2","user":{"login":"iCHAIT","id":8472314,"avatar_url":"https://avatars.githubusercontent.com/u/8472314?v=3","gravatar_id":"","url":"https://api.github.com/users/iCHAIT","html_url":"https://github.com/iCHAIT","followers_url":"https://api.github.com/users/iCHAIT/followers","following_url":"https://api.github.com/users/iCHAIT/following{/other_user}","gists_url":"https://api.github.com/users/iCHAIT/gists{/gist_id}","starred_url":"https://api.github.com/users/iCHAIT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iCHAIT/subscriptions","organizations_url":"https://api.github.com/users/iCHAIT/orgs","repos_url":"https://api.github.com/users/iCHAIT/repos","events_url":"https://api.github.com/users/iCHAIT/events{/privacy}","received_events_url":"https://api.github.com/users/iCHAIT/received_events","type":"User","site_admin":false},"repo":{"id":32594186,"name":"whats-fresh-api","full_name":"iCHAIT/whats-fresh-api","owner":{"login":"iCHAIT","id":8472314,"avatar_url":"https://avatars.githubusercontent.com/u/8472314?v=3","gravatar_id":"","url":"https://api.github.com/users/iCHAIT","html_url":"https://github.com/iCHAIT","followers_url":"https://api.github.com/users/iCHAIT/followers","following_url":"https://api.github.com/users/iCHAIT/following{/other_user}","gists_url":"https://api.github.com/users/iCHAIT/gists{/gist_id}","starred_url":"https://api.github.com/users/iCHAIT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iCHAIT/subscriptions","organizations_url":"https://api.github.com/users/iCHAIT/orgs","repos_url":"https://api.github.com/users/iCHAIT/repos","events_url":"https://api.github.com/users/iCHAIT/events{/privacy}","received_events_url":"https://api.github.com/users/iCHAIT/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/iCHAIT/whats-fresh-api","description":"A Django implementation of the What's Fresh API","fork":true,"url":"https://api.github.com/repos/iCHAIT/whats-fresh-api","forks_url":"https://api.github.com/repos/iCHAIT/whats-fresh-api/forks","keys_url":"https://api.github.com/repos/iCHAIT/whats-fresh-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iCHAIT/whats-fresh-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iCHAIT/whats-fresh-api/teams","hooks_url":"https://api.github.com/repos/iCHAIT/whats-fresh-api/hooks","issue_events_url":"https://api.github.com/repos/iCHAIT/whats-fresh-api/issues/events{/number}","events_url":"https://api.github.com/repos/iCHAIT/whats-fresh-api/events","assignees_url":"https://api.github.com/repos/iCHAIT/whats-fresh-api/assignees{/user}","branches_url":"https://api.github.com/repos/iCHAIT/whats-fresh-api/branches{/branch}","tags_url":"https://api.github.com/repos/iCHAIT/whats-fresh-api/tags","blobs_url":"https://api.github.com/repos/iCHAIT/whats-fresh-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iCHAIT/whats-fresh-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iCHAIT/whats-fresh-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/iCHAIT/whats-fresh-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iCHAIT/whats-fresh-api/statuses/{sha}","languages_url":"https://api.github.com/repos/iCHAIT/whats-fresh-api/languages","stargazers_url":"https://api.github.com/repos/iCHAIT/whats-fresh-api/stargazers","contributors_url":"https://api.github.com/repos/iCHAIT/whats-fresh-api/contributors","subscribers_url":"https://api.github.com/repos/iCHAIT/whats-fresh-api/subscribers","subscription_url":"https://api.github.com/repos/iCHAIT/whats-fresh-api/subscription","commits_url":"https://api.github.com/repos/iCHAIT/whats-fresh-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/iCHAIT/whats-fresh-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/iCHAIT/whats-fresh-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/iCHAIT/whats-fresh-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/iCHAIT/whats-fresh-api/contents/{+path}","compare_url":"https://api.github.com/repos/iCHAIT/whats-fresh-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iCHAIT/whats-fresh-api/merges","archive_url":"https://api.github.com/repos/iCHAIT/whats-fresh-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iCHAIT/whats-fresh-api/downloads","issues_url":"https://api.github.com/repos/iCHAIT/whats-fresh-api/issues{/number}","pulls_url":"https://api.github.com/repos/iCHAIT/whats-fresh-api/pulls{/number}","milestones_url":"https://api.github.com/repos/iCHAIT/whats-fresh-api/milestones{/number}","notifications_url":"https://api.github.com/repos/iCHAIT/whats-fresh-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iCHAIT/whats-fresh-api/labels{/name}","releases_url":"https://api.github.com/repos/iCHAIT/whats-fresh-api/releases{/id}","created_at":"2015-03-20T16:18:07Z","updated_at":"2015-03-20T16:18:07Z","pushed_at":"2015-07-21T19:50:17Z","git_url":"git://github.com/iCHAIT/whats-fresh-api.git","ssh_url":"git@github.com:iCHAIT/whats-fresh-api.git","clone_url":"https://github.com/iCHAIT/whats-fresh-api.git","svn_url":"https://github.com/iCHAIT/whats-fresh-api","homepage":null,"size":1422,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"osu-cass:develop","ref":"develop","sha":"2113cfbbd78a51ce4dd3440803c56c1ff3f1a39c","user":{"login":"osu-cass","id":8293685,"avatar_url":"https://avatars.githubusercontent.com/u/8293685?v=3","gravatar_id":"","url":"https://api.github.com/users/osu-cass","html_url":"https://github.com/osu-cass","followers_url":"https://api.github.com/users/osu-cass/followers","following_url":"https://api.github.com/users/osu-cass/following{/other_user}","gists_url":"https://api.github.com/users/osu-cass/gists{/gist_id}","starred_url":"https://api.github.com/users/osu-cass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/osu-cass/subscriptions","organizations_url":"https://api.github.com/users/osu-cass/orgs","repos_url":"https://api.github.com/users/osu-cass/repos","events_url":"https://api.github.com/users/osu-cass/events{/privacy}","received_events_url":"https://api.github.com/users/osu-cass/received_events","type":"Organization","site_admin":false},"repo":{"id":22480000,"name":"whats-fresh-api","full_name":"osu-cass/whats-fresh-api","owner":{"login":"osu-cass","id":8293685,"avatar_url":"https://avatars.githubusercontent.com/u/8293685?v=3","gravatar_id":"","url":"https://api.github.com/users/osu-cass","html_url":"https://github.com/osu-cass","followers_url":"https://api.github.com/users/osu-cass/followers","following_url":"https://api.github.com/users/osu-cass/following{/other_user}","gists_url":"https://api.github.com/users/osu-cass/gists{/gist_id}","starred_url":"https://api.github.com/users/osu-cass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/osu-cass/subscriptions","organizations_url":"https://api.github.com/users/osu-cass/orgs","repos_url":"https://api.github.com/users/osu-cass/repos","events_url":"https://api.github.com/users/osu-cass/events{/privacy}","received_events_url":"https://api.github.com/users/osu-cass/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/osu-cass/whats-fresh-api","description":"A Django implementation of the What's Fresh API","fork":false,"url":"https://api.github.com/repos/osu-cass/whats-fresh-api","forks_url":"https://api.github.com/repos/osu-cass/whats-fresh-api/forks","keys_url":"https://api.github.com/repos/osu-cass/whats-fresh-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/osu-cass/whats-fresh-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/osu-cass/whats-fresh-api/teams","hooks_url":"https://api.github.com/repos/osu-cass/whats-fresh-api/hooks","issue_events_url":"https://api.github.com/repos/osu-cass/whats-fresh-api/issues/events{/number}","events_url":"https://api.github.com/repos/osu-cass/whats-fresh-api/events","assignees_url":"https://api.github.com/repos/osu-cass/whats-fresh-api/assignees{/user}","branches_url":"https://api.github.com/repos/osu-cass/whats-fresh-api/branches{/branch}","tags_url":"https://api.github.com/repos/osu-cass/whats-fresh-api/tags","blobs_url":"https://api.github.com/repos/osu-cass/whats-fresh-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/osu-cass/whats-fresh-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/osu-cass/whats-fresh-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/osu-cass/whats-fresh-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/osu-cass/whats-fresh-api/statuses/{sha}","languages_url":"https://api.github.com/repos/osu-cass/whats-fresh-api/languages","stargazers_url":"https://api.github.com/repos/osu-cass/whats-fresh-api/stargazers","contributors_url":"https://api.github.com/repos/osu-cass/whats-fresh-api/contributors","subscribers_url":"https://api.github.com/repos/osu-cass/whats-fresh-api/subscribers","subscription_url":"https://api.github.com/repos/osu-cass/whats-fresh-api/subscription","commits_url":"https://api.github.com/repos/osu-cass/whats-fresh-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/osu-cass/whats-fresh-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/osu-cass/whats-fresh-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/osu-cass/whats-fresh-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/osu-cass/whats-fresh-api/contents/{+path}","compare_url":"https://api.github.com/repos/osu-cass/whats-fresh-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/osu-cass/whats-fresh-api/merges","archive_url":"https://api.github.com/repos/osu-cass/whats-fresh-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/osu-cass/whats-fresh-api/downloads","issues_url":"https://api.github.com/repos/osu-cass/whats-fresh-api/issues{/number}","pulls_url":"https://api.github.com/repos/osu-cass/whats-fresh-api/pulls{/number}","milestones_url":"https://api.github.com/repos/osu-cass/whats-fresh-api/milestones{/number}","notifications_url":"https://api.github.com/repos/osu-cass/whats-fresh-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/osu-cass/whats-fresh-api/labels{/name}","releases_url":"https://api.github.com/repos/osu-cass/whats-fresh-api/releases{/id}","created_at":"2014-07-31T18:22:09Z","updated_at":"2015-03-18T19:45:29Z","pushed_at":"2015-07-21T19:50:17Z","git_url":"git://github.com/osu-cass/whats-fresh-api.git","ssh_url":"git@github.com:osu-cass/whats-fresh-api.git","clone_url":"https://github.com/osu-cass/whats-fresh-api.git","svn_url":"https://github.com/osu-cass/whats-fresh-api","homepage":null,"size":3740,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":21,"forks":8,"open_issues":21,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/osu-cass/whats-fresh-api/pulls/70"},"html":{"href":"https://github.com/osu-cass/whats-fresh-api/pull/70"},"issue":{"href":"https://api.github.com/repos/osu-cass/whats-fresh-api/issues/70"},"comments":{"href":"https://api.github.com/repos/osu-cass/whats-fresh-api/issues/70/comments"},"review_comments":{"href":"https://api.github.com/repos/osu-cass/whats-fresh-api/pulls/70/comments"},"review_comment":{"href":"https://api.github.com/repos/osu-cass/whats-fresh-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/osu-cass/whats-fresh-api/pulls/70/commits"},"statuses":{"href":"https://api.github.com/repos/osu-cass/whats-fresh-api/statuses/58712ea6e356d2327ffdca6722b63c66e4684eb2"}}}}