{"action":"created","comment":{"url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/pulls/comments/50190904","id":50190904,"diff_hunk":"@@ -70,6 +90,167 @@ def testListUsersHandler(self, mock_get_all):\n       details_link = flask.url_for('user_details', user_id=mock_users[x].id)\n       self.assertEquals(details_link in user_list_output, True)\n \n+  @patch.object(user, '_RenderUserAdd')\n+  def testAddUsersGetHandler(self, mock_render):\n+    \"\"\"Test the add users get handler returns _RenderUserAdd's result.\"\"\"\n+    return_text = '<html>something here </html>'\n+    mock_render.return_value = return_text\n+    resp = self.client.get(flask.url_for('add_user'))\n+\n+    self.assertEquals(resp.data, return_text)\n+\n+  @patch('flask.render_template')\n+  @patch.object(oauth, 'getSavedCredentials')\n+  def testAddUsersGetNoCredentials(self, mock_get_saved_credentials,\n+                                  mock_render_template):\n+    \"\"\"Test add user get should display an error when oauth isn't set.\"\"\"\n+    mock_get_saved_credentials.return_value = None\n+    mock_render_template.return_value = ''\n+\n+    response = self.client.get(flask.url_for('add_user'))\n+\n+    args, kwargs = mock_render_template.call_args\n+    self.assertEquals('add_user.html', args[0])\n+    self.assertEquals([], kwargs['directory_users'])\n+    self.assertEquals(kwargs['error'] is not None, True)","path":"ufo/user_test.py","position":68,"original_position":68,"commit_id":"bf057009a88c5314a7d9c4db71e276032a20d903","original_commit_id":"bf057009a88c5314a7d9c4db71e276032a20d903","user":{"login":"blueandgold","id":6977544,"avatar_url":"https://avatars.githubusercontent.com/u/6977544?v=3","gravatar_id":"","url":"https://api.github.com/users/blueandgold","html_url":"https://github.com/blueandgold","followers_url":"https://api.github.com/users/blueandgold/followers","following_url":"https://api.github.com/users/blueandgold/following{/other_user}","gists_url":"https://api.github.com/users/blueandgold/gists{/gist_id}","starred_url":"https://api.github.com/users/blueandgold/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blueandgold/subscriptions","organizations_url":"https://api.github.com/users/blueandgold/orgs","repos_url":"https://api.github.com/users/blueandgold/repos","events_url":"https://api.github.com/users/blueandgold/events{/privacy}","received_events_url":"https://api.github.com/users/blueandgold/received_events","type":"User","site_admin":false},"body":"nit: assertIsNotNone\r\nhttps://docs.python.org/2/library/unittest.html#unittest.TestCase.assertIsNotNone\r\n\r\nself.assertIsNotNone(kwargs['error'])","created_at":"2016-01-19T23:06:41Z","updated_at":"2016-01-19T23:06:41Z","html_url":"https://github.com/uProxy/ufo-management-server-flask/pull/11#discussion_r50190904","pull_request_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/pulls/11","_links":{"self":{"href":"https://api.github.com/repos/uProxy/ufo-management-server-flask/pulls/comments/50190904"},"html":{"href":"https://github.com/uProxy/ufo-management-server-flask/pull/11#discussion_r50190904"},"pull_request":{"href":"https://api.github.com/repos/uProxy/ufo-management-server-flask/pulls/11"}}},"pull_request":{"url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/pulls/11","id":56210655,"html_url":"https://github.com/uProxy/ufo-management-server-flask/pull/11","diff_url":"https://github.com/uProxy/ufo-management-server-flask/pull/11.diff","patch_url":"https://github.com/uProxy/ufo-management-server-flask/pull/11.patch","issue_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/issues/11","number":11,"state":"open","locked":false,"title":"Migrate More User Tests Over to Flask","user":{"login":"xwsxethan","id":6269245,"avatar_url":"https://avatars.githubusercontent.com/u/6269245?v=3","gravatar_id":"","url":"https://api.github.com/users/xwsxethan","html_url":"https://github.com/xwsxethan","followers_url":"https://api.github.com/users/xwsxethan/followers","following_url":"https://api.github.com/users/xwsxethan/following{/other_user}","gists_url":"https://api.github.com/users/xwsxethan/gists{/gist_id}","starred_url":"https://api.github.com/users/xwsxethan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xwsxethan/subscriptions","organizations_url":"https://api.github.com/users/xwsxethan/orgs","repos_url":"https://api.github.com/users/xwsxethan/repos","events_url":"https://api.github.com/users/xwsxethan/events{/privacy}","received_events_url":"https://api.github.com/users/xwsxethan/received_events","type":"User","site_admin":false},"body":"I'm going to add more to these in this same PR later, but I wanted to go ahead and get initial comments before I proceed too far so there's less work down the road.\r\n\r\nObviously, ignore all the commented out parts as those will migrated soon.\r\n\r\nPlease take a look at the change to xsrf and config as that was my easier way of disabling that during testing. We can similarly key off of any config value (it doesn't have to be WTF_CSRF_ENABLED for instance, it could be TESTING, or anything else), so long as it is different in production and testing modes.\r\n\r\nAlso note what I am asserting and what I am mocking. If this seems right then I'll continue as is, or if not, then I'll adjust what assertions we actually make moving forward. Thanks!\n\n<!-- Reviewable:start -->\n[<img src=\"https://reviewable.io/review_button.png\" height=40 alt=\"Review on Reviewable\"/>](https://reviewable.io/reviews/uproxy/ufo-management-server-flask/11)\n<!-- Reviewable:end -->\n","created_at":"2016-01-15T19:27:13Z","updated_at":"2016-01-19T23:06:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0c00298fb440409d2f81b7590f7e7edfd5c16242","assignee":{"login":"blueandgold","id":6977544,"avatar_url":"https://avatars.githubusercontent.com/u/6977544?v=3","gravatar_id":"","url":"https://api.github.com/users/blueandgold","html_url":"https://github.com/blueandgold","followers_url":"https://api.github.com/users/blueandgold/followers","following_url":"https://api.github.com/users/blueandgold/following{/other_user}","gists_url":"https://api.github.com/users/blueandgold/gists{/gist_id}","starred_url":"https://api.github.com/users/blueandgold/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blueandgold/subscriptions","organizations_url":"https://api.github.com/users/blueandgold/orgs","repos_url":"https://api.github.com/users/blueandgold/repos","events_url":"https://api.github.com/users/blueandgold/events{/privacy}","received_events_url":"https://api.github.com/users/blueandgold/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/pulls/11/commits","review_comments_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/pulls/11/comments","review_comment_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/pulls/comments{/number}","comments_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/issues/11/comments","statuses_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/statuses/bf057009a88c5314a7d9c4db71e276032a20d903","head":{"label":"uProxy:migrateALLOFTHETESTS","ref":"migrateALLOFTHETESTS","sha":"bf057009a88c5314a7d9c4db71e276032a20d903","user":{"login":"uProxy","id":6548286,"avatar_url":"https://avatars.githubusercontent.com/u/6548286?v=3","gravatar_id":"","url":"https://api.github.com/users/uProxy","html_url":"https://github.com/uProxy","followers_url":"https://api.github.com/users/uProxy/followers","following_url":"https://api.github.com/users/uProxy/following{/other_user}","gists_url":"https://api.github.com/users/uProxy/gists{/gist_id}","starred_url":"https://api.github.com/users/uProxy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uProxy/subscriptions","organizations_url":"https://api.github.com/users/uProxy/orgs","repos_url":"https://api.github.com/users/uProxy/repos","events_url":"https://api.github.com/users/uProxy/events{/privacy}","received_events_url":"https://api.github.com/users/uProxy/received_events","type":"Organization","site_admin":false},"repo":{"id":49228678,"name":"ufo-management-server-flask","full_name":"uProxy/ufo-management-server-flask","owner":{"login":"uProxy","id":6548286,"avatar_url":"https://avatars.githubusercontent.com/u/6548286?v=3","gravatar_id":"","url":"https://api.github.com/users/uProxy","html_url":"https://github.com/uProxy","followers_url":"https://api.github.com/users/uProxy/followers","following_url":"https://api.github.com/users/uProxy/following{/other_user}","gists_url":"https://api.github.com/users/uProxy/gists{/gist_id}","starred_url":"https://api.github.com/users/uProxy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uProxy/subscriptions","organizations_url":"https://api.github.com/users/uProxy/orgs","repos_url":"https://api.github.com/users/uProxy/repos","events_url":"https://api.github.com/users/uProxy/events{/privacy}","received_events_url":"https://api.github.com/users/uProxy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uProxy/ufo-management-server-flask","description":"","fork":false,"url":"https://api.github.com/repos/uProxy/ufo-management-server-flask","forks_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/forks","keys_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/teams","hooks_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/hooks","issue_events_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/issues/events{/number}","events_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/events","assignees_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/assignees{/user}","branches_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/branches{/branch}","tags_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/tags","blobs_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/git/refs{/sha}","trees_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/statuses/{sha}","languages_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/languages","stargazers_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/stargazers","contributors_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/contributors","subscribers_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/subscribers","subscription_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/subscription","commits_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/commits{/sha}","git_commits_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/git/commits{/sha}","comments_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/comments{/number}","issue_comment_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/issues/comments{/number}","contents_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/contents/{+path}","compare_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/merges","archive_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/downloads","issues_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/issues{/number}","pulls_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/pulls{/number}","milestones_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/milestones{/number}","notifications_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/labels{/name}","releases_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/releases{/id}","created_at":"2016-01-07T20:25:00Z","updated_at":"2016-01-12T21:38:37Z","pushed_at":"2016-01-19T22:41:32Z","git_url":"git://github.com/uProxy/ufo-management-server-flask.git","ssh_url":"git@github.com:uProxy/ufo-management-server-flask.git","clone_url":"https://github.com/uProxy/ufo-management-server-flask.git","svn_url":"https://github.com/uProxy/ufo-management-server-flask","homepage":null,"size":91,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"uProxy:master","ref":"master","sha":"8cdbf3a34211f584e9f6d49fc0f6ce11bbcf73e2","user":{"login":"uProxy","id":6548286,"avatar_url":"https://avatars.githubusercontent.com/u/6548286?v=3","gravatar_id":"","url":"https://api.github.com/users/uProxy","html_url":"https://github.com/uProxy","followers_url":"https://api.github.com/users/uProxy/followers","following_url":"https://api.github.com/users/uProxy/following{/other_user}","gists_url":"https://api.github.com/users/uProxy/gists{/gist_id}","starred_url":"https://api.github.com/users/uProxy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uProxy/subscriptions","organizations_url":"https://api.github.com/users/uProxy/orgs","repos_url":"https://api.github.com/users/uProxy/repos","events_url":"https://api.github.com/users/uProxy/events{/privacy}","received_events_url":"https://api.github.com/users/uProxy/received_events","type":"Organization","site_admin":false},"repo":{"id":49228678,"name":"ufo-management-server-flask","full_name":"uProxy/ufo-management-server-flask","owner":{"login":"uProxy","id":6548286,"avatar_url":"https://avatars.githubusercontent.com/u/6548286?v=3","gravatar_id":"","url":"https://api.github.com/users/uProxy","html_url":"https://github.com/uProxy","followers_url":"https://api.github.com/users/uProxy/followers","following_url":"https://api.github.com/users/uProxy/following{/other_user}","gists_url":"https://api.github.com/users/uProxy/gists{/gist_id}","starred_url":"https://api.github.com/users/uProxy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uProxy/subscriptions","organizations_url":"https://api.github.com/users/uProxy/orgs","repos_url":"https://api.github.com/users/uProxy/repos","events_url":"https://api.github.com/users/uProxy/events{/privacy}","received_events_url":"https://api.github.com/users/uProxy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uProxy/ufo-management-server-flask","description":"","fork":false,"url":"https://api.github.com/repos/uProxy/ufo-management-server-flask","forks_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/forks","keys_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/teams","hooks_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/hooks","issue_events_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/issues/events{/number}","events_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/events","assignees_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/assignees{/user}","branches_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/branches{/branch}","tags_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/tags","blobs_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/git/refs{/sha}","trees_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/statuses/{sha}","languages_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/languages","stargazers_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/stargazers","contributors_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/contributors","subscribers_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/subscribers","subscription_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/subscription","commits_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/commits{/sha}","git_commits_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/git/commits{/sha}","comments_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/comments{/number}","issue_comment_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/issues/comments{/number}","contents_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/contents/{+path}","compare_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/merges","archive_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/downloads","issues_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/issues{/number}","pulls_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/pulls{/number}","milestones_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/milestones{/number}","notifications_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/labels{/name}","releases_url":"https://api.github.com/repos/uProxy/ufo-management-server-flask/releases{/id}","created_at":"2016-01-07T20:25:00Z","updated_at":"2016-01-12T21:38:37Z","pushed_at":"2016-01-19T22:41:32Z","git_url":"git://github.com/uProxy/ufo-management-server-flask.git","ssh_url":"git@github.com:uProxy/ufo-management-server-flask.git","clone_url":"https://github.com/uProxy/ufo-management-server-flask.git","svn_url":"https://github.com/uProxy/ufo-management-server-flask","homepage":null,"size":91,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/uProxy/ufo-management-server-flask/pulls/11"},"html":{"href":"https://github.com/uProxy/ufo-management-server-flask/pull/11"},"issue":{"href":"https://api.github.com/repos/uProxy/ufo-management-server-flask/issues/11"},"comments":{"href":"https://api.github.com/repos/uProxy/ufo-management-server-flask/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/uProxy/ufo-management-server-flask/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/uProxy/ufo-management-server-flask/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/uProxy/ufo-management-server-flask/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/uProxy/ufo-management-server-flask/statuses/bf057009a88c5314a7d9c4db71e276032a20d903"}}}}