{"action":"created","comment":{"url":"https://api.github.com/repos/edx/XBlock/pulls/comments/33460582","id":33460582,"diff_hunk":"@@ -163,12 +163,26 @@ def test_delete_with_save_writes(self):\n         assert_false(self.field_data.has(self.block, 'field'))\n         assert_true(self.is_default())\n \n-    def test_set_after_get_always_saves(self):\n+    def test_set_after_get_always_force_saves(self):\n         with patch.object(self.field_data, 'set_many') as patched_set_many:\n             self.set(self.get())\n-            self.block.save()\n \n-            patched_set_many.assert_called_with(self.block, {'field': self.get()})\n+            self.block.force_save_fields(['field'])\n+\n+            patched_set_many.assert_called_with(\n+                self.block, {'field': self.get()}\n+            )\n+\n+    def test_set_after_get_doesnt_save(self):\n+        self.set(self.get())\n+        # pylint: disable=protected-access\n+        fields_to_save = self.block._get_fields_to_save()\n+        assert_equals(len(fields_to_save), 0)\n+\n+        self.set(self.new_value)\n+        # pylint: disable=protected-access\n+        fields_to_save = self.block._get_fields_to_save()\n+        assert_equals(len(fields_to_save), 1)","path":"xblock/test/test_fields_api.py","position":26,"original_position":26,"commit_id":"37cb31293dfa600df54e8bd894ca8f27f29e3598","original_commit_id":"37cb31293dfa600df54e8bd894ca8f27f29e3598","user":{"login":"cpennington","id":30236,"avatar_url":"https://avatars.githubusercontent.com/u/30236?v=3","gravatar_id":"","url":"https://api.github.com/users/cpennington","html_url":"https://github.com/cpennington","followers_url":"https://api.github.com/users/cpennington/followers","following_url":"https://api.github.com/users/cpennington/following{/other_user}","gists_url":"https://api.github.com/users/cpennington/gists{/gist_id}","starred_url":"https://api.github.com/users/cpennington/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpennington/subscriptions","organizations_url":"https://api.github.com/users/cpennington/orgs","repos_url":"https://api.github.com/users/cpennington/repos","events_url":"https://api.github.com/users/cpennington/events{/privacy}","received_events_url":"https://api.github.com/users/cpennington/received_events","type":"User","site_admin":false},"body":"I think this test would be better written to test that `patched_set_many` is or isn't called after each call to `save`.","created_at":"2015-06-29T13:01:28Z","updated_at":"2015-06-29T13:01:28Z","html_url":"https://github.com/edx/XBlock/pull/301#discussion_r33460582","pull_request_url":"https://api.github.com/repos/edx/XBlock/pulls/301","_links":{"self":{"href":"https://api.github.com/repos/edx/XBlock/pulls/comments/33460582"},"html":{"href":"https://github.com/edx/XBlock/pull/301#discussion_r33460582"},"pull_request":{"href":"https://api.github.com/repos/edx/XBlock/pulls/301"}}},"pull_request":{"url":"https://api.github.com/repos/edx/XBlock/pulls/301","id":38057783,"html_url":"https://github.com/edx/XBlock/pull/301","diff_url":"https://github.com/edx/XBlock/pull/301.diff","patch_url":"https://github.com/edx/XBlock/pull/301.patch","issue_url":"https://api.github.com/repos/edx/XBlock/issues/301","number":301,"state":"open","locked":false,"title":"Adam/add force save fields 2","user":{"login":"adampalay","id":2748698,"avatar_url":"https://avatars.githubusercontent.com/u/2748698?v=3","gravatar_id":"","url":"https://api.github.com/users/adampalay","html_url":"https://github.com/adampalay","followers_url":"https://api.github.com/users/adampalay/followers","following_url":"https://api.github.com/users/adampalay/following{/other_user}","gists_url":"https://api.github.com/users/adampalay/gists{/gist_id}","starred_url":"https://api.github.com/users/adampalay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adampalay/subscriptions","organizations_url":"https://api.github.com/users/adampalay/orgs","repos_url":"https://api.github.com/users/adampalay/repos","events_url":"https://api.github.com/users/adampalay/events{/privacy}","received_events_url":"https://api.github.com/users/adampalay/received_events","type":"User","site_admin":false},"body":"@cpennington , not ready for review yet, but I'm running into an issue with this test: https://github.com/edx/XBlock/blob/master/xblock/test/test_core.py#L643\r\n\r\nWhen I pdb through that test, I notice that `mutable_test.list_field` is in the list of dirty_fields, but returns false when `_is_dirty` is run on it.\r\n\r\nAny insights into what I'm missing here?","created_at":"2015-06-18T21:59:02Z","updated_at":"2015-06-29T13:01:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e7f2872e178e421045e5ba2142faadab49e92b65","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/edx/XBlock/pulls/301/commits","review_comments_url":"https://api.github.com/repos/edx/XBlock/pulls/301/comments","review_comment_url":"https://api.github.com/repos/edx/XBlock/pulls/comments{/number}","comments_url":"https://api.github.com/repos/edx/XBlock/issues/301/comments","statuses_url":"https://api.github.com/repos/edx/XBlock/statuses/37cb31293dfa600df54e8bd894ca8f27f29e3598","head":{"label":"edx:adam/add_force_save_fields_2","ref":"adam/add_force_save_fields_2","sha":"37cb31293dfa600df54e8bd894ca8f27f29e3598","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":8710321,"name":"XBlock","full_name":"edx/XBlock","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/XBlock","description":"XBlock courseware component architecture","fork":false,"url":"https://api.github.com/repos/edx/XBlock","forks_url":"https://api.github.com/repos/edx/XBlock/forks","keys_url":"https://api.github.com/repos/edx/XBlock/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/XBlock/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/XBlock/teams","hooks_url":"https://api.github.com/repos/edx/XBlock/hooks","issue_events_url":"https://api.github.com/repos/edx/XBlock/issues/events{/number}","events_url":"https://api.github.com/repos/edx/XBlock/events","assignees_url":"https://api.github.com/repos/edx/XBlock/assignees{/user}","branches_url":"https://api.github.com/repos/edx/XBlock/branches{/branch}","tags_url":"https://api.github.com/repos/edx/XBlock/tags","blobs_url":"https://api.github.com/repos/edx/XBlock/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/XBlock/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/XBlock/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/XBlock/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/XBlock/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/XBlock/languages","stargazers_url":"https://api.github.com/repos/edx/XBlock/stargazers","contributors_url":"https://api.github.com/repos/edx/XBlock/contributors","subscribers_url":"https://api.github.com/repos/edx/XBlock/subscribers","subscription_url":"https://api.github.com/repos/edx/XBlock/subscription","commits_url":"https://api.github.com/repos/edx/XBlock/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/XBlock/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/XBlock/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/XBlock/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/XBlock/contents/{+path}","compare_url":"https://api.github.com/repos/edx/XBlock/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/XBlock/merges","archive_url":"https://api.github.com/repos/edx/XBlock/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/XBlock/downloads","issues_url":"https://api.github.com/repos/edx/XBlock/issues{/number}","pulls_url":"https://api.github.com/repos/edx/XBlock/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/XBlock/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/XBlock/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/XBlock/labels{/name}","releases_url":"https://api.github.com/repos/edx/XBlock/releases{/id}","created_at":"2013-03-11T18:35:36Z","updated_at":"2015-05-28T07:05:58Z","pushed_at":"2015-06-26T18:08:50Z","git_url":"git://github.com/edx/XBlock.git","ssh_url":"git@github.com:edx/XBlock.git","clone_url":"https://github.com/edx/XBlock.git","svn_url":"https://github.com/edx/XBlock","homepage":null,"size":6918,"stargazers_count":378,"watchers_count":378,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":184,"mirror_url":null,"open_issues_count":26,"forks":184,"open_issues":26,"watchers":378,"default_branch":"master"}},"base":{"label":"edx:master","ref":"master","sha":"e1831fa86bff778ffe1308e00d8ed51b26f7c047","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":8710321,"name":"XBlock","full_name":"edx/XBlock","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/XBlock","description":"XBlock courseware component architecture","fork":false,"url":"https://api.github.com/repos/edx/XBlock","forks_url":"https://api.github.com/repos/edx/XBlock/forks","keys_url":"https://api.github.com/repos/edx/XBlock/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/XBlock/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/XBlock/teams","hooks_url":"https://api.github.com/repos/edx/XBlock/hooks","issue_events_url":"https://api.github.com/repos/edx/XBlock/issues/events{/number}","events_url":"https://api.github.com/repos/edx/XBlock/events","assignees_url":"https://api.github.com/repos/edx/XBlock/assignees{/user}","branches_url":"https://api.github.com/repos/edx/XBlock/branches{/branch}","tags_url":"https://api.github.com/repos/edx/XBlock/tags","blobs_url":"https://api.github.com/repos/edx/XBlock/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/XBlock/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/XBlock/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/XBlock/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/XBlock/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/XBlock/languages","stargazers_url":"https://api.github.com/repos/edx/XBlock/stargazers","contributors_url":"https://api.github.com/repos/edx/XBlock/contributors","subscribers_url":"https://api.github.com/repos/edx/XBlock/subscribers","subscription_url":"https://api.github.com/repos/edx/XBlock/subscription","commits_url":"https://api.github.com/repos/edx/XBlock/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/XBlock/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/XBlock/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/XBlock/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/XBlock/contents/{+path}","compare_url":"https://api.github.com/repos/edx/XBlock/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/XBlock/merges","archive_url":"https://api.github.com/repos/edx/XBlock/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/XBlock/downloads","issues_url":"https://api.github.com/repos/edx/XBlock/issues{/number}","pulls_url":"https://api.github.com/repos/edx/XBlock/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/XBlock/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/XBlock/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/XBlock/labels{/name}","releases_url":"https://api.github.com/repos/edx/XBlock/releases{/id}","created_at":"2013-03-11T18:35:36Z","updated_at":"2015-05-28T07:05:58Z","pushed_at":"2015-06-26T18:08:50Z","git_url":"git://github.com/edx/XBlock.git","ssh_url":"git@github.com:edx/XBlock.git","clone_url":"https://github.com/edx/XBlock.git","svn_url":"https://github.com/edx/XBlock","homepage":null,"size":6918,"stargazers_count":378,"watchers_count":378,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":184,"mirror_url":null,"open_issues_count":26,"forks":184,"open_issues":26,"watchers":378,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edx/XBlock/pulls/301"},"html":{"href":"https://github.com/edx/XBlock/pull/301"},"issue":{"href":"https://api.github.com/repos/edx/XBlock/issues/301"},"comments":{"href":"https://api.github.com/repos/edx/XBlock/issues/301/comments"},"review_comments":{"href":"https://api.github.com/repos/edx/XBlock/pulls/301/comments"},"review_comment":{"href":"https://api.github.com/repos/edx/XBlock/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/edx/XBlock/pulls/301/commits"},"statuses":{"href":"https://api.github.com/repos/edx/XBlock/statuses/37cb31293dfa600df54e8bd894ca8f27f29e3598"}}}}