Recurse into the program if the program doesn't have a verified mode when generating certificates - #3848
Open
jkachel wants to merge 1 commit into
Open
Recurse into the program if the program doesn't have a verified mode when generating certificates#3848jkachel wants to merge 1 commit into
jkachel wants to merge 1 commit into
Conversation
… update program factory to generate modes; update tests to work with modes
OpenAPI ChangesShow/hide changesUnexpected changes? Ensure your branch is up-to-date with |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What are the relevant tickets?
Closes mitodl/hq#12823
Description (What does it do?)
When determining if the user is eligible for a certificate for a program, recurse into sub-programs if the sub-program only offers audit-mode enrollments.
This also updates the ProgramFactory to generate course modes and updates the affected tests. Also adds a Stripe key to the ecommerce defaults factory - I was getting test errors for that.
How can this be tested?
Automated tests should pass. Note that several tests have changed to accommodate the ProgramFactory changes.
Create a program that only offers audit-mode enrollments. Then, create another program that supports verified-mode enrollments (including a certificate page) and add the first program as a requirement. Create course runs as necessary for these programs as well (you should probably have at least one course in the audit-only program).
Enroll a user in the verified-track program as a verified-track user, in the audit-only program as audit, and the other courses in the appropriate mode (best between verified and audit). Create grades for courses such that the user has a passing grade in everything.
Generate certificates for any course that you've enrolled your user in that has a verified mode. Do this manually (using the Django Admin) because the tasks/commands for this will try to pull grade info from edX. Don't generate a certificate for your verified-mode program yet.
Finally, run
_has_earned_program_certificatefromcourses/api.pyin a Django shell with the user and verified-mode program. It should indicate that the user has earned the program certificate. Running the program certificate generation task/etc. should generate a certificate as well.