{"action":"created","comment":{"url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/pulls/comments/105776824","pull_request_review_id":26663998,"id":105776824,"diff_hunk":"@@ -0,0 +1,89 @@\n+import pytest\n+import json\n+from datetime import date\n+\n+from model_mommy import mommy\n+from rest_framework import status\n+import json\n+\n+'''\n+This set of tests exists to test all example requests used in the API documentation","path":"usaspending_api/api_docs/tests/test_documentation_examples.py","position":10,"original_position":10,"commit_id":"81c55798e55241448e5d5e7af515a0a67c31197e","original_commit_id":"81c55798e55241448e5d5e7af515a0a67c31197e","user":{"login":"bsweger","id":540544,"avatar_url":"https://avatars1.githubusercontent.com/u/540544?v=3","gravatar_id":"","url":"https://api.github.com/users/bsweger","html_url":"https://github.com/bsweger","followers_url":"https://api.github.com/users/bsweger/followers","following_url":"https://api.github.com/users/bsweger/following{/other_user}","gists_url":"https://api.github.com/users/bsweger/gists{/gist_id}","starred_url":"https://api.github.com/users/bsweger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bsweger/subscriptions","organizations_url":"https://api.github.com/users/bsweger/orgs","repos_url":"https://api.github.com/users/bsweger/repos","events_url":"https://api.github.com/users/bsweger/events{/privacy}","received_events_url":"https://api.github.com/users/bsweger/received_events","type":"User","site_admin":false},"body":"Terrific idea to write tests for the documentation examples!","created_at":"2017-03-13T21:29:46Z","updated_at":"2017-03-13T21:37:18Z","html_url":"https://github.com/fedspendingtransparency/usaspending-api/pull/203#discussion_r105776824","pull_request_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/pulls/203","_links":{"self":{"href":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/pulls/comments/105776824"},"html":{"href":"https://github.com/fedspendingtransparency/usaspending-api/pull/203#discussion_r105776824"},"pull_request":{"href":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/pulls/203"}}},"pull_request":{"url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/pulls/203","id":110398067,"html_url":"https://github.com/fedspendingtransparency/usaspending-api/pull/203","diff_url":"https://github.com/fedspendingtransparency/usaspending-api/pull/203.diff","patch_url":"https://github.com/fedspendingtransparency/usaspending-api/pull/203.patch","issue_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/issues/203","number":203,"state":"open","locked":false,"title":"Updated API Documentation","user":{"login":"afrasier","id":6662582,"avatar_url":"https://avatars1.githubusercontent.com/u/6662582?v=3","gravatar_id":"","url":"https://api.github.com/users/afrasier","html_url":"https://github.com/afrasier","followers_url":"https://api.github.com/users/afrasier/followers","following_url":"https://api.github.com/users/afrasier/following{/other_user}","gists_url":"https://api.github.com/users/afrasier/gists{/gist_id}","starred_url":"https://api.github.com/users/afrasier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afrasier/subscriptions","organizations_url":"https://api.github.com/users/afrasier/orgs","repos_url":"https://api.github.com/users/afrasier/repos","events_url":"https://api.github.com/users/afrasier/events{/privacy}","received_events_url":"https://api.github.com/users/afrasier/received_events","type":"User","site_admin":false},"body":"There's a lot here, buckle up!\r\n\r\n* Added `generate_model_markdown` management command. This generates a table in markdown format based upon a specified model, getting descriptions from the model's fields' `help_text` parameter. You can call this command via `python manage.py generate_model_markdown awards.Award` to see it in action. I didn't have time to add `help_text` to every field on every model, and I suspect I will need some help coming up with friendly descriptions of these fields. Additionally, this models functionality can be leveraged by a template tag, allowing us to make some fully automated docs that render nicely, so that we don not have to keep up with them. (That's future plans though, and I'm sure there's a library somewhere to help, but I couldn't find any I could get working in time)\r\n\r\n* Added `help_text` to `Award`\r\n* Moved all documentation into `/api_docs/`\r\n* Modified `docs.py` template tag generator to accept arbitrary Markdown via new `MarkdownView`\r\n* Extracted all documentation urls into `/api_docs/urls.py`\r\n* Created a new landing page so it doesn't dump people straight into `using_the_api.md`\r\n* Added an introductory tutorial, `intro_tutorial.md` accessible via `/docs/intro-tutorial`\r\n* Added documentation index, `documentation_index.md` accessible via `/docs/`\r\n* Added data dictionary, `data_dictionary.md`, accessible via `/docs/data-dictionary/`. This has jargon definitions from the content guidelines' linked spreadsheet; a table of every endpoint, the methods they use, and generally what they provide; a list of every field in every object with descriptions where available (generated from `generate_model_markdown`)\r\n* Added request recipes, `request_recipes.md` accessible via `/docs/recipes`. I only had a time to add a handful, but this is easily expandable\r\n* Added a test class called `test_documentation_examples.py` which tests _every_ example post and get request listed in the _new_ tutorials and documentation. Note that this doesn't check for the accuracy of the responses, just that the responses return 200. This way, if a change causes a break in this test and no others, it is likely the documentation needs to be updated. \r\n","created_at":"2017-03-13T12:57:12Z","updated_at":"2017-03-13T21:37:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bed0df4c23f5ff58722ec9fad3fc23e60e2b6eec","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/pulls/203/commits","review_comments_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/pulls/203/comments","review_comment_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/issues/203/comments","statuses_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/statuses/81c55798e55241448e5d5e7af515a0a67c31197e","head":{"label":"fedspendingtransparency:api-tutorial-recpies","ref":"api-tutorial-recpies","sha":"81c55798e55241448e5d5e7af515a0a67c31197e","user":{"login":"fedspendingtransparency","id":8397762,"avatar_url":"https://avatars3.githubusercontent.com/u/8397762?v=3","gravatar_id":"","url":"https://api.github.com/users/fedspendingtransparency","html_url":"https://github.com/fedspendingtransparency","followers_url":"https://api.github.com/users/fedspendingtransparency/followers","following_url":"https://api.github.com/users/fedspendingtransparency/following{/other_user}","gists_url":"https://api.github.com/users/fedspendingtransparency/gists{/gist_id}","starred_url":"https://api.github.com/users/fedspendingtransparency/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fedspendingtransparency/subscriptions","organizations_url":"https://api.github.com/users/fedspendingtransparency/orgs","repos_url":"https://api.github.com/users/fedspendingtransparency/repos","events_url":"https://api.github.com/users/fedspendingtransparency/events{/privacy}","received_events_url":"https://api.github.com/users/fedspendingtransparency/received_events","type":"Organization","site_admin":false},"repo":{"id":65394827,"name":"usaspending-api","full_name":"fedspendingtransparency/usaspending-api","owner":{"login":"fedspendingtransparency","id":8397762,"avatar_url":"https://avatars3.githubusercontent.com/u/8397762?v=3","gravatar_id":"","url":"https://api.github.com/users/fedspendingtransparency","html_url":"https://github.com/fedspendingtransparency","followers_url":"https://api.github.com/users/fedspendingtransparency/followers","following_url":"https://api.github.com/users/fedspendingtransparency/following{/other_user}","gists_url":"https://api.github.com/users/fedspendingtransparency/gists{/gist_id}","starred_url":"https://api.github.com/users/fedspendingtransparency/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fedspendingtransparency/subscriptions","organizations_url":"https://api.github.com/users/fedspendingtransparency/orgs","repos_url":"https://api.github.com/users/fedspendingtransparency/repos","events_url":"https://api.github.com/users/fedspendingtransparency/events{/privacy}","received_events_url":"https://api.github.com/users/fedspendingtransparency/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fedspendingtransparency/usaspending-api","description":"An API for U.S. federal spending data","fork":false,"url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api","forks_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/forks","keys_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/teams","hooks_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/hooks","issue_events_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/issues/events{/number}","events_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/events","assignees_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/assignees{/user}","branches_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/branches{/branch}","tags_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/tags","blobs_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/statuses/{sha}","languages_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/languages","stargazers_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/stargazers","contributors_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/contributors","subscribers_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/subscribers","subscription_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/subscription","commits_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/contents/{+path}","compare_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/merges","archive_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/downloads","issues_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/issues{/number}","pulls_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/pulls{/number}","milestones_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/milestones{/number}","notifications_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/labels{/name}","releases_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/releases{/id}","deployments_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/deployments","created_at":"2016-08-10T15:39:45Z","updated_at":"2017-02-14T15:25:10Z","pushed_at":"2017-03-13T19:55:54Z","git_url":"git://github.com/fedspendingtransparency/usaspending-api.git","ssh_url":"git@github.com:fedspendingtransparency/usaspending-api.git","clone_url":"https://github.com/fedspendingtransparency/usaspending-api.git","svn_url":"https://github.com/fedspendingtransparency/usaspending-api","homepage":"","size":11159,"stargazers_count":6,"watchers_count":6,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":4,"forks":7,"open_issues":4,"watchers":6,"default_branch":"dev"}},"base":{"label":"fedspendingtransparency:dev","ref":"dev","sha":"72dbc3d71384946a7cc7c12bdacc0bf5d201b48a","user":{"login":"fedspendingtransparency","id":8397762,"avatar_url":"https://avatars3.githubusercontent.com/u/8397762?v=3","gravatar_id":"","url":"https://api.github.com/users/fedspendingtransparency","html_url":"https://github.com/fedspendingtransparency","followers_url":"https://api.github.com/users/fedspendingtransparency/followers","following_url":"https://api.github.com/users/fedspendingtransparency/following{/other_user}","gists_url":"https://api.github.com/users/fedspendingtransparency/gists{/gist_id}","starred_url":"https://api.github.com/users/fedspendingtransparency/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fedspendingtransparency/subscriptions","organizations_url":"https://api.github.com/users/fedspendingtransparency/orgs","repos_url":"https://api.github.com/users/fedspendingtransparency/repos","events_url":"https://api.github.com/users/fedspendingtransparency/events{/privacy}","received_events_url":"https://api.github.com/users/fedspendingtransparency/received_events","type":"Organization","site_admin":false},"repo":{"id":65394827,"name":"usaspending-api","full_name":"fedspendingtransparency/usaspending-api","owner":{"login":"fedspendingtransparency","id":8397762,"avatar_url":"https://avatars3.githubusercontent.com/u/8397762?v=3","gravatar_id":"","url":"https://api.github.com/users/fedspendingtransparency","html_url":"https://github.com/fedspendingtransparency","followers_url":"https://api.github.com/users/fedspendingtransparency/followers","following_url":"https://api.github.com/users/fedspendingtransparency/following{/other_user}","gists_url":"https://api.github.com/users/fedspendingtransparency/gists{/gist_id}","starred_url":"https://api.github.com/users/fedspendingtransparency/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fedspendingtransparency/subscriptions","organizations_url":"https://api.github.com/users/fedspendingtransparency/orgs","repos_url":"https://api.github.com/users/fedspendingtransparency/repos","events_url":"https://api.github.com/users/fedspendingtransparency/events{/privacy}","received_events_url":"https://api.github.com/users/fedspendingtransparency/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fedspendingtransparency/usaspending-api","description":"An API for U.S. federal spending data","fork":false,"url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api","forks_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/forks","keys_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/teams","hooks_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/hooks","issue_events_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/issues/events{/number}","events_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/events","assignees_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/assignees{/user}","branches_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/branches{/branch}","tags_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/tags","blobs_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/statuses/{sha}","languages_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/languages","stargazers_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/stargazers","contributors_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/contributors","subscribers_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/subscribers","subscription_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/subscription","commits_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/contents/{+path}","compare_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/merges","archive_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/downloads","issues_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/issues{/number}","pulls_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/pulls{/number}","milestones_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/milestones{/number}","notifications_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/labels{/name}","releases_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/releases{/id}","deployments_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/deployments","created_at":"2016-08-10T15:39:45Z","updated_at":"2017-02-14T15:25:10Z","pushed_at":"2017-03-13T19:55:54Z","git_url":"git://github.com/fedspendingtransparency/usaspending-api.git","ssh_url":"git@github.com:fedspendingtransparency/usaspending-api.git","clone_url":"https://github.com/fedspendingtransparency/usaspending-api.git","svn_url":"https://github.com/fedspendingtransparency/usaspending-api","homepage":"","size":11159,"stargazers_count":6,"watchers_count":6,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":4,"forks":7,"open_issues":4,"watchers":6,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/pulls/203"},"html":{"href":"https://github.com/fedspendingtransparency/usaspending-api/pull/203"},"issue":{"href":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/issues/203"},"comments":{"href":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/issues/203/comments"},"review_comments":{"href":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/pulls/203/comments"},"review_comment":{"href":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/pulls/203/commits"},"statuses":{"href":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/statuses/81c55798e55241448e5d5e7af515a0a67c31197e"}}}}
{"actor":{"display_login":"bsweger"}}