{"action":"created","comment":{"url":"https://api.github.com/repos/hydroshare/hydroshare/pulls/comments/62193008","id":62193008,"diff_hunk":"@@ -0,0 +1,54 @@\n+from django.contrib.auth.models import Group\n+from django.test import TestCase\n+\n+from hs_core.hydroshare import resource\n+from hs_core.hydroshare import users\n+from hs_core.testing import MockIRODSTestCaseMixin\n+\n+\n+class TestHStore(MockIRODSTestCaseMixin, TestCase):\n+\n+    def setUp(self):\n+        super(TestHStore, self).setUp()\n+        self.group, _ = Group.objects.get_or_create(name='Hydroshare Author')\n+        # create a user\n+        self.user = users.create_account(\n+            'test_user@email.com',\n+            username='testuser',\n+            first_name='some_first_name',\n+            last_name='some_last_name',\n+            superuser=False,\n+            groups=[])\n+\n+        self.res = resource.create_resource(\n+            'GenericResource',\n+            self.user,\n+            'My Test Resource'\n+            )\n+\n+    def test_extra_metadata(self):\n+        # create/add extra metadata\n+        self.assertEquals(self.res.extra_metadata, {})\n+        self.res.extra_metadata = {'name': 'John Jackson'}\n+        self.res.save()\n+\n+        self.assertNotEquals(self.res.extra_metadata, {})\n+        self.assertEquals(self.res.extra_metadata['name'], 'John Jackson')","path":"hs_core/tests/api/native/test_hstore_extra_metadata.py","position":36,"original_position":36,"commit_id":"237dfd2ddc55ff20aeecd3231aaacbbd266cd5dd","original_commit_id":"9f95af50821a2facdc4c96ffe4ef8f93d910637f","user":{"login":"alvacouch","id":3342292,"avatar_url":"https://avatars.githubusercontent.com/u/3342292?v=3","gravatar_id":"","url":"https://api.github.com/users/alvacouch","html_url":"https://github.com/alvacouch","followers_url":"https://api.github.com/users/alvacouch/followers","following_url":"https://api.github.com/users/alvacouch/following{/other_user}","gists_url":"https://api.github.com/users/alvacouch/gists{/gist_id}","starred_url":"https://api.github.com/users/alvacouch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alvacouch/subscriptions","organizations_url":"https://api.github.com/users/alvacouch/orgs","repos_url":"https://api.github.com/users/alvacouch/repos","events_url":"https://api.github.com/users/alvacouch/events{/privacy}","received_events_url":"https://api.github.com/users/alvacouch/received_events","type":"User","site_admin":false},"body":"@hyi @pkdash I would prefer to leave such guards in. They give more detail. \r\n","created_at":"2016-05-05T14:19:29Z","updated_at":"2016-05-05T14:19:29Z","html_url":"https://github.com/hydroshare/hydroshare/pull/1177#discussion_r62193008","pull_request_url":"https://api.github.com/repos/hydroshare/hydroshare/pulls/1177","_links":{"self":{"href":"https://api.github.com/repos/hydroshare/hydroshare/pulls/comments/62193008"},"html":{"href":"https://github.com/hydroshare/hydroshare/pull/1177#discussion_r62193008"},"pull_request":{"href":"https://api.github.com/repos/hydroshare/hydroshare/pulls/1177"}}},"pull_request":{"url":"https://api.github.com/repos/hydroshare/hydroshare/pulls/1177","id":68309279,"html_url":"https://github.com/hydroshare/hydroshare/pull/1177","diff_url":"https://github.com/hydroshare/hydroshare/pull/1177.diff","patch_url":"https://github.com/hydroshare/hydroshare/pull/1177.patch","issue_url":"https://api.github.com/repos/hydroshare/hydroshare/issues/1177","number":1177,"state":"open","locked":false,"title":"Arbitrary key/value metadata ","user":{"login":"pkdash","id":2523434,"avatar_url":"https://avatars.githubusercontent.com/u/2523434?v=3","gravatar_id":"","url":"https://api.github.com/users/pkdash","html_url":"https://github.com/pkdash","followers_url":"https://api.github.com/users/pkdash/followers","following_url":"https://api.github.com/users/pkdash/following{/other_user}","gists_url":"https://api.github.com/users/pkdash/gists{/gist_id}","starred_url":"https://api.github.com/users/pkdash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pkdash/subscriptions","organizations_url":"https://api.github.com/users/pkdash/orgs","repos_url":"https://api.github.com/users/pkdash/repos","events_url":"https://api.github.com/users/pkdash/events{/privacy}","received_events_url":"https://api.github.com/users/pkdash/received_events","type":"User","site_admin":false},"body":"This is part of the core metadata - all resources types can add these key/value metadata.","created_at":"2016-04-29T00:02:31Z","updated_at":"2016-05-05T14:19:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"17f952266b89af6e7390e41c1acc7de6af40564d","assignee":{"login":"hyi","id":476302,"avatar_url":"https://avatars.githubusercontent.com/u/476302?v=3","gravatar_id":"","url":"https://api.github.com/users/hyi","html_url":"https://github.com/hyi","followers_url":"https://api.github.com/users/hyi/followers","following_url":"https://api.github.com/users/hyi/following{/other_user}","gists_url":"https://api.github.com/users/hyi/gists{/gist_id}","starred_url":"https://api.github.com/users/hyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyi/subscriptions","organizations_url":"https://api.github.com/users/hyi/orgs","repos_url":"https://api.github.com/users/hyi/repos","events_url":"https://api.github.com/users/hyi/events{/privacy}","received_events_url":"https://api.github.com/users/hyi/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/hydroshare/hydroshare/milestones/28","html_url":"https://github.com/hydroshare/hydroshare/milestones/Release%201.6.11","labels_url":"https://api.github.com/repos/hydroshare/hydroshare/milestones/28/labels","id":1726573,"number":28,"title":"Release 1.6.11","description":"Quality improvements","creator":{"login":"dtarb","id":3456833,"avatar_url":"https://avatars.githubusercontent.com/u/3456833?v=3","gravatar_id":"","url":"https://api.github.com/users/dtarb","html_url":"https://github.com/dtarb","followers_url":"https://api.github.com/users/dtarb/followers","following_url":"https://api.github.com/users/dtarb/following{/other_user}","gists_url":"https://api.github.com/users/dtarb/gists{/gist_id}","starred_url":"https://api.github.com/users/dtarb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dtarb/subscriptions","organizations_url":"https://api.github.com/users/dtarb/orgs","repos_url":"https://api.github.com/users/dtarb/repos","events_url":"https://api.github.com/users/dtarb/events{/privacy}","received_events_url":"https://api.github.com/users/dtarb/received_events","type":"User","site_admin":false},"open_issues":13,"closed_issues":7,"state":"open","created_at":"2016-04-23T12:26:34Z","updated_at":"2016-05-04T20:14:45Z","due_on":"2016-05-05T06:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/hydroshare/hydroshare/pulls/1177/commits","review_comments_url":"https://api.github.com/repos/hydroshare/hydroshare/pulls/1177/comments","review_comment_url":"https://api.github.com/repos/hydroshare/hydroshare/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hydroshare/hydroshare/issues/1177/comments","statuses_url":"https://api.github.com/repos/hydroshare/hydroshare/statuses/237dfd2ddc55ff20aeecd3231aaacbbd266cd5dd","head":{"label":"hydroshare:647-arbitrary-key-value-metadata","ref":"647-arbitrary-key-value-metadata","sha":"237dfd2ddc55ff20aeecd3231aaacbbd266cd5dd","user":{"login":"hydroshare","id":3444493,"avatar_url":"https://avatars.githubusercontent.com/u/3444493?v=3","gravatar_id":"","url":"https://api.github.com/users/hydroshare","html_url":"https://github.com/hydroshare","followers_url":"https://api.github.com/users/hydroshare/followers","following_url":"https://api.github.com/users/hydroshare/following{/other_user}","gists_url":"https://api.github.com/users/hydroshare/gists{/gist_id}","starred_url":"https://api.github.com/users/hydroshare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hydroshare/subscriptions","organizations_url":"https://api.github.com/users/hydroshare/orgs","repos_url":"https://api.github.com/users/hydroshare/repos","events_url":"https://api.github.com/users/hydroshare/events{/privacy}","received_events_url":"https://api.github.com/users/hydroshare/received_events","type":"Organization","site_admin":false},"repo":{"id":24703136,"name":"hydroshare","full_name":"hydroshare/hydroshare","owner":{"login":"hydroshare","id":3444493,"avatar_url":"https://avatars.githubusercontent.com/u/3444493?v=3","gravatar_id":"","url":"https://api.github.com/users/hydroshare","html_url":"https://github.com/hydroshare","followers_url":"https://api.github.com/users/hydroshare/followers","following_url":"https://api.github.com/users/hydroshare/following{/other_user}","gists_url":"https://api.github.com/users/hydroshare/gists{/gist_id}","starred_url":"https://api.github.com/users/hydroshare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hydroshare/subscriptions","organizations_url":"https://api.github.com/users/hydroshare/orgs","repos_url":"https://api.github.com/users/hydroshare/repos","events_url":"https://api.github.com/users/hydroshare/events{/privacy}","received_events_url":"https://api.github.com/users/hydroshare/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hydroshare/hydroshare","description":"HydroShare is a collaborative website being developed for better access to data and models in the hydrologic sciences. ","fork":false,"url":"https://api.github.com/repos/hydroshare/hydroshare","forks_url":"https://api.github.com/repos/hydroshare/hydroshare/forks","keys_url":"https://api.github.com/repos/hydroshare/hydroshare/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hydroshare/hydroshare/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hydroshare/hydroshare/teams","hooks_url":"https://api.github.com/repos/hydroshare/hydroshare/hooks","issue_events_url":"https://api.github.com/repos/hydroshare/hydroshare/issues/events{/number}","events_url":"https://api.github.com/repos/hydroshare/hydroshare/events","assignees_url":"https://api.github.com/repos/hydroshare/hydroshare/assignees{/user}","branches_url":"https://api.github.com/repos/hydroshare/hydroshare/branches{/branch}","tags_url":"https://api.github.com/repos/hydroshare/hydroshare/tags","blobs_url":"https://api.github.com/repos/hydroshare/hydroshare/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hydroshare/hydroshare/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hydroshare/hydroshare/git/refs{/sha}","trees_url":"https://api.github.com/repos/hydroshare/hydroshare/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hydroshare/hydroshare/statuses/{sha}","languages_url":"https://api.github.com/repos/hydroshare/hydroshare/languages","stargazers_url":"https://api.github.com/repos/hydroshare/hydroshare/stargazers","contributors_url":"https://api.github.com/repos/hydroshare/hydroshare/contributors","subscribers_url":"https://api.github.com/repos/hydroshare/hydroshare/subscribers","subscription_url":"https://api.github.com/repos/hydroshare/hydroshare/subscription","commits_url":"https://api.github.com/repos/hydroshare/hydroshare/commits{/sha}","git_commits_url":"https://api.github.com/repos/hydroshare/hydroshare/git/commits{/sha}","comments_url":"https://api.github.com/repos/hydroshare/hydroshare/comments{/number}","issue_comment_url":"https://api.github.com/repos/hydroshare/hydroshare/issues/comments{/number}","contents_url":"https://api.github.com/repos/hydroshare/hydroshare/contents/{+path}","compare_url":"https://api.github.com/repos/hydroshare/hydroshare/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hydroshare/hydroshare/merges","archive_url":"https://api.github.com/repos/hydroshare/hydroshare/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hydroshare/hydroshare/downloads","issues_url":"https://api.github.com/repos/hydroshare/hydroshare/issues{/number}","pulls_url":"https://api.github.com/repos/hydroshare/hydroshare/pulls{/number}","milestones_url":"https://api.github.com/repos/hydroshare/hydroshare/milestones{/number}","notifications_url":"https://api.github.com/repos/hydroshare/hydroshare/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hydroshare/hydroshare/labels{/name}","releases_url":"https://api.github.com/repos/hydroshare/hydroshare/releases{/id}","deployments_url":"https://api.github.com/repos/hydroshare/hydroshare/deployments","created_at":"2014-10-02T02:19:41Z","updated_at":"2016-04-28T19:52:20Z","pushed_at":"2016-05-05T06:12:46Z","git_url":"git://github.com/hydroshare/hydroshare.git","ssh_url":"git@github.com:hydroshare/hydroshare.git","clone_url":"https://github.com/hydroshare/hydroshare.git","svn_url":"https://github.com/hydroshare/hydroshare","homepage":"https://www.hydroshare.org","size":84930,"stargazers_count":13,"watchers_count":13,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":236,"forks":2,"open_issues":236,"watchers":13,"default_branch":"develop"}},"base":{"label":"hydroshare:develop","ref":"develop","sha":"913ff0dd474be5abcea263ec6b0419ebc3812848","user":{"login":"hydroshare","id":3444493,"avatar_url":"https://avatars.githubusercontent.com/u/3444493?v=3","gravatar_id":"","url":"https://api.github.com/users/hydroshare","html_url":"https://github.com/hydroshare","followers_url":"https://api.github.com/users/hydroshare/followers","following_url":"https://api.github.com/users/hydroshare/following{/other_user}","gists_url":"https://api.github.com/users/hydroshare/gists{/gist_id}","starred_url":"https://api.github.com/users/hydroshare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hydroshare/subscriptions","organizations_url":"https://api.github.com/users/hydroshare/orgs","repos_url":"https://api.github.com/users/hydroshare/repos","events_url":"https://api.github.com/users/hydroshare/events{/privacy}","received_events_url":"https://api.github.com/users/hydroshare/received_events","type":"Organization","site_admin":false},"repo":{"id":24703136,"name":"hydroshare","full_name":"hydroshare/hydroshare","owner":{"login":"hydroshare","id":3444493,"avatar_url":"https://avatars.githubusercontent.com/u/3444493?v=3","gravatar_id":"","url":"https://api.github.com/users/hydroshare","html_url":"https://github.com/hydroshare","followers_url":"https://api.github.com/users/hydroshare/followers","following_url":"https://api.github.com/users/hydroshare/following{/other_user}","gists_url":"https://api.github.com/users/hydroshare/gists{/gist_id}","starred_url":"https://api.github.com/users/hydroshare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hydroshare/subscriptions","organizations_url":"https://api.github.com/users/hydroshare/orgs","repos_url":"https://api.github.com/users/hydroshare/repos","events_url":"https://api.github.com/users/hydroshare/events{/privacy}","received_events_url":"https://api.github.com/users/hydroshare/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hydroshare/hydroshare","description":"HydroShare is a collaborative website being developed for better access to data and models in the hydrologic sciences. ","fork":false,"url":"https://api.github.com/repos/hydroshare/hydroshare","forks_url":"https://api.github.com/repos/hydroshare/hydroshare/forks","keys_url":"https://api.github.com/repos/hydroshare/hydroshare/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hydroshare/hydroshare/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hydroshare/hydroshare/teams","hooks_url":"https://api.github.com/repos/hydroshare/hydroshare/hooks","issue_events_url":"https://api.github.com/repos/hydroshare/hydroshare/issues/events{/number}","events_url":"https://api.github.com/repos/hydroshare/hydroshare/events","assignees_url":"https://api.github.com/repos/hydroshare/hydroshare/assignees{/user}","branches_url":"https://api.github.com/repos/hydroshare/hydroshare/branches{/branch}","tags_url":"https://api.github.com/repos/hydroshare/hydroshare/tags","blobs_url":"https://api.github.com/repos/hydroshare/hydroshare/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hydroshare/hydroshare/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hydroshare/hydroshare/git/refs{/sha}","trees_url":"https://api.github.com/repos/hydroshare/hydroshare/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hydroshare/hydroshare/statuses/{sha}","languages_url":"https://api.github.com/repos/hydroshare/hydroshare/languages","stargazers_url":"https://api.github.com/repos/hydroshare/hydroshare/stargazers","contributors_url":"https://api.github.com/repos/hydroshare/hydroshare/contributors","subscribers_url":"https://api.github.com/repos/hydroshare/hydroshare/subscribers","subscription_url":"https://api.github.com/repos/hydroshare/hydroshare/subscription","commits_url":"https://api.github.com/repos/hydroshare/hydroshare/commits{/sha}","git_commits_url":"https://api.github.com/repos/hydroshare/hydroshare/git/commits{/sha}","comments_url":"https://api.github.com/repos/hydroshare/hydroshare/comments{/number}","issue_comment_url":"https://api.github.com/repos/hydroshare/hydroshare/issues/comments{/number}","contents_url":"https://api.github.com/repos/hydroshare/hydroshare/contents/{+path}","compare_url":"https://api.github.com/repos/hydroshare/hydroshare/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hydroshare/hydroshare/merges","archive_url":"https://api.github.com/repos/hydroshare/hydroshare/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hydroshare/hydroshare/downloads","issues_url":"https://api.github.com/repos/hydroshare/hydroshare/issues{/number}","pulls_url":"https://api.github.com/repos/hydroshare/hydroshare/pulls{/number}","milestones_url":"https://api.github.com/repos/hydroshare/hydroshare/milestones{/number}","notifications_url":"https://api.github.com/repos/hydroshare/hydroshare/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hydroshare/hydroshare/labels{/name}","releases_url":"https://api.github.com/repos/hydroshare/hydroshare/releases{/id}","deployments_url":"https://api.github.com/repos/hydroshare/hydroshare/deployments","created_at":"2014-10-02T02:19:41Z","updated_at":"2016-04-28T19:52:20Z","pushed_at":"2016-05-05T06:12:46Z","git_url":"git://github.com/hydroshare/hydroshare.git","ssh_url":"git@github.com:hydroshare/hydroshare.git","clone_url":"https://github.com/hydroshare/hydroshare.git","svn_url":"https://github.com/hydroshare/hydroshare","homepage":"https://www.hydroshare.org","size":84930,"stargazers_count":13,"watchers_count":13,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":236,"forks":2,"open_issues":236,"watchers":13,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/hydroshare/hydroshare/pulls/1177"},"html":{"href":"https://github.com/hydroshare/hydroshare/pull/1177"},"issue":{"href":"https://api.github.com/repos/hydroshare/hydroshare/issues/1177"},"comments":{"href":"https://api.github.com/repos/hydroshare/hydroshare/issues/1177/comments"},"review_comments":{"href":"https://api.github.com/repos/hydroshare/hydroshare/pulls/1177/comments"},"review_comment":{"href":"https://api.github.com/repos/hydroshare/hydroshare/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hydroshare/hydroshare/pulls/1177/commits"},"statuses":{"href":"https://api.github.com/repos/hydroshare/hydroshare/statuses/237dfd2ddc55ff20aeecd3231aaacbbd266cd5dd"}}}}