{"action":"created","comment":{"url":"https://api.github.com/repos/hydroshare/hydroshare/pulls/comments/50044641","id":50044641,"diff_hunk":"@@ -0,0 +1,44 @@\n+import json\n+\n+from django.contrib.auth.models import Group\n+\n+from rest_framework.test import APIClient\n+from rest_framework import status\n+from rest_framework.test import APITestCase\n+\n+from hs_core.hydroshare import users\n+\n+\n+class TestUserInfo(APITestCase):\n+\n+    def setUp(self):\n+        self.maxDiff = None\n+        self.client = APIClient()\n+\n+        self.group, _ = Group.objects.get_or_create(name='Hydroshare Author')\n+        # create a user\n+        self.email = 'test_user@email.com'\n+        self.username = 'testuser'\n+        self.first_name = 'some_first_name'\n+        self.last_name = 'some_last_name'\n+\n+        self.user = users.create_account(\n+            self.email,\n+            username=self.username,\n+            first_name=self.first_name,\n+            last_name=self.last_name,\n+            superuser=False)\n+\n+        self.client.force_authenticate(user=self.user)\n+\n+    def tearDown(self):\n+        self.user.delete()","path":"hs_core/tests/api/rest/test_user_info.py","position":35,"original_position":35,"commit_id":"b99031eec4a7b842339073fe9763fe06dbf21208","original_commit_id":"b99031eec4a7b842339073fe9763fe06dbf21208","user":{"login":"zhiyuli","id":10070599,"avatar_url":"https://avatars.githubusercontent.com/u/10070599?v=3","gravatar_id":"","url":"https://api.github.com/users/zhiyuli","html_url":"https://github.com/zhiyuli","followers_url":"https://api.github.com/users/zhiyuli/followers","following_url":"https://api.github.com/users/zhiyuli/following{/other_user}","gists_url":"https://api.github.com/users/zhiyuli/gists{/gist_id}","starred_url":"https://api.github.com/users/zhiyuli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhiyuli/subscriptions","organizations_url":"https://api.github.com/users/zhiyuli/orgs","repos_url":"https://api.github.com/users/zhiyuli/repos","events_url":"https://api.github.com/users/zhiyuli/events{/privacy}","received_events_url":"https://api.github.com/users/zhiyuli/received_events","type":"User","site_admin":false},"body":"@ironfroggy Is the tearDown section necessary? I remember you told me django test framework will take care of all clean-up. But looks here it is using \"from rest_framework.test import APITestCase\". Thanks\r\n\r\n@selimnairb I would give a +1 once the above minor issue is settled. thanks","created_at":"2016-01-18T21:14:36Z","updated_at":"2016-01-18T21:14:36Z","html_url":"https://github.com/hydroshare/hydroshare/pull/885#discussion_r50044641","pull_request_url":"https://api.github.com/repos/hydroshare/hydroshare/pulls/885","_links":{"self":{"href":"https://api.github.com/repos/hydroshare/hydroshare/pulls/comments/50044641"},"html":{"href":"https://github.com/hydroshare/hydroshare/pull/885#discussion_r50044641"},"pull_request":{"href":"https://api.github.com/repos/hydroshare/hydroshare/pulls/885"}}},"pull_request":{"url":"https://api.github.com/repos/hydroshare/hydroshare/pulls/885","id":56215948,"html_url":"https://github.com/hydroshare/hydroshare/pull/885","diff_url":"https://github.com/hydroshare/hydroshare/pull/885.diff","patch_url":"https://github.com/hydroshare/hydroshare/pull/885.patch","issue_url":"https://api.github.com/repos/hydroshare/hydroshare/issues/885","number":885,"state":"open","locked":false,"title":"Add first and last name to userInfo REST endpoint","user":{"login":"selimnairb","id":2529681,"avatar_url":"https://avatars.githubusercontent.com/u/2529681?v=3","gravatar_id":"","url":"https://api.github.com/users/selimnairb","html_url":"https://github.com/selimnairb","followers_url":"https://api.github.com/users/selimnairb/followers","following_url":"https://api.github.com/users/selimnairb/following{/other_user}","gists_url":"https://api.github.com/users/selimnairb/gists{/gist_id}","starred_url":"https://api.github.com/users/selimnairb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/selimnairb/subscriptions","organizations_url":"https://api.github.com/users/selimnairb/orgs","repos_url":"https://api.github.com/users/selimnairb/repos","events_url":"https://api.github.com/users/selimnairb/events{/privacy}","received_events_url":"https://api.github.com/users/selimnairb/received_events","type":"User","site_admin":false},"body":"See #884 ","created_at":"2016-01-15T20:13:46Z","updated_at":"2016-01-18T21:14:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e1ce0fe23c238154b741e0b8185ea1f10ea67ce0","assignee":{"login":"zhiyuli","id":10070599,"avatar_url":"https://avatars.githubusercontent.com/u/10070599?v=3","gravatar_id":"","url":"https://api.github.com/users/zhiyuli","html_url":"https://github.com/zhiyuli","followers_url":"https://api.github.com/users/zhiyuli/followers","following_url":"https://api.github.com/users/zhiyuli/following{/other_user}","gists_url":"https://api.github.com/users/zhiyuli/gists{/gist_id}","starred_url":"https://api.github.com/users/zhiyuli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhiyuli/subscriptions","organizations_url":"https://api.github.com/users/zhiyuli/orgs","repos_url":"https://api.github.com/users/zhiyuli/repos","events_url":"https://api.github.com/users/zhiyuli/events{/privacy}","received_events_url":"https://api.github.com/users/zhiyuli/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/hydroshare/hydroshare/pulls/885/commits","review_comments_url":"https://api.github.com/repos/hydroshare/hydroshare/pulls/885/comments","review_comment_url":"https://api.github.com/repos/hydroshare/hydroshare/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hydroshare/hydroshare/issues/885/comments","statuses_url":"https://api.github.com/repos/hydroshare/hydroshare/statuses/b99031eec4a7b842339073fe9763fe06dbf21208","head":{"label":"hydroshare:884-add-names-to-userinfo-rest","ref":"884-add-names-to-userinfo-rest","sha":"b99031eec4a7b842339073fe9763fe06dbf21208","user":{"login":"hydroshare","id":3444493,"avatar_url":"https://avatars.githubusercontent.com/u/3444493?v=3","gravatar_id":"","url":"https://api.github.com/users/hydroshare","html_url":"https://github.com/hydroshare","followers_url":"https://api.github.com/users/hydroshare/followers","following_url":"https://api.github.com/users/hydroshare/following{/other_user}","gists_url":"https://api.github.com/users/hydroshare/gists{/gist_id}","starred_url":"https://api.github.com/users/hydroshare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hydroshare/subscriptions","organizations_url":"https://api.github.com/users/hydroshare/orgs","repos_url":"https://api.github.com/users/hydroshare/repos","events_url":"https://api.github.com/users/hydroshare/events{/privacy}","received_events_url":"https://api.github.com/users/hydroshare/received_events","type":"Organization","site_admin":false},"repo":{"id":24703136,"name":"hydroshare","full_name":"hydroshare/hydroshare","owner":{"login":"hydroshare","id":3444493,"avatar_url":"https://avatars.githubusercontent.com/u/3444493?v=3","gravatar_id":"","url":"https://api.github.com/users/hydroshare","html_url":"https://github.com/hydroshare","followers_url":"https://api.github.com/users/hydroshare/followers","following_url":"https://api.github.com/users/hydroshare/following{/other_user}","gists_url":"https://api.github.com/users/hydroshare/gists{/gist_id}","starred_url":"https://api.github.com/users/hydroshare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hydroshare/subscriptions","organizations_url":"https://api.github.com/users/hydroshare/orgs","repos_url":"https://api.github.com/users/hydroshare/repos","events_url":"https://api.github.com/users/hydroshare/events{/privacy}","received_events_url":"https://api.github.com/users/hydroshare/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hydroshare/hydroshare","description":"HydroShare is a collaborative website being developed for better access to data and models in the hydrologic sciences. ","fork":false,"url":"https://api.github.com/repos/hydroshare/hydroshare","forks_url":"https://api.github.com/repos/hydroshare/hydroshare/forks","keys_url":"https://api.github.com/repos/hydroshare/hydroshare/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hydroshare/hydroshare/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hydroshare/hydroshare/teams","hooks_url":"https://api.github.com/repos/hydroshare/hydroshare/hooks","issue_events_url":"https://api.github.com/repos/hydroshare/hydroshare/issues/events{/number}","events_url":"https://api.github.com/repos/hydroshare/hydroshare/events","assignees_url":"https://api.github.com/repos/hydroshare/hydroshare/assignees{/user}","branches_url":"https://api.github.com/repos/hydroshare/hydroshare/branches{/branch}","tags_url":"https://api.github.com/repos/hydroshare/hydroshare/tags","blobs_url":"https://api.github.com/repos/hydroshare/hydroshare/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hydroshare/hydroshare/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hydroshare/hydroshare/git/refs{/sha}","trees_url":"https://api.github.com/repos/hydroshare/hydroshare/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hydroshare/hydroshare/statuses/{sha}","languages_url":"https://api.github.com/repos/hydroshare/hydroshare/languages","stargazers_url":"https://api.github.com/repos/hydroshare/hydroshare/stargazers","contributors_url":"https://api.github.com/repos/hydroshare/hydroshare/contributors","subscribers_url":"https://api.github.com/repos/hydroshare/hydroshare/subscribers","subscription_url":"https://api.github.com/repos/hydroshare/hydroshare/subscription","commits_url":"https://api.github.com/repos/hydroshare/hydroshare/commits{/sha}","git_commits_url":"https://api.github.com/repos/hydroshare/hydroshare/git/commits{/sha}","comments_url":"https://api.github.com/repos/hydroshare/hydroshare/comments{/number}","issue_comment_url":"https://api.github.com/repos/hydroshare/hydroshare/issues/comments{/number}","contents_url":"https://api.github.com/repos/hydroshare/hydroshare/contents/{+path}","compare_url":"https://api.github.com/repos/hydroshare/hydroshare/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hydroshare/hydroshare/merges","archive_url":"https://api.github.com/repos/hydroshare/hydroshare/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hydroshare/hydroshare/downloads","issues_url":"https://api.github.com/repos/hydroshare/hydroshare/issues{/number}","pulls_url":"https://api.github.com/repos/hydroshare/hydroshare/pulls{/number}","milestones_url":"https://api.github.com/repos/hydroshare/hydroshare/milestones{/number}","notifications_url":"https://api.github.com/repos/hydroshare/hydroshare/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hydroshare/hydroshare/labels{/name}","releases_url":"https://api.github.com/repos/hydroshare/hydroshare/releases{/id}","created_at":"2014-10-02T02:19:41Z","updated_at":"2016-01-12T14:23:42Z","pushed_at":"2016-01-18T20:10:57Z","git_url":"git://github.com/hydroshare/hydroshare.git","ssh_url":"git@github.com:hydroshare/hydroshare.git","clone_url":"https://github.com/hydroshare/hydroshare.git","svn_url":"https://github.com/hydroshare/hydroshare","homepage":"https://www.hydroshare.org","size":67353,"stargazers_count":12,"watchers_count":12,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":177,"forks":2,"open_issues":177,"watchers":12,"default_branch":"develop"}},"base":{"label":"hydroshare:develop","ref":"develop","sha":"06b58ad9b0baeec17ebfe2e3f3d474b349abd9e8","user":{"login":"hydroshare","id":3444493,"avatar_url":"https://avatars.githubusercontent.com/u/3444493?v=3","gravatar_id":"","url":"https://api.github.com/users/hydroshare","html_url":"https://github.com/hydroshare","followers_url":"https://api.github.com/users/hydroshare/followers","following_url":"https://api.github.com/users/hydroshare/following{/other_user}","gists_url":"https://api.github.com/users/hydroshare/gists{/gist_id}","starred_url":"https://api.github.com/users/hydroshare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hydroshare/subscriptions","organizations_url":"https://api.github.com/users/hydroshare/orgs","repos_url":"https://api.github.com/users/hydroshare/repos","events_url":"https://api.github.com/users/hydroshare/events{/privacy}","received_events_url":"https://api.github.com/users/hydroshare/received_events","type":"Organization","site_admin":false},"repo":{"id":24703136,"name":"hydroshare","full_name":"hydroshare/hydroshare","owner":{"login":"hydroshare","id":3444493,"avatar_url":"https://avatars.githubusercontent.com/u/3444493?v=3","gravatar_id":"","url":"https://api.github.com/users/hydroshare","html_url":"https://github.com/hydroshare","followers_url":"https://api.github.com/users/hydroshare/followers","following_url":"https://api.github.com/users/hydroshare/following{/other_user}","gists_url":"https://api.github.com/users/hydroshare/gists{/gist_id}","starred_url":"https://api.github.com/users/hydroshare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hydroshare/subscriptions","organizations_url":"https://api.github.com/users/hydroshare/orgs","repos_url":"https://api.github.com/users/hydroshare/repos","events_url":"https://api.github.com/users/hydroshare/events{/privacy}","received_events_url":"https://api.github.com/users/hydroshare/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hydroshare/hydroshare","description":"HydroShare is a collaborative website being developed for better access to data and models in the hydrologic sciences. ","fork":false,"url":"https://api.github.com/repos/hydroshare/hydroshare","forks_url":"https://api.github.com/repos/hydroshare/hydroshare/forks","keys_url":"https://api.github.com/repos/hydroshare/hydroshare/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hydroshare/hydroshare/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hydroshare/hydroshare/teams","hooks_url":"https://api.github.com/repos/hydroshare/hydroshare/hooks","issue_events_url":"https://api.github.com/repos/hydroshare/hydroshare/issues/events{/number}","events_url":"https://api.github.com/repos/hydroshare/hydroshare/events","assignees_url":"https://api.github.com/repos/hydroshare/hydroshare/assignees{/user}","branches_url":"https://api.github.com/repos/hydroshare/hydroshare/branches{/branch}","tags_url":"https://api.github.com/repos/hydroshare/hydroshare/tags","blobs_url":"https://api.github.com/repos/hydroshare/hydroshare/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hydroshare/hydroshare/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hydroshare/hydroshare/git/refs{/sha}","trees_url":"https://api.github.com/repos/hydroshare/hydroshare/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hydroshare/hydroshare/statuses/{sha}","languages_url":"https://api.github.com/repos/hydroshare/hydroshare/languages","stargazers_url":"https://api.github.com/repos/hydroshare/hydroshare/stargazers","contributors_url":"https://api.github.com/repos/hydroshare/hydroshare/contributors","subscribers_url":"https://api.github.com/repos/hydroshare/hydroshare/subscribers","subscription_url":"https://api.github.com/repos/hydroshare/hydroshare/subscription","commits_url":"https://api.github.com/repos/hydroshare/hydroshare/commits{/sha}","git_commits_url":"https://api.github.com/repos/hydroshare/hydroshare/git/commits{/sha}","comments_url":"https://api.github.com/repos/hydroshare/hydroshare/comments{/number}","issue_comment_url":"https://api.github.com/repos/hydroshare/hydroshare/issues/comments{/number}","contents_url":"https://api.github.com/repos/hydroshare/hydroshare/contents/{+path}","compare_url":"https://api.github.com/repos/hydroshare/hydroshare/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hydroshare/hydroshare/merges","archive_url":"https://api.github.com/repos/hydroshare/hydroshare/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hydroshare/hydroshare/downloads","issues_url":"https://api.github.com/repos/hydroshare/hydroshare/issues{/number}","pulls_url":"https://api.github.com/repos/hydroshare/hydroshare/pulls{/number}","milestones_url":"https://api.github.com/repos/hydroshare/hydroshare/milestones{/number}","notifications_url":"https://api.github.com/repos/hydroshare/hydroshare/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hydroshare/hydroshare/labels{/name}","releases_url":"https://api.github.com/repos/hydroshare/hydroshare/releases{/id}","created_at":"2014-10-02T02:19:41Z","updated_at":"2016-01-12T14:23:42Z","pushed_at":"2016-01-18T20:10:57Z","git_url":"git://github.com/hydroshare/hydroshare.git","ssh_url":"git@github.com:hydroshare/hydroshare.git","clone_url":"https://github.com/hydroshare/hydroshare.git","svn_url":"https://github.com/hydroshare/hydroshare","homepage":"https://www.hydroshare.org","size":67353,"stargazers_count":12,"watchers_count":12,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":177,"forks":2,"open_issues":177,"watchers":12,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/hydroshare/hydroshare/pulls/885"},"html":{"href":"https://github.com/hydroshare/hydroshare/pull/885"},"issue":{"href":"https://api.github.com/repos/hydroshare/hydroshare/issues/885"},"comments":{"href":"https://api.github.com/repos/hydroshare/hydroshare/issues/885/comments"},"review_comments":{"href":"https://api.github.com/repos/hydroshare/hydroshare/pulls/885/comments"},"review_comment":{"href":"https://api.github.com/repos/hydroshare/hydroshare/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hydroshare/hydroshare/pulls/885/commits"},"statuses":{"href":"https://api.github.com/repos/hydroshare/hydroshare/statuses/b99031eec4a7b842339073fe9763fe06dbf21208"}}}}