{"action":"created","comment":{"url":"https://api.github.com/repos/alphagov/stagecraft/pulls/comments/34051117","id":34051117,"diff_hunk":"@@ -69,6 +72,31 @@ def test_saving_with_new_name_doesnt_change_it(self):\n         data_sets = DataSet.objects.filter(name='data_group1_data_type1')\n         assert_equal(len(data_sets), 1)\n \n+    def test_can_create_dataset_with_owner(self):\n+        DataSet.objects.create(\n+            data_group=self.data_group1,\n+            data_type=self.data_type1)\n+        data_set1 = DataSet.objects.get(name='data_group1_data_type1')\n+        user, _ = User.objects.get_or_create(\n+            email='foobar.lastname@gov.uk')\n+        data_set1.save()\n+        data_set1.owners.add(user)\n+\n+        assert_equal('foobar.lastname@gov.uk', data_set1.owners.first().email)\n+\n+    def test_can_create_dataset_without_owner(self):\n+        DataSet.objects.create(\n+            data_group=self.data_group1,\n+            data_type=self.data_type1)\n+        data_set1 = DataSet.objects.get(name='data_group1_data_type1')\n+        data_set1.save()\n+\n+        assert_equal(len(data_set1.owners.all()), 0)\n+\n+    def test_can_create_dataset_without_owner_in_forms(self):","path":"stagecraft/apps/datasets/tests/models/test_data_set.py","position":33,"original_position":42,"commit_id":"75e37cdeddb8ae7e5c495c6d55f85b723477ef0c","original_commit_id":"84bfa8eeb1bde14f353511e8ed2bb947ab524539","user":{"login":"timmow","id":10064,"avatar_url":"https://avatars.githubusercontent.com/u/10064?v=3","gravatar_id":"","url":"https://api.github.com/users/timmow","html_url":"https://github.com/timmow","followers_url":"https://api.github.com/users/timmow/followers","following_url":"https://api.github.com/users/timmow/following{/other_user}","gists_url":"https://api.github.com/users/timmow/gists{/gist_id}","starred_url":"https://api.github.com/users/timmow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timmow/subscriptions","organizations_url":"https://api.github.com/users/timmow/orgs","repos_url":"https://api.github.com/users/timmow/repos","events_url":"https://api.github.com/users/timmow/events{/privacy}","received_events_url":"https://api.github.com/users/timmow/received_events","type":"User","site_admin":false},"body":"It seems like we may be testing some core django behaviour here - if the model definition has blank for a field, then we would expect this parameter to be true - there may not be value in testing the way django is behaving","created_at":"2015-07-07T15:13:59Z","updated_at":"2015-07-07T15:13:59Z","html_url":"https://github.com/alphagov/stagecraft/pull/385#discussion_r34051117","pull_request_url":"https://api.github.com/repos/alphagov/stagecraft/pulls/385","_links":{"self":{"href":"https://api.github.com/repos/alphagov/stagecraft/pulls/comments/34051117"},"html":{"href":"https://github.com/alphagov/stagecraft/pull/385#discussion_r34051117"},"pull_request":{"href":"https://api.github.com/repos/alphagov/stagecraft/pulls/385"}}},"pull_request":{"url":"https://api.github.com/repos/alphagov/stagecraft/pulls/385","id":39378179,"html_url":"https://github.com/alphagov/stagecraft/pull/385","diff_url":"https://github.com/alphagov/stagecraft/pull/385.diff","patch_url":"https://github.com/alphagov/stagecraft/pull/385.patch","issue_url":"https://api.github.com/repos/alphagov/stagecraft/issues/385","number":385,"state":"open","locked":false,"title":"Add ability to create datasets and transforms without users.","user":{"login":"carolinegreen","id":11633362,"avatar_url":"https://avatars.githubusercontent.com/u/11633362?v=3","gravatar_id":"","url":"https://api.github.com/users/carolinegreen","html_url":"https://github.com/carolinegreen","followers_url":"https://api.github.com/users/carolinegreen/followers","following_url":"https://api.github.com/users/carolinegreen/following{/other_user}","gists_url":"https://api.github.com/users/carolinegreen/gists{/gist_id}","starred_url":"https://api.github.com/users/carolinegreen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carolinegreen/subscriptions","organizations_url":"https://api.github.com/users/carolinegreen/orgs","repos_url":"https://api.github.com/users/carolinegreen/repos","events_url":"https://api.github.com/users/carolinegreen/events{/privacy}","received_events_url":"https://api.github.com/users/carolinegreen/received_events","type":"User","site_admin":false},"body":"Add ability to create datasets and transforms without owners in django admin and forms in general by setting owners field blank property.\r\nAlso add tests for this.","created_at":"2015-07-07T14:47:33Z","updated_at":"2015-07-07T15:13:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ca70291587def0d767e8d6ee11be97f0a6347f52","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/alphagov/stagecraft/pulls/385/commits","review_comments_url":"https://api.github.com/repos/alphagov/stagecraft/pulls/385/comments","review_comment_url":"https://api.github.com/repos/alphagov/stagecraft/pulls/comments{/number}","comments_url":"https://api.github.com/repos/alphagov/stagecraft/issues/385/comments","statuses_url":"https://api.github.com/repos/alphagov/stagecraft/statuses/75e37cdeddb8ae7e5c495c6d55f85b723477ef0c","head":{"label":"alphagov:bug/owner-required-in-admin","ref":"bug/owner-required-in-admin","sha":"75e37cdeddb8ae7e5c495c6d55f85b723477ef0c","user":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"repo":{"id":13295877,"name":"stagecraft","full_name":"alphagov/stagecraft","owner":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alphagov/stagecraft","description":"A configuration service for the Performance Platform","fork":false,"url":"https://api.github.com/repos/alphagov/stagecraft","forks_url":"https://api.github.com/repos/alphagov/stagecraft/forks","keys_url":"https://api.github.com/repos/alphagov/stagecraft/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/stagecraft/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/stagecraft/teams","hooks_url":"https://api.github.com/repos/alphagov/stagecraft/hooks","issue_events_url":"https://api.github.com/repos/alphagov/stagecraft/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/stagecraft/events","assignees_url":"https://api.github.com/repos/alphagov/stagecraft/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/stagecraft/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/stagecraft/tags","blobs_url":"https://api.github.com/repos/alphagov/stagecraft/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/stagecraft/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/stagecraft/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/stagecraft/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/stagecraft/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/stagecraft/languages","stargazers_url":"https://api.github.com/repos/alphagov/stagecraft/stargazers","contributors_url":"https://api.github.com/repos/alphagov/stagecraft/contributors","subscribers_url":"https://api.github.com/repos/alphagov/stagecraft/subscribers","subscription_url":"https://api.github.com/repos/alphagov/stagecraft/subscription","commits_url":"https://api.github.com/repos/alphagov/stagecraft/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/stagecraft/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/stagecraft/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/stagecraft/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/stagecraft/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/stagecraft/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/stagecraft/merges","archive_url":"https://api.github.com/repos/alphagov/stagecraft/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/stagecraft/downloads","issues_url":"https://api.github.com/repos/alphagov/stagecraft/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/stagecraft/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/stagecraft/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/stagecraft/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/stagecraft/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/stagecraft/releases{/id}","created_at":"2013-10-03T11:08:32Z","updated_at":"2015-05-05T13:06:09Z","pushed_at":"2015-07-07T15:12:13Z","git_url":"git://github.com/alphagov/stagecraft.git","ssh_url":"git@github.com:alphagov/stagecraft.git","clone_url":"https://github.com/alphagov/stagecraft.git","svn_url":"https://github.com/alphagov/stagecraft","homepage":"","size":7468,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":4,"forks":4,"open_issues":4,"watchers":2,"default_branch":"master"}},"base":{"label":"alphagov:master","ref":"master","sha":"ce6a0909917b8cd1672582c175ccb21e45a4bb8b","user":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"repo":{"id":13295877,"name":"stagecraft","full_name":"alphagov/stagecraft","owner":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alphagov/stagecraft","description":"A configuration service for the Performance Platform","fork":false,"url":"https://api.github.com/repos/alphagov/stagecraft","forks_url":"https://api.github.com/repos/alphagov/stagecraft/forks","keys_url":"https://api.github.com/repos/alphagov/stagecraft/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/stagecraft/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/stagecraft/teams","hooks_url":"https://api.github.com/repos/alphagov/stagecraft/hooks","issue_events_url":"https://api.github.com/repos/alphagov/stagecraft/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/stagecraft/events","assignees_url":"https://api.github.com/repos/alphagov/stagecraft/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/stagecraft/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/stagecraft/tags","blobs_url":"https://api.github.com/repos/alphagov/stagecraft/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/stagecraft/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/stagecraft/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/stagecraft/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/stagecraft/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/stagecraft/languages","stargazers_url":"https://api.github.com/repos/alphagov/stagecraft/stargazers","contributors_url":"https://api.github.com/repos/alphagov/stagecraft/contributors","subscribers_url":"https://api.github.com/repos/alphagov/stagecraft/subscribers","subscription_url":"https://api.github.com/repos/alphagov/stagecraft/subscription","commits_url":"https://api.github.com/repos/alphagov/stagecraft/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/stagecraft/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/stagecraft/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/stagecraft/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/stagecraft/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/stagecraft/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/stagecraft/merges","archive_url":"https://api.github.com/repos/alphagov/stagecraft/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/stagecraft/downloads","issues_url":"https://api.github.com/repos/alphagov/stagecraft/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/stagecraft/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/stagecraft/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/stagecraft/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/stagecraft/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/stagecraft/releases{/id}","created_at":"2013-10-03T11:08:32Z","updated_at":"2015-05-05T13:06:09Z","pushed_at":"2015-07-07T15:12:13Z","git_url":"git://github.com/alphagov/stagecraft.git","ssh_url":"git@github.com:alphagov/stagecraft.git","clone_url":"https://github.com/alphagov/stagecraft.git","svn_url":"https://github.com/alphagov/stagecraft","homepage":"","size":7468,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":4,"forks":4,"open_issues":4,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/alphagov/stagecraft/pulls/385"},"html":{"href":"https://github.com/alphagov/stagecraft/pull/385"},"issue":{"href":"https://api.github.com/repos/alphagov/stagecraft/issues/385"},"comments":{"href":"https://api.github.com/repos/alphagov/stagecraft/issues/385/comments"},"review_comments":{"href":"https://api.github.com/repos/alphagov/stagecraft/pulls/385/comments"},"review_comment":{"href":"https://api.github.com/repos/alphagov/stagecraft/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/alphagov/stagecraft/pulls/385/commits"},"statuses":{"href":"https://api.github.com/repos/alphagov/stagecraft/statuses/75e37cdeddb8ae7e5c495c6d55f85b723477ef0c"}}}}