mitodl / micromasters

Portal for learners and course teams to access MITx Micromasters® programs
https://mm.mit.edu
BSD 3-Clause "New" or "Revised" License
29 stars 17 forks source link

Update list learners eligible for enrollment upgrade #5223

Closed annagav closed 2 years ago

annagav commented 2 years ago

What are the relevant tickets?

Related to #5221

What's this PR do?

Update the management command list_authorized_exam_learners

How should this be manually tested?

1) Run ./manage.py seed_db to set up the programs and course runs 2) create your test learner user by creating an account and filling out the profile 3) Run ./manage.py alter_data set_past_run_to_passed --username <username> --program-title Digital --course-title 100 to enroll your test user in a course run, and create a passing grade and payment record, ( you will see the edx_course_key printed by the command, save it so that you can use it later) 4) Create an exam run and authorize the user for the exam:

from courses.models import *
from exams.factories import *
course = Course.objects.get(title='Digital Learning 100')
exam_run = ExamRunFactory.create(course=course, authorized=True, scheduling_past=False, scheduling_future=False)
from django.contrib.auth.models import User
user = User.objects.get(username=<username>)
ExamAuthorization.objects.create(user=user, course=course, status=ExamAuthorization.STATUS_SUCCESS, exam_run=exam_run)

5) Run ./manage.py alter_data set_to_enrolled --username <username> --course-title 'Digital Learning 100' --audit this should create an audit enrollment for a current course run 6) Run ./manage.py list_currently_enrolled_paid The user should get writted into the file users_eligible_for_upgrade.csv

codecov-commenter commented 2 years ago

Codecov Report

Merging #5223 (80beb50) into master (6917917) will decrease coverage by 0.02%. The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master    #5223      +/-   ##
==========================================
- Coverage   93.73%   93.71%   -0.03%     
==========================================
  Files         501      501              
  Lines       23226    23229       +3     
  Branches     1427     1428       +1     
==========================================
- Hits        21770    21768       -2     
- Misses       1351     1355       +4     
- Partials      105      106       +1     
Impacted Files Coverage Δ
...nagement/commands/list_authorized_exam_learners.py 0.00% <0.00%> (ø)
dashboard/utils.py 96.39% <0.00%> (-0.91%) :arrow_down:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

pdpinch commented 2 years ago

Can this be merged?