Skip to content

Commit

Permalink
chore: fix tests for bulk enrollment with auto-enrollment
Browse files Browse the repository at this point in the history
  • Loading branch information
adamstankiewicz committed Nov 6, 2024
1 parent a6a6259 commit 7fde730
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions enterprise/api/v1/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1483,6 +1483,10 @@ class EnrollmentsInfoSerializer(serializers.Serializer):
required=False,
help_text='Enroll even if enrollment deadline is expired.',
)
is_default_auto_enrollment = serializers.BooleanField(
required=False,
help_text='Auto-enrollment for default enterprise enrollment intention.',
)

def create(self, validated_data):
return validated_data
Expand Down
6 changes: 3 additions & 3 deletions tests/test_enterprise/api/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -5911,7 +5911,7 @@ def test_enroll_learners_in_courses_partial_failure(self, mock_get_course_mode,
]
},
'fulfillment_source': LicensedEnterpriseCourseEnrollment,
'expected_enrollment_realization_count': 0,
'expected_enrollment_realization_count': 1,
},
# Does NOT create DefaultEnterpriseEnrollmentRealization upon successful
# subscription enrollment (is_default_auto_enrollment is False)
Expand Down Expand Up @@ -6010,11 +6010,11 @@ def test_enroll_learners_in_courses_default_enrollment_realizations(
enrollment = enrollments.first()
assert enrollment.course_id == body['enrollments_info'][0]['course_run_key']

enrollment_realization = DefaultEnterpriseEnrollmentRealization.objects.filter(
enrollment_realizations = DefaultEnterpriseEnrollmentRealization.objects.filter(
intended_enrollment=enrollment_intention,
realized_enrollment=enrollment,
)
assert len(enrollment_realization) == expected_enrollment_realization_count
assert len(enrollment_realizations) == expected_enrollment_realization_count


@ddt.ddt
Expand Down

0 comments on commit 7fde730

Please sign in to comment.