GitHub PullRequestReviewCommentEvent at 2014-05-14 21:25:49
Repository: edx-platform
Actor: dmitchell
Payload: {"comment":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/comments/12662509","id":12662509,"diff_hunk":"@@ -72,6 +76,57 @@ def test_jumpto_id_invalid_location(self):\n         self.assertEqual(response.status_code, 404)\n \n \n+@override_settings(MODULESTORE=TEST_MODULESTORE)\n+class TestJumpToIdDraft(TestCase):\n+    \"\"\"\n+    Tests the jump_to_id link resolution of draft items in preview mode\n+\n+    We have to use a mixed direct/draft store for this, as this is only an issue\n+    for draft items that belong to public ones.\n+    Since preview mode uses a DraftModuleStore by default, mocking the hostname\n+    to `preview.localhost` is not necessary.\n+    \"\"\"\n+\n+    def setUp(self):\n+        self.course, item = self.create_course(start=datetime(2014, 5, 13))\n+        self.instructor = self.create_instructor(self.course)\n+        self.draft = self.convert_item_to_draft(item)\n+\n+    def create_course(self, **kwargs):\n+        course = CourseFactory()\n+        chapter = ItemFactory(category='chapter', parent_location=course.location)\n+        section = ItemFactory(category='sequential', parent_location=chapter.location)\n+        item = ItemFactory(category='vertical', parent_location=section.location)\n+        return course, item\n+\n+    def convert_item_to_draft(self, item):","path":"lms/djangoapps/courseware/tests/test_views.py","position":54,"original_position":54,"commit_id":"15dfd2f17e6cad37ea3d8adb5e820357413fdf9d","original_commit_id":"15dfd2f17e6cad37ea3d8adb5e820357413fdf9d","user":{"login":"dmitchell","id":475919,"avatar_url":"https://avatars.githubusercontent.com/u/475919?","gravatar_id":"36268e32a487952477b6f129e590005f","url":"https://api.github.com/users/dmitchell","html_url":"https://github.com/dmitchell","followers_url":"https://api.github.com/users/dmitchell/followers","following_url":"https://api.github.com/users/dmitchell/following{/other_user}","gists_url":"https://api.github.com/users/dmitchell/gists{/gist_id}","starred_url":"https://api.github.com/users/dmitchell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmitchell/subscriptions","organizations_url":"https://api.github.com/users/dmitchell/orgs","repos_url":"https://api.github.com/users/dmitchell/repos","events_url":"https://api.github.com/users/dmitchell/events{/privacy}","received_events_url":"https://api.github.com/users/dmitchell/received_events","type":"User","site_admin":false},"body":"If you don't want item in the published course, change L99 to be\r\n`item = ItemFactory(category='vertical', parent_location=section.location, modulestore=modulestore('draft'))`\r\n\r\nThen you don't need this function at all.","created_at":"2014-05-14T21:25:49Z","updated_at":"2014-05-14T21:25:49Z","html_url":"https://github.com/edx/edx-platform/pull/3679#discussion_r12662509","pull_request_url":"https://api.github.com/repos/edx/edx-platform/pulls/3679","_links":{"self":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/comments/12662509"},"html":{"href":"https://github.com/edx/edx-platform/pull/3679#discussion_r12662509"},"pull_request":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/3679"}}}}