{"action":"created","comment":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/comments/41293522","id":41293522,"diff_hunk":"@@ -2452,18 +2463,125 @@ def test_course_deleted_signal(self, default):\n             with self.store.default_store(default):\n                 self.assertIsNotNone(self.store.thread_cache.default_store.signal_handler)\n \n-                with mock_signal_receiver(SignalHandler.course_deleted) as receiver:\n-                    self.assertEqual(receiver.call_count, 0)\n+                signal_handler.send.assert_not_called()\n \n-                    # Create a course\n-                    course = self.store.create_course('org_x', 'course_y', 'run_z', self.user_id)\n-                    course_key = course.id\n+                # Create a course\n+                course = self.store.create_course('org_x', 'course_y', 'run_z', self.user_id)\n+                course_key = course.id\n \n-                    # Delete the course\n-                    course = self.store.delete_course(course_key, self.user_id)\n+                # Delete the course\n+                course = self.store.delete_course(course_key, self.user_id)\n \n-                    # Verify that the signal was emitted\n-                    self.assertEqual(receiver.call_count, 1)\n+                # Verify that the signal was emitted\n+                signal_handler.send.assert_called_with('course_deleted', course_key=course_key)\n+\n+    @ddt.data(ModuleStoreEnum.Type.mongo, ModuleStoreEnum.Type.split)\n+    def test_delete_published_item_creates_no_orphans(self, default_store):\n+        \"\"\"\n+        Tests delete published item dont create any oprhans in course\n+        \"\"\"\n+        self.initdb(default_store)\n+        course_locator = self.course.id\n+\n+        chapter = self.store.create_child(\n+            self.user_id, self.course.location, 'chapter', block_id='section_one'\n+        )\n+\n+        sequential = self.store.create_child(\n+            self.user_id, chapter.location, 'sequential', block_id='subsection_one'\n+        )\n+\n+        vertical = self.store.create_child(\n+            self.user_id, sequential.location, 'vertical', block_id='moon_unit'\n+        )\n+\n+        problem = self.store.create_child(\n+            self.user_id, vertical.location, 'problem', block_id='problem'\n+        )\n+\n+        self.store.publish(chapter.location, self.user_id)\n+        # Verify that there are no changes\n+        self.assertFalse(self._has_changes(chapter.location))\n+        self.assertFalse(self._has_changes(sequential.location))\n+        self.assertFalse(self._has_changes(vertical.location))\n+        self.assertFalse(self._has_changes(problem.location))\n+\n+        # No oprhans in course\n+        course_orphans = self.store.get_orphans(course_locator)","path":"common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py","position":1129,"original_position":1129,"commit_id":"bd67a939d261886ec4ba0e258fb8e94a442187f7","original_commit_id":"bd67a939d261886ec4ba0e258fb8e94a442187f7","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 don't actually know. @adampalay: do you know?","created_at":"2015-10-06T17:16:11Z","updated_at":"2015-10-06T17:16:11Z","html_url":"https://github.com/edx/edx-platform/pull/9911#discussion_r41293522","pull_request_url":"https://api.github.com/repos/edx/edx-platform/pulls/9911","_links":{"self":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/comments/41293522"},"html":{"href":"https://github.com/edx/edx-platform/pull/9911#discussion_r41293522"},"pull_request":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/9911"}}},"pull_request":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/9911","id":45939348,"html_url":"https://github.com/edx/edx-platform/pull/9911","diff_url":"https://github.com/edx/edx-platform/pull/9911.diff","patch_url":"https://github.com/edx/edx-platform/pull/9911.patch","issue_url":"https://api.github.com/repos/edx/edx-platform/issues/9911","number":9911,"state":"open","locked":false,"title":"Delete DIRECT_ONLY_CATEGORIES from both draft and published branches by default","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":"Prior to these changes, in SplitDraft, when a DIRECT_ONLY_CATEGORIES xblock was deleted, it was only deleted from the draft branch. This change deletes it from both draft and published branches (because DIRECT_ONLY_CATEGORIES are supposed to always be autopublished).\r\n\r\nThis fixes https://openedx.atlassian.net/browse/PLAT-858","created_at":"2015-09-24T19:31:00Z","updated_at":"2015-10-06T17:16:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0db5c064a7f9f96d10237d6baba9c25eb7239796","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/edx/edx-platform/pulls/9911/commits","review_comments_url":"https://api.github.com/repos/edx/edx-platform/pulls/9911/comments","review_comment_url":"https://api.github.com/repos/edx/edx-platform/pulls/comments{/number}","comments_url":"https://api.github.com/repos/edx/edx-platform/issues/9911/comments","statuses_url":"https://api.github.com/repos/edx/edx-platform/statuses/bd67a939d261886ec4ba0e258fb8e94a442187f7","head":{"label":"cpennington:fix-plat-858","ref":"fix-plat-858","sha":"bd67a939d261886ec4ba0e258fb8e94a442187f7","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},"repo":{"id":10688258,"name":"edx-platform","full_name":"cpennington/edx-platform","owner":{"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},"private":false,"html_url":"https://github.com/cpennington/edx-platform","description":"the edX learning management system (LMS) and course authoring tool, Studio","fork":true,"url":"https://api.github.com/repos/cpennington/edx-platform","forks_url":"https://api.github.com/repos/cpennington/edx-platform/forks","keys_url":"https://api.github.com/repos/cpennington/edx-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cpennington/edx-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cpennington/edx-platform/teams","hooks_url":"https://api.github.com/repos/cpennington/edx-platform/hooks","issue_events_url":"https://api.github.com/repos/cpennington/edx-platform/issues/events{/number}","events_url":"https://api.github.com/repos/cpennington/edx-platform/events","assignees_url":"https://api.github.com/repos/cpennington/edx-platform/assignees{/user}","branches_url":"https://api.github.com/repos/cpennington/edx-platform/branches{/branch}","tags_url":"https://api.github.com/repos/cpennington/edx-platform/tags","blobs_url":"https://api.github.com/repos/cpennington/edx-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cpennington/edx-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cpennington/edx-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/cpennington/edx-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cpennington/edx-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/cpennington/edx-platform/languages","stargazers_url":"https://api.github.com/repos/cpennington/edx-platform/stargazers","contributors_url":"https://api.github.com/repos/cpennington/edx-platform/contributors","subscribers_url":"https://api.github.com/repos/cpennington/edx-platform/subscribers","subscription_url":"https://api.github.com/repos/cpennington/edx-platform/subscription","commits_url":"https://api.github.com/repos/cpennington/edx-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/cpennington/edx-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/cpennington/edx-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/cpennington/edx-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/cpennington/edx-platform/contents/{+path}","compare_url":"https://api.github.com/repos/cpennington/edx-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cpennington/edx-platform/merges","archive_url":"https://api.github.com/repos/cpennington/edx-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cpennington/edx-platform/downloads","issues_url":"https://api.github.com/repos/cpennington/edx-platform/issues{/number}","pulls_url":"https://api.github.com/repos/cpennington/edx-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/cpennington/edx-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/cpennington/edx-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cpennington/edx-platform/labels{/name}","releases_url":"https://api.github.com/repos/cpennington/edx-platform/releases{/id}","created_at":"2013-06-14T12:13:54Z","updated_at":"2015-04-06T13:52:11Z","pushed_at":"2015-10-02T16:51:56Z","git_url":"git://github.com/cpennington/edx-platform.git","ssh_url":"git@github.com:cpennington/edx-platform.git","clone_url":"https://github.com/cpennington/edx-platform.git","svn_url":"https://github.com/cpennington/edx-platform","homepage":"http://code.edx.org/","size":463497,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"edx:master","ref":"master","sha":"241ce4a6b12a79e8d43832b3b022ca5d0d529793","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":10391073,"name":"edx-platform","full_name":"edx/edx-platform","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/edx-platform","description":"The Open edX platform, the software that powers edX!","fork":false,"url":"https://api.github.com/repos/edx/edx-platform","forks_url":"https://api.github.com/repos/edx/edx-platform/forks","keys_url":"https://api.github.com/repos/edx/edx-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/edx-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/edx-platform/teams","hooks_url":"https://api.github.com/repos/edx/edx-platform/hooks","issue_events_url":"https://api.github.com/repos/edx/edx-platform/issues/events{/number}","events_url":"https://api.github.com/repos/edx/edx-platform/events","assignees_url":"https://api.github.com/repos/edx/edx-platform/assignees{/user}","branches_url":"https://api.github.com/repos/edx/edx-platform/branches{/branch}","tags_url":"https://api.github.com/repos/edx/edx-platform/tags","blobs_url":"https://api.github.com/repos/edx/edx-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/edx-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/edx-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/edx-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/edx-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/edx-platform/languages","stargazers_url":"https://api.github.com/repos/edx/edx-platform/stargazers","contributors_url":"https://api.github.com/repos/edx/edx-platform/contributors","subscribers_url":"https://api.github.com/repos/edx/edx-platform/subscribers","subscription_url":"https://api.github.com/repos/edx/edx-platform/subscription","commits_url":"https://api.github.com/repos/edx/edx-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/edx-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/edx-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/edx-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/edx-platform/contents/{+path}","compare_url":"https://api.github.com/repos/edx/edx-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/edx-platform/merges","archive_url":"https://api.github.com/repos/edx/edx-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/edx-platform/downloads","issues_url":"https://api.github.com/repos/edx/edx-platform/issues{/number}","pulls_url":"https://api.github.com/repos/edx/edx-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/edx-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/edx-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/edx-platform/labels{/name}","releases_url":"https://api.github.com/repos/edx/edx-platform/releases{/id}","created_at":"2013-05-30T20:20:38Z","updated_at":"2015-10-05T15:03:07Z","pushed_at":"2015-10-06T17:10:47Z","git_url":"git://github.com/edx/edx-platform.git","ssh_url":"git@github.com:edx/edx-platform.git","clone_url":"https://github.com/edx/edx-platform.git","svn_url":"https://github.com/edx/edx-platform","homepage":"http://open.edx.org/","size":2092774,"stargazers_count":2157,"watchers_count":2157,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1296,"mirror_url":null,"open_issues_count":137,"forks":1296,"open_issues":137,"watchers":2157,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/9911"},"html":{"href":"https://github.com/edx/edx-platform/pull/9911"},"issue":{"href":"https://api.github.com/repos/edx/edx-platform/issues/9911"},"comments":{"href":"https://api.github.com/repos/edx/edx-platform/issues/9911/comments"},"review_comments":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/9911/comments"},"review_comment":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/9911/commits"},"statuses":{"href":"https://api.github.com/repos/edx/edx-platform/statuses/bd67a939d261886ec4ba0e258fb8e94a442187f7"}}}}