Skip to content

Staff and instructor users of the master course are added to CCX created via REST APIs - #207

Closed
giocalitri wants to merge 2 commits into
masterfrom
gdm_staff_in_ccx_#205
Closed

Staff and instructor users of the master course are added to CCX created via REST APIs#207
giocalitri wants to merge 2 commits into
masterfrom
gdm_staff_in_ccx_#205

Conversation

@giocalitri

Copy link
Copy Markdown

What are the relevant tickets?

fixes #205

What's this PR do?

Adds the master course staff users to a new CCX created via the CCX REST APIs

Where should the reviewer start?

The added functionality is in lms.djangoapps.ccx.api.v0.views, but there has been a significant change of code in lms.djangoapps.ccx.utils.

How should this be manually tested?

A staff user on a master course should be able to view and access a CCX created via REST API using the normal dashboard.

Any background context you want to provide?

The added functionality of this PR is the equivalent of what https://github.com/edx/edx-platform/pull/10877 did with lms.djangoapps.ccx.views.

What gif best describes this PR or how it makes you feel?

for course_user, ccx_user in izip(sorted(list_staff_master_course), sorted(list_staff_ccx_course)):
self.assertEqual(course_user, ccx_user)
self.assertEqual(len(list_instructor_master_course), len(list_instructor_ccx_course))
for course_user, ccx_user in izip(sorted(list_staff_master_course), sorted(list_staff_ccx_course)):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you already did this comparison in the previous for loop

@pdpinch

pdpinch commented Feb 23, 2016

Copy link
Copy Markdown
Member

Can we mention in the title that this is for the REST API?

@giocalitri giocalitri changed the title Staff and instructor users of the master course are added to the CCX Staff and instructor users of the master course are added to CCX created via REST APIs Feb 23, 2016
@giocalitri

Copy link
Copy Markdown
Author

@pdpinch: done

with ccx_course(self.ccx_locator) as course_ccx:
list_staff_ccx_course = list_with_level(course_ccx, 'staff')
list_instructor_ccx_course = list_with_level(course_ccx, 'instructor')
self.assertEqual(len(list_staff_master_course), len(list_staff_ccx_course))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to compare the lists directly instead of the count, or is that cumbersome?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually it looks like you could just say

self.assertEqual(sorted(list_staff_master_course), sorted(list_staff_ccx_course))

And you could remove the next couple lines as well

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually tried and for some reason it was failing

@noisecapella

Copy link
Copy Markdown

Looks good, feel free to ignore my comment about the test if it's complicated to do 👍

Comment thread lms/djangoapps/ccx/tests/test_utils.py Outdated
self.assertEqual(result, ccx)


class TestStaffOnCCX(CcxTestCase, SharedModuleStoreTestCase):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove SharedModuleStoreTestCase ? Doesn't that make the tests faster?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@noisecapella

Copy link
Copy Markdown

Was this merged in edX already?

@giocalitri

Copy link
Copy Markdown
Author

closing this because included in some work @amir-qayyum-khan already merged in edx

@giocalitri giocalitri closed this May 4, 2016
@giocalitri
giocalitri deleted the gdm_staff_in_ccx_#205 branch May 4, 2016 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add staff and instructors users as staff of a CCX created via REST APIs

3 participants