-
Notifications
You must be signed in to change notification settings - Fork 4.2k
fix: Enable courseware access api for all types of course(expired, cl… #35155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
af6cf8c to
02416f8
Compare
|
|
||
| @patch('lms.djangoapps.mobile_api.course_info.utils.certificate_downloadable_status') | ||
| def test_course_not_started(self, mock_certificate_downloadable_status): | ||
| """ Test course data whic is not started yet """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit, typo: "Test course data which has not started yet"
|
|
||
| @patch('lms.djangoapps.mobile_api.course_info.utils.certificate_downloadable_status') | ||
| def test_course_closed(self, mock_certificate_downloadable_status): | ||
| """ Test course data whic is not started yet """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Is this bad copy-paste? Should the description for this test be different than the above unit test?
|
|
||
| @patch('lms.djangoapps.mobile_api.course_info.utils.certificate_downloadable_status') | ||
| def test_invalid_course_id(self, mock_certificate_downloadable_status): | ||
| """ Test course data whic is not started yet """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Bad copy-paste again for test description.
|
|
||
| response = self.client.get(path=url) | ||
| assert response.status_code == 400 | ||
| assert response.data['error'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Should we validate the contents of the error message are what we expect?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we're missing one more unit test, for the case where the course_id is missing from the request, to cover lines 431-432 in ../course_info/views.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to build this url but because of re pattern we will get page not found. Therefore I have removed that check from view.
justinhynes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we're missing one unit test for the new functionality, please see my comment in test_course_info_views.py.
02416f8 to
73ef648
Compare
After this change that new case isn't required anymore. |
justinhynes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing my comments!
|
2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production. |
|
2U Release Notice: This PR has been deployed to the edX production environment. |
1 similar comment
|
2U Release Notice: This PR has been deployed to the edX production environment. |
openedx#35155) * fix: Enable courseware access api for all types of course(expired, closed etc)
openedx#35155) * fix: Enable courseware access api for all types of course(expired, closed etc)
openedx#35155) * fix: Enable courseware access api for all types of course(expired, closed etc)
openedx#35155) * fix: Enable courseware access api for all types of course(expired, closed etc)
Description
Enable courseware access api for all types of course(expired, closed, not started yet etc)
Useful information to include:
Supporting information
Jira Ticket: https://2u-internal.atlassian.net/browse/LEARNER-10121
Sample response data that this api should return
Testing instructions
Call api
/api/mobile/{api_version}/course_info/{course_id}/enrollment_detailsand compare data with expected data given above.
Deadline
"ASAP".