Skip to content

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
mainfrom
jkachel/12823-recurse-if-audit-only-program
Open

Recurse into the program if the program doesn't have a verified mode when generating certificates#3848
jkachel wants to merge 1 commit into
mainfrom
jkachel/12823-recurse-if-audit-only-program

Conversation

@jkachel

@jkachel jkachel commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

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_certificate from courses/api.py in 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.

… update program factory to generate modes; update tests to work with modes
@github-actions

Copy link
Copy Markdown

OpenAPI Changes

Show/hide changes
## Changes for v0.yaml:
No changes detected

## Changes for v1.yaml:
No changes detected

## Changes for v2.yaml:
No changes detected

Unexpected changes? Ensure your branch is up-to-date with main (consider rebasing).

@cp-at-mit cp-at-mit self-assigned this Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants