GitHub PullRequestReviewCommentEvent at 2014-01-30 20:44:46
Repository: edx-platform
Actor: cahrens
Payload: {"comment":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/comments/9322482","id":9322482,"diff_hunk":"@@ -38,3 +38,30 @@ def test_substitution_without_anonymous_student_id(self):\n         module = HtmlModule(self.descriptor, module_system, field_data, Mock())\n         self.assertEqual(module.get_html(), sample_xml)\n \n+    def test_course_update(self):\n+        \"\"\"\n+        Test course update html_module rendering.\n+        Note: 'data' field has been deprecated in favor of 'items' field\n+        \"\"\"\n+        # test course update with valid old data format (data content in 'data' field)\n+        update_date = u\"January 23, 2014\"\n+        update_content = u\"Hello world!\"\n+        update_data_html = u\"<ol><li><h2>\" + update_date + u\"</h2>\" + update_content + u\"</li></ol>\"\n+\n+        field_data = DictFieldData({'data': update_data_html})\n+        module_system = get_test_system()\n+        module = CourseInfoModule(self.descriptor, module_system, field_data, Mock())\n+        self.assertEqual(module.get_html(), update_data_html)\n+\n+        # test course update with valid new data format (data content in 'items' field)\n+        update_data_new = [{u'date': update_date, u'content': update_content, u'id': 1}]\n+        field_data = DictFieldData({'items': update_data_new, 'data': update_data_html})\n+        module = CourseInfoModule(self.descriptor, module_system, field_data, Mock())\n+        self.assertEqual(module.get_html(), update_data_html)\n+\n+        # test course update with valid new data format with deleted update\n+        update_data_new = ([{u'date': update_date, u'content': update_content,\n+                             u'id': 1, u'status': CourseInfoModule.STATUS_DELETED}])\n+        field_data = DictFieldData({'items': update_data_new, 'data': update_data_html})","path":"common/lib/xmodule/xmodule/tests/test_html_module.py","position":37,"original_position":37,"commit_id":"4c89adaf79b73b0e45ce0e822653d52ab130ce94","original_commit_id":"4c89adaf79b73b0e45ce0e822653d52ab130ce94","user":{"login":"cahrens","id":484484,"avatar_url":"https://gravatar.com/avatar/c61f992b89d30875e4626db835a07b77?d=https%3A%2F%2Fidenticons.github.com%2Fae7cb847e0a60793a5658916db44a17e.png&r=x","gravatar_id":"c61f992b89d30875e4626db835a07b77","url":"https://api.github.com/users/cahrens","html_url":"https://github.com/cahrens","followers_url":"https://api.github.com/users/cahrens/followers","following_url":"https://api.github.com/users/cahrens/following{/other_user}","gists_url":"https://api.github.com/users/cahrens/gists{/gist_id}","starred_url":"https://api.github.com/users/cahrens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cahrens/subscriptions","organizations_url":"https://api.github.com/users/cahrens/orgs","repos_url":"https://api.github.com/users/cahrens/repos","events_url":"https://api.github.com/users/cahrens/events{/privacy}","received_events_url":"https://api.github.com/users/cahrens/received_events","type":"User","site_admin":false},"body":"So 'items' value wins out over 'data' value?\r\n","created_at":"2014-01-30T20:44:46Z","updated_at":"2014-01-30T20:44:46Z","html_url":"https://github.com/edx/edx-platform/pull/2238#discussion_r9322482","pull_request_url":"https://api.github.com/repos/edx/edx-platform/pulls/2238","_links":{"self":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/comments/9322482"},"html":{"href":"https://github.com/edx/edx-platform/pull/2238#discussion_r9322482"},"pull_request":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/2238"}}}}