GitHub PullRequestReviewCommentEvent at 2014-10-30 18:53:10
Repository: edx-platform
Actor: gwprice
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/comments/19627777","id":19627777,"diff_hunk":"@@ -25,37 +26,71 @@ def tearDown(self):\n         super(TestUserApi, self).tearDown()\n         self.client.logout()\n \n-    def _enroll(self):\n+    def _enrollmentURL(self):\n+        return reverse('courseenrollment-detail', kwargs={'username': self.user.username})\n+\n+    def _enroll(self, course):\n         \"\"\"\n         enroll test user in test course\n         \"\"\"\n         resp = self.client.post(reverse('change_enrollment'), {\n             'enrollment_action': 'enroll',\n-            'course_id': self.course.id.to_deprecated_string(),\n+            'course_id': course.id.to_deprecated_string(),\n             'check_access': True,\n         })\n         self.assertEqual(resp.status_code, 200)\n \n-    def test_user_enrollments(self):\n-        url = reverse('courseenrollment-detail', kwargs={'username': self.user.username})\n+    def _verify_single_course(self, courses, expected_course):\n+        \"\"\"\n+        check that courses matches expected_course\n+        \"\"\"\n+        self.assertEqual(len(courses), 1)\n+        course = courses[0]['course']\n+        self.assertTrue('video_outline' in course)\n+        self.assertTrue('course_handouts' in course)\n+        self.assertEqual(course['id'], expected_course.id.to_deprecated_string())\n+        self.assertEqual(courses[0]['mode'], 'honor')\n+\n+    def test_beta_enrollments(self):\n+        self._test_privileged_enrollments(auth.CourseBetaTesterRole)\n+\n+    def test_staff_enrollments(self):\n+        self._test_privileged_enrollments(auth.CourseStaffRole)\n+\n+    def test_instructor_enrollments(self):\n+        self._test_privileged_enrollments(auth.CourseInstructorRole)\n+\n+    def _test_privileged_enrollments(self, role):\n+        url = self._enrollmentURL()\n+        non_mobile_course = CourseFactory.create(mobile_available=False)\n+        self.client.login(username=self.username, password=self.password)\n+\n+        self._enroll(non_mobile_course)\n+        response = self.client.get(url)\n+        self.assertEqual(response.status_code, 200)\n+        self.assertEqual(response.data, []) # pylint: disable=E1103\n+\n+        role(non_mobile_course.id).add_users(self.user)\n+\n+        response = self.client.get(url)\n+        courses = response.data # pylint: disable=E1103","path":"lms/djangoapps/mobile_api/users/tests.py","position":63,"original_position":63,"commit_id":"ee260569e73632ab4ea43026d9bd84735fb64072","original_commit_id":"ee260569e73632ab4ea43026d9bd84735fb64072","user":{"login":"gwprice","id":4027165,"avatar_url":"https://avatars.githubusercontent.com/u/4027165?v=2","gravatar_id":"","url":"https://api.github.com/users/gwprice","html_url":"https://github.com/gwprice","followers_url":"https://api.github.com/users/gwprice/followers","following_url":"https://api.github.com/users/gwprice/following{/other_user}","gists_url":"https://api.github.com/users/gwprice/gists{/gist_id}","starred_url":"https://api.github.com/users/gwprice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gwprice/subscriptions","organizations_url":"https://api.github.com/users/gwprice/orgs","repos_url":"https://api.github.com/users/gwprice/repos","events_url":"https://api.github.com/users/gwprice/events{/privacy}","received_events_url":"https://api.github.com/users/gwprice/received_events","type":"User","site_admin":false},"body":"Apparently pylint allows symbolic names, which is preferable. I couldn't find the name for this one with a brief search, but the pylint output should contain it if you remove the disabling.","created_at":"2014-10-30T18:53:10Z","updated_at":"2014-10-30T18:53:10Z","html_url":"https://github.com/edx/edx-platform/pull/5798#discussion_r19627777","pull_request_url":"https://api.github.com/repos/edx/edx-platform/pulls/5798","_links":{"self":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/comments/19627777"},"html":{"href":"https://github.com/edx/edx-platform/pull/5798#discussion_r19627777"},"pull_request":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/5798"}}},"pull_request":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/5798","id":23625441,"html_url":"https://github.com/edx/edx-platform/pull/5798","diff_url":"https://github.com/edx/edx-platform/pull/5798.diff","patch_url":"https://github.com/edx/edx-platform/pull/5798.patch","issue_url":"https://api.github.com/repos/edx/edx-platform/issues/5798","number":5798,"state":"open","locked":false,"title":"https://openedx.atlassian.net/browse/MA-76","user":{"login":"aleffert","id":114396,"avatar_url":"https://avatars.githubusercontent.com/u/114396?v=2","gravatar_id":"","url":"https://api.github.com/users/aleffert","html_url":"https://github.com/aleffert","followers_url":"https://api.github.com/users/aleffert/followers","following_url":"https://api.github.com/users/aleffert/following{/other_user}","gists_url":"https://api.github.com/users/aleffert/gists{/gist_id}","starred_url":"https://api.github.com/users/aleffert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aleffert/subscriptions","organizations_url":"https://api.github.com/users/aleffert/orgs","repos_url":"https://api.github.com/users/aleffert/repos","events_url":"https://api.github.com/users/aleffert/events{/privacy}","received_events_url":"https://api.github.com/users/aleffert/received_events","type":"User","site_admin":false},"body":"\"As a beta user for a course, I can access the student view of a course in the app\"\r\n\r\nAlso adds me as an AUTHOR","created_at":"2014-10-30T18:03:25Z","updated_at":"2014-10-30T18:53:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1a304455dc1b53cf5309d87fada82c5f759f7112","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/edx/edx-platform/pulls/5798/commits","review_comments_url":"https://api.github.com/repos/edx/edx-platform/pulls/5798/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/5798/comments","statuses_url":"https://api.github.com/repos/edx/edx-platform/statuses/ee260569e73632ab4ea43026d9bd84735fb64072","head":{"label":"edx:aleffert/mobile-beta-enrollments-access","ref":"aleffert/mobile-beta-enrollments-access","sha":"ee260569e73632ab4ea43026d9bd84735fb64072","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=2","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=2","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":"Open edX, the edX platform that powers http://edx.org","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":"2014-10-30T17:03:16Z","pushed_at":"2014-10-30T18:47:14Z","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://openedx.org/","size":1653826,"stargazers_count":1498,"watchers_count":1498,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":858,"mirror_url":null,"open_issues_count":101,"forks":858,"open_issues":101,"watchers":1498,"default_branch":"master"}},"base":{"label":"edx:master","ref":"master","sha":"75fab0ccfdf370c37c50cdc06de9a3c306113c3b","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=2","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=2","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":"Open edX, the edX platform that powers http://edx.org","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":"2014-10-30T17:03:16Z","pushed_at":"2014-10-30T18:47:14Z","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://openedx.org/","size":1653826,"stargazers_count":1498,"watchers_count":1498,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":858,"mirror_url":null,"open_issues_count":101,"forks":858,"open_issues":101,"watchers":1498,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/5798"},"html":{"href":"https://github.com/edx/edx-platform/pull/5798"},"issue":{"href":"https://api.github.com/repos/edx/edx-platform/issues/5798"},"comments":{"href":"https://api.github.com/repos/edx/edx-platform/issues/5798/comments"},"review_comments":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/5798/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/5798/commits"},"statuses":{"href":"https://api.github.com/repos/edx/edx-platform/statuses/ee260569e73632ab4ea43026d9bd84735fb64072"}}}}