GitHub PullRequestReviewCommentEvent at 2014-10-07 19:21:41
Repository: django
Actor: loic
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/django/django/pulls/comments/18542351","id":18542351,"diff_hunk":"@@ -239,6 +239,49 @@ def test_error_contains_full_traceback(self):\n             formatted_traceback = traceback.format_exc()\n             self.assertIn('obj.save', formatted_traceback)\n \n+    def test_create_with_related_manager(self):\n+        \"\"\"\n+        Should be able to use update_or_create from the related_manager to\n+        create a book. Refs #23611.\n+        \"\"\"\n+        p = Publisher.objects.create(name=\"Acme Publishing\")\n+        book, created = p.books.update_or_create(name=\"The Book of Ed & Fred\")\n+        self.assertTrue(created)\n+        self.assertEqual(p.books.count(), 1)\n+\n+    def test_update_with_related_manager(self):\n+        p = Publisher.objects.create(name=\"Acme Publishing\")\n+        book = Book.objects.create(name=\"The Book of Ed & Fred\", publisher=p)\n+        self.assertEqual(p.books.count(), 1)\n+        name = \"The Book of Django\"\n+        book, created = p.books.update_or_create(defaults={'name': name},\n+                                                 id=book.id)","path":"tests/get_or_create/tests.py","position":29,"original_position":29,"commit_id":"cb841c48ffdcfb19bdc3044f046070d566728fbf","original_commit_id":"cb841c48ffdcfb19bdc3044f046070d566728fbf","user":{"login":"loic","id":36160,"avatar_url":"https://avatars.githubusercontent.com/u/36160?v=2","gravatar_id":"","url":"https://api.github.com/users/loic","html_url":"https://github.com/loic","followers_url":"https://api.github.com/users/loic/followers","following_url":"https://api.github.com/users/loic/following{/other_user}","gists_url":"https://api.github.com/users/loic/gists{/gist_id}","starred_url":"https://api.github.com/users/loic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loic/subscriptions","organizations_url":"https://api.github.com/users/loic/orgs","repos_url":"https://api.github.com/users/loic/repos","events_url":"https://api.github.com/users/loic/events{/privacy}","received_events_url":"https://api.github.com/users/loic/received_events","type":"User","site_admin":false},"body":"Unnecessary wrapping.","created_at":"2014-10-07T19:21:41Z","updated_at":"2014-10-07T19:21:41Z","html_url":"https://github.com/django/django/pull/3321#discussion_r18542351","pull_request_url":"https://api.github.com/repos/django/django/pulls/3321","_links":{"self":{"href":"https://api.github.com/repos/django/django/pulls/comments/18542351"},"html":{"href":"https://github.com/django/django/pull/3321#discussion_r18542351"},"pull_request":{"href":"https://api.github.com/repos/django/django/pulls/3321"}}},"pull_request":{"url":"https://api.github.com/repos/django/django/pulls/3321","id":22336122,"html_url":"https://github.com/django/django/pull/3321","diff_url":"https://github.com/django/django/pull/3321.diff","patch_url":"https://github.com/django/django/pull/3321.patch","issue_url":"https://api.github.com/repos/django/django/issues/3321","number":3321,"state":"open","locked":false,"title":"Fixed #23611 -- update_or_create failing from a related manager","user":{"login":"aericson","id":692542,"avatar_url":"https://avatars.githubusercontent.com/u/692542?v=2","gravatar_id":"","url":"https://api.github.com/users/aericson","html_url":"https://github.com/aericson","followers_url":"https://api.github.com/users/aericson/followers","following_url":"https://api.github.com/users/aericson/following{/other_user}","gists_url":"https://api.github.com/users/aericson/gists{/gist_id}","starred_url":"https://api.github.com/users/aericson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aericson/subscriptions","organizations_url":"https://api.github.com/users/aericson/orgs","repos_url":"https://api.github.com/users/aericson/repos","events_url":"https://api.github.com/users/aericson/events{/privacy}","received_events_url":"https://api.github.com/users/aericson/received_events","type":"User","site_admin":false},"body":"update_or_create from the RelatedManager would cause an IntegrityError\r\nsince the instance was missing in the kwargs.","created_at":"2014-10-07T08:01:50Z","updated_at":"2014-10-07T19:21:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"74e42f2ac9bb026ba710e87131e255d0caad69b9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/django/django/pulls/3321/commits","review_comments_url":"https://api.github.com/repos/django/django/pulls/3321/comments","review_comment_url":"https://api.github.com/repos/django/django/pulls/comments/{number}","comments_url":"https://api.github.com/repos/django/django/issues/3321/comments","statuses_url":"https://api.github.com/repos/django/django/statuses/cb841c48ffdcfb19bdc3044f046070d566728fbf","head":{"label":"aericson:ticket_23611","ref":"ticket_23611","sha":"cb841c48ffdcfb19bdc3044f046070d566728fbf","user":{"login":"aericson","id":692542,"avatar_url":"https://avatars.githubusercontent.com/u/692542?v=2","gravatar_id":"","url":"https://api.github.com/users/aericson","html_url":"https://github.com/aericson","followers_url":"https://api.github.com/users/aericson/followers","following_url":"https://api.github.com/users/aericson/following{/other_user}","gists_url":"https://api.github.com/users/aericson/gists{/gist_id}","starred_url":"https://api.github.com/users/aericson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aericson/subscriptions","organizations_url":"https://api.github.com/users/aericson/orgs","repos_url":"https://api.github.com/users/aericson/repos","events_url":"https://api.github.com/users/aericson/events{/privacy}","received_events_url":"https://api.github.com/users/aericson/received_events","type":"User","site_admin":false},"repo":{"id":24778061,"name":"django","full_name":"aericson/django","owner":{"login":"aericson","id":692542,"avatar_url":"https://avatars.githubusercontent.com/u/692542?v=2","gravatar_id":"","url":"https://api.github.com/users/aericson","html_url":"https://github.com/aericson","followers_url":"https://api.github.com/users/aericson/followers","following_url":"https://api.github.com/users/aericson/following{/other_user}","gists_url":"https://api.github.com/users/aericson/gists{/gist_id}","starred_url":"https://api.github.com/users/aericson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aericson/subscriptions","organizations_url":"https://api.github.com/users/aericson/orgs","repos_url":"https://api.github.com/users/aericson/repos","events_url":"https://api.github.com/users/aericson/events{/privacy}","received_events_url":"https://api.github.com/users/aericson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aericson/django","description":"The Web framework for perfectionists with deadlines.","fork":true,"url":"https://api.github.com/repos/aericson/django","forks_url":"https://api.github.com/repos/aericson/django/forks","keys_url":"https://api.github.com/repos/aericson/django/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aericson/django/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aericson/django/teams","hooks_url":"https://api.github.com/repos/aericson/django/hooks","issue_events_url":"https://api.github.com/repos/aericson/django/issues/events{/number}","events_url":"https://api.github.com/repos/aericson/django/events","assignees_url":"https://api.github.com/repos/aericson/django/assignees{/user}","branches_url":"https://api.github.com/repos/aericson/django/branches{/branch}","tags_url":"https://api.github.com/repos/aericson/django/tags","blobs_url":"https://api.github.com/repos/aericson/django/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aericson/django/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aericson/django/git/refs{/sha}","trees_url":"https://api.github.com/repos/aericson/django/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aericson/django/statuses/{sha}","languages_url":"https://api.github.com/repos/aericson/django/languages","stargazers_url":"https://api.github.com/repos/aericson/django/stargazers","contributors_url":"https://api.github.com/repos/aericson/django/contributors","subscribers_url":"https://api.github.com/repos/aericson/django/subscribers","subscription_url":"https://api.github.com/repos/aericson/django/subscription","commits_url":"https://api.github.com/repos/aericson/django/commits{/sha}","git_commits_url":"https://api.github.com/repos/aericson/django/git/commits{/sha}","comments_url":"https://api.github.com/repos/aericson/django/comments{/number}","issue_comment_url":"https://api.github.com/repos/aericson/django/issues/comments/{number}","contents_url":"https://api.github.com/repos/aericson/django/contents/{+path}","compare_url":"https://api.github.com/repos/aericson/django/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aericson/django/merges","archive_url":"https://api.github.com/repos/aericson/django/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aericson/django/downloads","issues_url":"https://api.github.com/repos/aericson/django/issues{/number}","pulls_url":"https://api.github.com/repos/aericson/django/pulls{/number}","milestones_url":"https://api.github.com/repos/aericson/django/milestones{/number}","notifications_url":"https://api.github.com/repos/aericson/django/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aericson/django/labels{/name}","releases_url":"https://api.github.com/repos/aericson/django/releases{/id}","created_at":"2014-10-04T00:37:20Z","updated_at":"2014-10-06T22:59:47Z","pushed_at":"2014-10-07T19:05:17Z","git_url":"git://github.com/aericson/django.git","ssh_url":"git@github.com:aericson/django.git","clone_url":"https://github.com/aericson/django.git","svn_url":"https://github.com/aericson/django","homepage":"https://www.djangoproject.com/","size":112945,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"django:master","ref":"master","sha":"c1ef234e310fb984ced37eac8c8b90f5b6155e5f","user":{"login":"django","id":27804,"avatar_url":"https://avatars.githubusercontent.com/u/27804?v=2","gravatar_id":"","url":"https://api.github.com/users/django","html_url":"https://github.com/django","followers_url":"https://api.github.com/users/django/followers","following_url":"https://api.github.com/users/django/following{/other_user}","gists_url":"https://api.github.com/users/django/gists{/gist_id}","starred_url":"https://api.github.com/users/django/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/django/subscriptions","organizations_url":"https://api.github.com/users/django/orgs","repos_url":"https://api.github.com/users/django/repos","events_url":"https://api.github.com/users/django/events{/privacy}","received_events_url":"https://api.github.com/users/django/received_events","type":"Organization","site_admin":false},"repo":{"id":4164482,"name":"django","full_name":"django/django","owner":{"login":"django","id":27804,"avatar_url":"https://avatars.githubusercontent.com/u/27804?v=2","gravatar_id":"","url":"https://api.github.com/users/django","html_url":"https://github.com/django","followers_url":"https://api.github.com/users/django/followers","following_url":"https://api.github.com/users/django/following{/other_user}","gists_url":"https://api.github.com/users/django/gists{/gist_id}","starred_url":"https://api.github.com/users/django/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/django/subscriptions","organizations_url":"https://api.github.com/users/django/orgs","repos_url":"https://api.github.com/users/django/repos","events_url":"https://api.github.com/users/django/events{/privacy}","received_events_url":"https://api.github.com/users/django/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/django/django","description":"The Web framework for perfectionists with deadlines.","fork":false,"url":"https://api.github.com/repos/django/django","forks_url":"https://api.github.com/repos/django/django/forks","keys_url":"https://api.github.com/repos/django/django/keys{/key_id}","collaborators_url":"https://api.github.com/repos/django/django/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/django/django/teams","hooks_url":"https://api.github.com/repos/django/django/hooks","issue_events_url":"https://api.github.com/repos/django/django/issues/events{/number}","events_url":"https://api.github.com/repos/django/django/events","assignees_url":"https://api.github.com/repos/django/django/assignees{/user}","branches_url":"https://api.github.com/repos/django/django/branches{/branch}","tags_url":"https://api.github.com/repos/django/django/tags","blobs_url":"https://api.github.com/repos/django/django/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/django/django/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/django/django/git/refs{/sha}","trees_url":"https://api.github.com/repos/django/django/git/trees{/sha}","statuses_url":"https://api.github.com/repos/django/django/statuses/{sha}","languages_url":"https://api.github.com/repos/django/django/languages","stargazers_url":"https://api.github.com/repos/django/django/stargazers","contributors_url":"https://api.github.com/repos/django/django/contributors","subscribers_url":"https://api.github.com/repos/django/django/subscribers","subscription_url":"https://api.github.com/repos/django/django/subscription","commits_url":"https://api.github.com/repos/django/django/commits{/sha}","git_commits_url":"https://api.github.com/repos/django/django/git/commits{/sha}","comments_url":"https://api.github.com/repos/django/django/comments{/number}","issue_comment_url":"https://api.github.com/repos/django/django/issues/comments/{number}","contents_url":"https://api.github.com/repos/django/django/contents/{+path}","compare_url":"https://api.github.com/repos/django/django/compare/{base}...{head}","merges_url":"https://api.github.com/repos/django/django/merges","archive_url":"https://api.github.com/repos/django/django/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/django/django/downloads","issues_url":"https://api.github.com/repos/django/django/issues{/number}","pulls_url":"https://api.github.com/repos/django/django/pulls{/number}","milestones_url":"https://api.github.com/repos/django/django/milestones{/number}","notifications_url":"https://api.github.com/repos/django/django/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/django/django/labels{/name}","releases_url":"https://api.github.com/repos/django/django/releases{/id}","created_at":"2012-04-28T02:47:18Z","updated_at":"2014-10-07T19:07:22Z","pushed_at":"2014-10-07T17:07:16Z","git_url":"git://github.com/django/django.git","ssh_url":"git@github.com:django/django.git","clone_url":"https://github.com/django/django.git","svn_url":"https://github.com/django/django","homepage":"https://www.djangoproject.com/","size":250412,"stargazers_count":11409,"watchers_count":11409,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4437,"mirror_url":null,"open_issues_count":97,"forks":4437,"open_issues":97,"watchers":11409,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/django/django/pulls/3321"},"html":{"href":"https://github.com/django/django/pull/3321"},"issue":{"href":"https://api.github.com/repos/django/django/issues/3321"},"comments":{"href":"https://api.github.com/repos/django/django/issues/3321/comments"},"review_comments":{"href":"https://api.github.com/repos/django/django/pulls/3321/comments"},"review_comment":{"href":"https://api.github.com/repos/django/django/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/django/django/pulls/3321/commits"},"statuses":{"href":"https://api.github.com/repos/django/django/statuses/cb841c48ffdcfb19bdc3044f046070d566728fbf"}}}}