{"action":"created","comment":{"url":"https://api.github.com/repos/infoxchange/ixprofile-client/pulls/comments/25226615","id":25226615,"diff_hunk":"@@ -0,0 +1,135 @@\n+\"\"\"\n+Test getting user details in the fake profile server.\n+\"\"\"\n+\n+from __future__ import absolute_import\n+\n+from django.contrib.auth.models import User\n+\n+from ...util import leave_only_keys\n+from . import FakeProfileServerTestCase\n+\n+\n+class UserDetailsTestCase(FakeProfileServerTestCase):\n+    \"\"\"\n+    Test listing users in the fake profile server.\n+    \"\"\"\n+\n+    filter_interesting = staticmethod(\n+        leave_only_keys('email', 'first_name', 'username', 'subscribed'))\n+\n+    maxDiff = None\n+\n+    def setUp(self):\n+        \"\"\"\n+        Add adminable app and some users to the mock.\n+        \"\"\"\n+\n+        super(UserDetailsTestCase, self).setUp()\n+\n+        self.mock_ps.register({\n+            'email': 'bob@gov.gl',\n+            'first_name': 'Bob',\n+        })\n+\n+        self.mock_ps.register({\n+            'email': 'corvax@gov.gl',\n+            'username': 'corvax',\n+            'first_name': 'Corvax',\n+        })\n+\n+    bob_username = 'sha256:8af72939b65cd3089d835d7'\n+\n+    def test_find_by_email(self):\n+        \"\"\"\n+        Test finding details by email.\n+        \"\"\"\n+\n+        self.assertEqual(\n+            self.filter_interesting(self.mock_ps.find_by_email('bob@gov.gl')),\n+            {\n+                'email': 'bob@gov.gl',\n+                'username': self.bob_username,\n+                'first_name': 'Bob',\n+                'subscribed': True,\n+            }\n+        )\n+\n+        self.assertEqual(\n+            self.filter_interesting(\n+                self.mock_ps.find_by_email('corvax@gov.gl')),\n+            {\n+                'email': 'corvax@gov.gl',\n+                'username': 'corvax',\n+                'first_name': 'Corvax',\n+                'subscribed': True,\n+            }\n+        )\n+\n+        self.assertEqual(\n+            self.mock_ps.find_by_email('sylvia@gov.gl'),\n+            None\n+        )\n+\n+        self.assertEqual(\n+            self.mock_ps.find_by_email(''),\n+            None\n+        )\n+\n+    def test_find_by_username(self):\n+        \"\"\"\n+        Test finding details by username.\n+        \"\"\"\n+\n+        self.assertEqual(\n+            self.filter_interesting(\n+                self.mock_ps.find_by_username(self.bob_username)),\n+            {","path":"ixprofile_client/tests/fake_profile_server/test_details.py","position":87,"original_position":87,"commit_id":"b81271b4e1a4ba62df3e6c5f0c67c022d22be07a","original_commit_id":"b81271b4e1a4ba62df3e6c5f0c67c022d22be07a","user":{"login":"alex-hutton","id":128956,"avatar_url":"https://avatars.githubusercontent.com/u/128956?v=3","gravatar_id":"","url":"https://api.github.com/users/alex-hutton","html_url":"https://github.com/alex-hutton","followers_url":"https://api.github.com/users/alex-hutton/followers","following_url":"https://api.github.com/users/alex-hutton/following{/other_user}","gists_url":"https://api.github.com/users/alex-hutton/gists{/gist_id}","starred_url":"https://api.github.com/users/alex-hutton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alex-hutton/subscriptions","organizations_url":"https://api.github.com/users/alex-hutton/orgs","repos_url":"https://api.github.com/users/alex-hutton/repos","events_url":"https://api.github.com/users/alex-hutton/events{/privacy}","received_events_url":"https://api.github.com/users/alex-hutton/received_events","type":"User","site_admin":false},"body":"from here to the closing curly brace should be indented by one indent","created_at":"2015-02-24T03:39:15Z","updated_at":"2015-02-24T03:39:15Z","html_url":"https://github.com/infoxchange/ixprofile-client/pull/64#discussion_r25226615","pull_request_url":"https://api.github.com/repos/infoxchange/ixprofile-client/pulls/64","_links":{"self":{"href":"https://api.github.com/repos/infoxchange/ixprofile-client/pulls/comments/25226615"},"html":{"href":"https://github.com/infoxchange/ixprofile-client/pull/64#discussion_r25226615"},"pull_request":{"href":"https://api.github.com/repos/infoxchange/ixprofile-client/pulls/64"}}},"pull_request":{"url":"https://api.github.com/repos/infoxchange/ixprofile-client/pulls/64","id":29868638,"html_url":"https://github.com/infoxchange/ixprofile-client/pull/64","diff_url":"https://github.com/infoxchange/ixprofile-client/pull/64.diff","patch_url":"https://github.com/infoxchange/ixprofile-client/pull/64.patch","issue_url":"https://api.github.com/repos/infoxchange/ixprofile-client/issues/64","number":64,"state":"open","locked":false,"title":"Username fix 57556","user":{"login":"koterpillar","id":140276,"avatar_url":"https://avatars.githubusercontent.com/u/140276?v=3","gravatar_id":"","url":"https://api.github.com/users/koterpillar","html_url":"https://github.com/koterpillar","followers_url":"https://api.github.com/users/koterpillar/followers","following_url":"https://api.github.com/users/koterpillar/following{/other_user}","gists_url":"https://api.github.com/users/koterpillar/gists{/gist_id}","starred_url":"https://api.github.com/users/koterpillar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koterpillar/subscriptions","organizations_url":"https://api.github.com/users/koterpillar/orgs","repos_url":"https://api.github.com/users/koterpillar/repos","events_url":"https://api.github.com/users/koterpillar/events{/privacy}","received_events_url":"https://api.github.com/users/koterpillar/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-02-24T03:34:16Z","updated_at":"2015-02-24T03:39:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"24fedd478e49b5e4484ac8d1c71a5c0704874f15","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/infoxchange/ixprofile-client/pulls/64/commits","review_comments_url":"https://api.github.com/repos/infoxchange/ixprofile-client/pulls/64/comments","review_comment_url":"https://api.github.com/repos/infoxchange/ixprofile-client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/infoxchange/ixprofile-client/issues/64/comments","statuses_url":"https://api.github.com/repos/infoxchange/ixprofile-client/statuses/b81271b4e1a4ba62df3e6c5f0c67c022d22be07a","head":{"label":"infoxchange:username-fix-57556","ref":"username-fix-57556","sha":"b81271b4e1a4ba62df3e6c5f0c67c022d22be07a","user":{"login":"infoxchange","id":436479,"avatar_url":"https://avatars.githubusercontent.com/u/436479?v=3","gravatar_id":"","url":"https://api.github.com/users/infoxchange","html_url":"https://github.com/infoxchange","followers_url":"https://api.github.com/users/infoxchange/followers","following_url":"https://api.github.com/users/infoxchange/following{/other_user}","gists_url":"https://api.github.com/users/infoxchange/gists{/gist_id}","starred_url":"https://api.github.com/users/infoxchange/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/infoxchange/subscriptions","organizations_url":"https://api.github.com/users/infoxchange/orgs","repos_url":"https://api.github.com/users/infoxchange/repos","events_url":"https://api.github.com/users/infoxchange/events{/privacy}","received_events_url":"https://api.github.com/users/infoxchange/received_events","type":"Organization","site_admin":false},"repo":{"id":16368910,"name":"ixprofile-client","full_name":"infoxchange/ixprofile-client","owner":{"login":"infoxchange","id":436479,"avatar_url":"https://avatars.githubusercontent.com/u/436479?v=3","gravatar_id":"","url":"https://api.github.com/users/infoxchange","html_url":"https://github.com/infoxchange","followers_url":"https://api.github.com/users/infoxchange/followers","following_url":"https://api.github.com/users/infoxchange/following{/other_user}","gists_url":"https://api.github.com/users/infoxchange/gists{/gist_id}","starred_url":"https://api.github.com/users/infoxchange/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/infoxchange/subscriptions","organizations_url":"https://api.github.com/users/infoxchange/orgs","repos_url":"https://api.github.com/users/infoxchange/repos","events_url":"https://api.github.com/users/infoxchange/events{/privacy}","received_events_url":"https://api.github.com/users/infoxchange/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/infoxchange/ixprofile-client","description":"Infoxchange Profile Server Django plugin","fork":false,"url":"https://api.github.com/repos/infoxchange/ixprofile-client","forks_url":"https://api.github.com/repos/infoxchange/ixprofile-client/forks","keys_url":"https://api.github.com/repos/infoxchange/ixprofile-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/infoxchange/ixprofile-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/infoxchange/ixprofile-client/teams","hooks_url":"https://api.github.com/repos/infoxchange/ixprofile-client/hooks","issue_events_url":"https://api.github.com/repos/infoxchange/ixprofile-client/issues/events{/number}","events_url":"https://api.github.com/repos/infoxchange/ixprofile-client/events","assignees_url":"https://api.github.com/repos/infoxchange/ixprofile-client/assignees{/user}","branches_url":"https://api.github.com/repos/infoxchange/ixprofile-client/branches{/branch}","tags_url":"https://api.github.com/repos/infoxchange/ixprofile-client/tags","blobs_url":"https://api.github.com/repos/infoxchange/ixprofile-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/infoxchange/ixprofile-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/infoxchange/ixprofile-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/infoxchange/ixprofile-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/infoxchange/ixprofile-client/statuses/{sha}","languages_url":"https://api.github.com/repos/infoxchange/ixprofile-client/languages","stargazers_url":"https://api.github.com/repos/infoxchange/ixprofile-client/stargazers","contributors_url":"https://api.github.com/repos/infoxchange/ixprofile-client/contributors","subscribers_url":"https://api.github.com/repos/infoxchange/ixprofile-client/subscribers","subscription_url":"https://api.github.com/repos/infoxchange/ixprofile-client/subscription","commits_url":"https://api.github.com/repos/infoxchange/ixprofile-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/infoxchange/ixprofile-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/infoxchange/ixprofile-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/infoxchange/ixprofile-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/infoxchange/ixprofile-client/contents/{+path}","compare_url":"https://api.github.com/repos/infoxchange/ixprofile-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/infoxchange/ixprofile-client/merges","archive_url":"https://api.github.com/repos/infoxchange/ixprofile-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/infoxchange/ixprofile-client/downloads","issues_url":"https://api.github.com/repos/infoxchange/ixprofile-client/issues{/number}","pulls_url":"https://api.github.com/repos/infoxchange/ixprofile-client/pulls{/number}","milestones_url":"https://api.github.com/repos/infoxchange/ixprofile-client/milestones{/number}","notifications_url":"https://api.github.com/repos/infoxchange/ixprofile-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/infoxchange/ixprofile-client/labels{/name}","releases_url":"https://api.github.com/repos/infoxchange/ixprofile-client/releases{/id}","created_at":"2014-01-30T05:10:32Z","updated_at":"2015-02-19T22:20:45Z","pushed_at":"2015-02-24T03:34:01Z","git_url":"git://github.com/infoxchange/ixprofile-client.git","ssh_url":"git@github.com:infoxchange/ixprofile-client.git","clone_url":"https://github.com/infoxchange/ixprofile-client.git","svn_url":"https://github.com/infoxchange/ixprofile-client","homepage":null,"size":1229,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"infoxchange:master","ref":"master","sha":"309151558cbdcab35dde56008ad91b7392f3cf8f","user":{"login":"infoxchange","id":436479,"avatar_url":"https://avatars.githubusercontent.com/u/436479?v=3","gravatar_id":"","url":"https://api.github.com/users/infoxchange","html_url":"https://github.com/infoxchange","followers_url":"https://api.github.com/users/infoxchange/followers","following_url":"https://api.github.com/users/infoxchange/following{/other_user}","gists_url":"https://api.github.com/users/infoxchange/gists{/gist_id}","starred_url":"https://api.github.com/users/infoxchange/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/infoxchange/subscriptions","organizations_url":"https://api.github.com/users/infoxchange/orgs","repos_url":"https://api.github.com/users/infoxchange/repos","events_url":"https://api.github.com/users/infoxchange/events{/privacy}","received_events_url":"https://api.github.com/users/infoxchange/received_events","type":"Organization","site_admin":false},"repo":{"id":16368910,"name":"ixprofile-client","full_name":"infoxchange/ixprofile-client","owner":{"login":"infoxchange","id":436479,"avatar_url":"https://avatars.githubusercontent.com/u/436479?v=3","gravatar_id":"","url":"https://api.github.com/users/infoxchange","html_url":"https://github.com/infoxchange","followers_url":"https://api.github.com/users/infoxchange/followers","following_url":"https://api.github.com/users/infoxchange/following{/other_user}","gists_url":"https://api.github.com/users/infoxchange/gists{/gist_id}","starred_url":"https://api.github.com/users/infoxchange/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/infoxchange/subscriptions","organizations_url":"https://api.github.com/users/infoxchange/orgs","repos_url":"https://api.github.com/users/infoxchange/repos","events_url":"https://api.github.com/users/infoxchange/events{/privacy}","received_events_url":"https://api.github.com/users/infoxchange/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/infoxchange/ixprofile-client","description":"Infoxchange Profile Server Django plugin","fork":false,"url":"https://api.github.com/repos/infoxchange/ixprofile-client","forks_url":"https://api.github.com/repos/infoxchange/ixprofile-client/forks","keys_url":"https://api.github.com/repos/infoxchange/ixprofile-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/infoxchange/ixprofile-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/infoxchange/ixprofile-client/teams","hooks_url":"https://api.github.com/repos/infoxchange/ixprofile-client/hooks","issue_events_url":"https://api.github.com/repos/infoxchange/ixprofile-client/issues/events{/number}","events_url":"https://api.github.com/repos/infoxchange/ixprofile-client/events","assignees_url":"https://api.github.com/repos/infoxchange/ixprofile-client/assignees{/user}","branches_url":"https://api.github.com/repos/infoxchange/ixprofile-client/branches{/branch}","tags_url":"https://api.github.com/repos/infoxchange/ixprofile-client/tags","blobs_url":"https://api.github.com/repos/infoxchange/ixprofile-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/infoxchange/ixprofile-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/infoxchange/ixprofile-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/infoxchange/ixprofile-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/infoxchange/ixprofile-client/statuses/{sha}","languages_url":"https://api.github.com/repos/infoxchange/ixprofile-client/languages","stargazers_url":"https://api.github.com/repos/infoxchange/ixprofile-client/stargazers","contributors_url":"https://api.github.com/repos/infoxchange/ixprofile-client/contributors","subscribers_url":"https://api.github.com/repos/infoxchange/ixprofile-client/subscribers","subscription_url":"https://api.github.com/repos/infoxchange/ixprofile-client/subscription","commits_url":"https://api.github.com/repos/infoxchange/ixprofile-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/infoxchange/ixprofile-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/infoxchange/ixprofile-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/infoxchange/ixprofile-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/infoxchange/ixprofile-client/contents/{+path}","compare_url":"https://api.github.com/repos/infoxchange/ixprofile-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/infoxchange/ixprofile-client/merges","archive_url":"https://api.github.com/repos/infoxchange/ixprofile-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/infoxchange/ixprofile-client/downloads","issues_url":"https://api.github.com/repos/infoxchange/ixprofile-client/issues{/number}","pulls_url":"https://api.github.com/repos/infoxchange/ixprofile-client/pulls{/number}","milestones_url":"https://api.github.com/repos/infoxchange/ixprofile-client/milestones{/number}","notifications_url":"https://api.github.com/repos/infoxchange/ixprofile-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/infoxchange/ixprofile-client/labels{/name}","releases_url":"https://api.github.com/repos/infoxchange/ixprofile-client/releases{/id}","created_at":"2014-01-30T05:10:32Z","updated_at":"2015-02-19T22:20:45Z","pushed_at":"2015-02-24T03:34:01Z","git_url":"git://github.com/infoxchange/ixprofile-client.git","ssh_url":"git@github.com:infoxchange/ixprofile-client.git","clone_url":"https://github.com/infoxchange/ixprofile-client.git","svn_url":"https://github.com/infoxchange/ixprofile-client","homepage":null,"size":1229,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/infoxchange/ixprofile-client/pulls/64"},"html":{"href":"https://github.com/infoxchange/ixprofile-client/pull/64"},"issue":{"href":"https://api.github.com/repos/infoxchange/ixprofile-client/issues/64"},"comments":{"href":"https://api.github.com/repos/infoxchange/ixprofile-client/issues/64/comments"},"review_comments":{"href":"https://api.github.com/repos/infoxchange/ixprofile-client/pulls/64/comments"},"review_comment":{"href":"https://api.github.com/repos/infoxchange/ixprofile-client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/infoxchange/ixprofile-client/pulls/64/commits"},"statuses":{"href":"https://api.github.com/repos/infoxchange/ixprofile-client/statuses/b81271b4e1a4ba62df3e6c5f0c67c022d22be07a"}}}}