GitHub PullRequestReviewCommentEvent at 2014-09-03 10:43:47
Repository: incuna-test-utils
Actor: adam-incuna
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/incuna/incuna-test-utils/pulls/comments/17041648","id":17041648,"diff_hunk":"@@ -25,39 +14,91 @@ class BaseIntegrationTestCase(BaseRequestTestCase):\n \n     Must be subclassed with the following attributes in order to work:\n     * user_factory\n-    * view_class\n+    * view_class (class-based view) or view (method-based view)\n     \"\"\"\n-    def access_view(self, request, *args, **kwargs):\n-        \"\"\"Helper method that accesses the view.\"\"\"\n-        view = self.view_class.as_view()\n-        return view(request, *args, **kwargs)\n+    def get_view(self):\n+        \"\"\"\n+        Returns the class's attached view.\n+\n+        Checks self.view_class, then self.view.  Throws an ImproperlyConfigured\n+        exception if neither exist.\n+        \"\"\"\n+        try:\n+            return self.view_class.as_view()\n+        except AttributeError:\n+            # Continue on to the next try/catch\n+            pass\n+        \n+        try:\n+            return self.view\n+        except AttributeError:\n+            message = \"This test must have a 'view_class' or 'view' attribute.\"\n+            raise ImproperlyConfigured(message)","path":"incuna_test_utils/testcases/integration.py","position":50,"original_position":50,"commit_id":"d928bb1659f6ebb0d5a69c1a8d4c30ddac071761","original_commit_id":"31cec1c5ab052f237445b8969088aba755ae73cf","user":{"login":"adam-incuna","id":6973481,"avatar_url":"https://avatars.githubusercontent.com/u/6973481?v=2","gravatar_id":"bf180541c6c075afa4fb692816006531","url":"https://api.github.com/users/adam-incuna","html_url":"https://github.com/adam-incuna","followers_url":"https://api.github.com/users/adam-incuna/followers","following_url":"https://api.github.com/users/adam-incuna/following{/other_user}","gists_url":"https://api.github.com/users/adam-incuna/gists{/gist_id}","starred_url":"https://api.github.com/users/adam-incuna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adam-incuna/subscriptions","organizations_url":"https://api.github.com/users/adam-incuna/orgs","repos_url":"https://api.github.com/users/adam-incuna/repos","events_url":"https://api.github.com/users/adam-incuna/events{/privacy}","received_events_url":"https://api.github.com/users/adam-incuna/received_events","type":"User","site_admin":false},"body":"Ah, if it's a Python 3 thing we can't use it. :(","created_at":"2014-09-03T10:43:47Z","updated_at":"2014-09-03T10:43:47Z","html_url":"https://github.com/incuna/incuna-test-utils/pull/20#discussion_r17041648","pull_request_url":"https://api.github.com/repos/incuna/incuna-test-utils/pulls/20","_links":{"self":{"href":"https://api.github.com/repos/incuna/incuna-test-utils/pulls/comments/17041648"},"html":{"href":"https://github.com/incuna/incuna-test-utils/pull/20#discussion_r17041648"},"pull_request":{"href":"https://api.github.com/repos/incuna/incuna-test-utils/pulls/20"}}},"pull_request":{"url":"https://api.github.com/repos/incuna/incuna-test-utils/pulls/20","id":20667955,"html_url":"https://github.com/incuna/incuna-test-utils/pull/20","diff_url":"https://github.com/incuna/incuna-test-utils/pull/20.diff","patch_url":"https://github.com/incuna/incuna-test-utils/pull/20.patch","issue_url":"https://api.github.com/repos/incuna/incuna-test-utils/issues/20","number":20,"state":"open","locked":false,"title":"IntegrationTestCase needs to make more sense","user":{"login":"adam-incuna","id":6973481,"avatar_url":"https://avatars.githubusercontent.com/u/6973481?v=2","gravatar_id":"bf180541c6c075afa4fb692816006531","url":"https://api.github.com/users/adam-incuna","html_url":"https://github.com/adam-incuna","followers_url":"https://api.github.com/users/adam-incuna/followers","following_url":"https://api.github.com/users/adam-incuna/following{/other_user}","gists_url":"https://api.github.com/users/adam-incuna/gists{/gist_id}","starred_url":"https://api.github.com/users/adam-incuna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adam-incuna/subscriptions","organizations_url":"https://api.github.com/users/adam-incuna/orgs","repos_url":"https://api.github.com/users/adam-incuna/repos","events_url":"https://api.github.com/users/adam-incuna/events{/privacy}","received_events_url":"https://api.github.com/users/adam-incuna/received_events","type":"User","site_admin":false},"body":"The new `IntegrationTestCase` is somewhat complicated, and provides some substantial abstractions.  It also doesn't handle function-based views well in the slightest.  I've reflowed it a bit to make more sense, made it deal with requests more smoothly, and added understanding of function-based views.  And lots and lots of comments.\n\n@meshy @Ian-Foote review please? :)","created_at":"2014-09-03T10:29:35Z","updated_at":"2014-09-03T10:43:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a8d2ef8926b08b1e01615c624037b5bffa125f75","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/incuna/incuna-test-utils/pulls/20/commits","review_comments_url":"https://api.github.com/repos/incuna/incuna-test-utils/pulls/20/comments","review_comment_url":"https://api.github.com/repos/incuna/incuna-test-utils/pulls/comments/{number}","comments_url":"https://api.github.com/repos/incuna/incuna-test-utils/issues/20/comments","statuses_url":"https://api.github.com/repos/incuna/incuna-test-utils/statuses/d928bb1659f6ebb0d5a69c1a8d4c30ddac071761","head":{"label":"incuna:refactor-for-sense","ref":"refactor-for-sense","sha":"d928bb1659f6ebb0d5a69c1a8d4c30ddac071761","user":{"login":"incuna","id":55510,"avatar_url":"https://avatars.githubusercontent.com/u/55510?v=2","gravatar_id":"722bbd62ec6565c0236a20f9b6939ee1","url":"https://api.github.com/users/incuna","html_url":"https://github.com/incuna","followers_url":"https://api.github.com/users/incuna/followers","following_url":"https://api.github.com/users/incuna/following{/other_user}","gists_url":"https://api.github.com/users/incuna/gists{/gist_id}","starred_url":"https://api.github.com/users/incuna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/incuna/subscriptions","organizations_url":"https://api.github.com/users/incuna/orgs","repos_url":"https://api.github.com/users/incuna/repos","events_url":"https://api.github.com/users/incuna/events{/privacy}","received_events_url":"https://api.github.com/users/incuna/received_events","type":"Organization","site_admin":false},"repo":{"id":15281429,"name":"incuna-test-utils","full_name":"incuna/incuna-test-utils","owner":{"login":"incuna","id":55510,"avatar_url":"https://avatars.githubusercontent.com/u/55510?v=2","gravatar_id":"722bbd62ec6565c0236a20f9b6939ee1","url":"https://api.github.com/users/incuna","html_url":"https://github.com/incuna","followers_url":"https://api.github.com/users/incuna/followers","following_url":"https://api.github.com/users/incuna/following{/other_user}","gists_url":"https://api.github.com/users/incuna/gists{/gist_id}","starred_url":"https://api.github.com/users/incuna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/incuna/subscriptions","organizations_url":"https://api.github.com/users/incuna/orgs","repos_url":"https://api.github.com/users/incuna/repos","events_url":"https://api.github.com/users/incuna/events{/privacy}","received_events_url":"https://api.github.com/users/incuna/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/incuna/incuna-test-utils","description":"","fork":false,"url":"https://api.github.com/repos/incuna/incuna-test-utils","forks_url":"https://api.github.com/repos/incuna/incuna-test-utils/forks","keys_url":"https://api.github.com/repos/incuna/incuna-test-utils/keys{/key_id}","collaborators_url":"https://api.github.com/repos/incuna/incuna-test-utils/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/incuna/incuna-test-utils/teams","hooks_url":"https://api.github.com/repos/incuna/incuna-test-utils/hooks","issue_events_url":"https://api.github.com/repos/incuna/incuna-test-utils/issues/events{/number}","events_url":"https://api.github.com/repos/incuna/incuna-test-utils/events","assignees_url":"https://api.github.com/repos/incuna/incuna-test-utils/assignees{/user}","branches_url":"https://api.github.com/repos/incuna/incuna-test-utils/branches{/branch}","tags_url":"https://api.github.com/repos/incuna/incuna-test-utils/tags","blobs_url":"https://api.github.com/repos/incuna/incuna-test-utils/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/incuna/incuna-test-utils/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/incuna/incuna-test-utils/git/refs{/sha}","trees_url":"https://api.github.com/repos/incuna/incuna-test-utils/git/trees{/sha}","statuses_url":"https://api.github.com/repos/incuna/incuna-test-utils/statuses/{sha}","languages_url":"https://api.github.com/repos/incuna/incuna-test-utils/languages","stargazers_url":"https://api.github.com/repos/incuna/incuna-test-utils/stargazers","contributors_url":"https://api.github.com/repos/incuna/incuna-test-utils/contributors","subscribers_url":"https://api.github.com/repos/incuna/incuna-test-utils/subscribers","subscription_url":"https://api.github.com/repos/incuna/incuna-test-utils/subscription","commits_url":"https://api.github.com/repos/incuna/incuna-test-utils/commits{/sha}","git_commits_url":"https://api.github.com/repos/incuna/incuna-test-utils/git/commits{/sha}","comments_url":"https://api.github.com/repos/incuna/incuna-test-utils/comments{/number}","issue_comment_url":"https://api.github.com/repos/incuna/incuna-test-utils/issues/comments/{number}","contents_url":"https://api.github.com/repos/incuna/incuna-test-utils/contents/{+path}","compare_url":"https://api.github.com/repos/incuna/incuna-test-utils/compare/{base}...{head}","merges_url":"https://api.github.com/repos/incuna/incuna-test-utils/merges","archive_url":"https://api.github.com/repos/incuna/incuna-test-utils/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/incuna/incuna-test-utils/downloads","issues_url":"https://api.github.com/repos/incuna/incuna-test-utils/issues{/number}","pulls_url":"https://api.github.com/repos/incuna/incuna-test-utils/pulls{/number}","milestones_url":"https://api.github.com/repos/incuna/incuna-test-utils/milestones{/number}","notifications_url":"https://api.github.com/repos/incuna/incuna-test-utils/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/incuna/incuna-test-utils/labels{/name}","releases_url":"https://api.github.com/repos/incuna/incuna-test-utils/releases{/id}","created_at":"2013-12-18T11:30:35Z","updated_at":"2014-09-02T11:39:35Z","pushed_at":"2014-09-03T10:43:27Z","git_url":"git://github.com/incuna/incuna-test-utils.git","ssh_url":"git@github.com:incuna/incuna-test-utils.git","clone_url":"https://github.com/incuna/incuna-test-utils.git","svn_url":"https://github.com/incuna/incuna-test-utils","homepage":null,"size":816,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"incuna:master","ref":"master","sha":"49ccc356f00fc4ff0e6f3333fe2b718cc6a2f774","user":{"login":"incuna","id":55510,"avatar_url":"https://avatars.githubusercontent.com/u/55510?v=2","gravatar_id":"722bbd62ec6565c0236a20f9b6939ee1","url":"https://api.github.com/users/incuna","html_url":"https://github.com/incuna","followers_url":"https://api.github.com/users/incuna/followers","following_url":"https://api.github.com/users/incuna/following{/other_user}","gists_url":"https://api.github.com/users/incuna/gists{/gist_id}","starred_url":"https://api.github.com/users/incuna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/incuna/subscriptions","organizations_url":"https://api.github.com/users/incuna/orgs","repos_url":"https://api.github.com/users/incuna/repos","events_url":"https://api.github.com/users/incuna/events{/privacy}","received_events_url":"https://api.github.com/users/incuna/received_events","type":"Organization","site_admin":false},"repo":{"id":15281429,"name":"incuna-test-utils","full_name":"incuna/incuna-test-utils","owner":{"login":"incuna","id":55510,"avatar_url":"https://avatars.githubusercontent.com/u/55510?v=2","gravatar_id":"722bbd62ec6565c0236a20f9b6939ee1","url":"https://api.github.com/users/incuna","html_url":"https://github.com/incuna","followers_url":"https://api.github.com/users/incuna/followers","following_url":"https://api.github.com/users/incuna/following{/other_user}","gists_url":"https://api.github.com/users/incuna/gists{/gist_id}","starred_url":"https://api.github.com/users/incuna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/incuna/subscriptions","organizations_url":"https://api.github.com/users/incuna/orgs","repos_url":"https://api.github.com/users/incuna/repos","events_url":"https://api.github.com/users/incuna/events{/privacy}","received_events_url":"https://api.github.com/users/incuna/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/incuna/incuna-test-utils","description":"","fork":false,"url":"https://api.github.com/repos/incuna/incuna-test-utils","forks_url":"https://api.github.com/repos/incuna/incuna-test-utils/forks","keys_url":"https://api.github.com/repos/incuna/incuna-test-utils/keys{/key_id}","collaborators_url":"https://api.github.com/repos/incuna/incuna-test-utils/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/incuna/incuna-test-utils/teams","hooks_url":"https://api.github.com/repos/incuna/incuna-test-utils/hooks","issue_events_url":"https://api.github.com/repos/incuna/incuna-test-utils/issues/events{/number}","events_url":"https://api.github.com/repos/incuna/incuna-test-utils/events","assignees_url":"https://api.github.com/repos/incuna/incuna-test-utils/assignees{/user}","branches_url":"https://api.github.com/repos/incuna/incuna-test-utils/branches{/branch}","tags_url":"https://api.github.com/repos/incuna/incuna-test-utils/tags","blobs_url":"https://api.github.com/repos/incuna/incuna-test-utils/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/incuna/incuna-test-utils/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/incuna/incuna-test-utils/git/refs{/sha}","trees_url":"https://api.github.com/repos/incuna/incuna-test-utils/git/trees{/sha}","statuses_url":"https://api.github.com/repos/incuna/incuna-test-utils/statuses/{sha}","languages_url":"https://api.github.com/repos/incuna/incuna-test-utils/languages","stargazers_url":"https://api.github.com/repos/incuna/incuna-test-utils/stargazers","contributors_url":"https://api.github.com/repos/incuna/incuna-test-utils/contributors","subscribers_url":"https://api.github.com/repos/incuna/incuna-test-utils/subscribers","subscription_url":"https://api.github.com/repos/incuna/incuna-test-utils/subscription","commits_url":"https://api.github.com/repos/incuna/incuna-test-utils/commits{/sha}","git_commits_url":"https://api.github.com/repos/incuna/incuna-test-utils/git/commits{/sha}","comments_url":"https://api.github.com/repos/incuna/incuna-test-utils/comments{/number}","issue_comment_url":"https://api.github.com/repos/incuna/incuna-test-utils/issues/comments/{number}","contents_url":"https://api.github.com/repos/incuna/incuna-test-utils/contents/{+path}","compare_url":"https://api.github.com/repos/incuna/incuna-test-utils/compare/{base}...{head}","merges_url":"https://api.github.com/repos/incuna/incuna-test-utils/merges","archive_url":"https://api.github.com/repos/incuna/incuna-test-utils/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/incuna/incuna-test-utils/downloads","issues_url":"https://api.github.com/repos/incuna/incuna-test-utils/issues{/number}","pulls_url":"https://api.github.com/repos/incuna/incuna-test-utils/pulls{/number}","milestones_url":"https://api.github.com/repos/incuna/incuna-test-utils/milestones{/number}","notifications_url":"https://api.github.com/repos/incuna/incuna-test-utils/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/incuna/incuna-test-utils/labels{/name}","releases_url":"https://api.github.com/repos/incuna/incuna-test-utils/releases{/id}","created_at":"2013-12-18T11:30:35Z","updated_at":"2014-09-02T11:39:35Z","pushed_at":"2014-09-03T10:43:27Z","git_url":"git://github.com/incuna/incuna-test-utils.git","ssh_url":"git@github.com:incuna/incuna-test-utils.git","clone_url":"https://github.com/incuna/incuna-test-utils.git","svn_url":"https://github.com/incuna/incuna-test-utils","homepage":null,"size":816,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/incuna/incuna-test-utils/pulls/20"},"html":{"href":"https://github.com/incuna/incuna-test-utils/pull/20"},"issue":{"href":"https://api.github.com/repos/incuna/incuna-test-utils/issues/20"},"comments":{"href":"https://api.github.com/repos/incuna/incuna-test-utils/issues/20/comments"},"review_comments":{"href":"https://api.github.com/repos/incuna/incuna-test-utils/pulls/20/comments"},"review_comment":{"href":"https://api.github.com/repos/incuna/incuna-test-utils/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/incuna/incuna-test-utils/pulls/20/commits"},"statuses":{"href":"https://api.github.com/repos/incuna/incuna-test-utils/statuses/d928bb1659f6ebb0d5a69c1a8d4c30ddac071761"}}}}