Skip to content
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

fix: unittests for default realizations, remove errant break #604

Merged
merged 1 commit into from
Dec 2, 2024

Conversation

iloveagent57
Copy link
Contributor

Description:

  • Remove an errant break from a loop in enroll_in_redeemable_default_enterprise_enrollment_intentions()
  • Light refactoring in same function.
  • Adds unittests for same function.

Jira:
ENT-9632

Merge checklist:

  • ./manage.py makemigrations has been run
    • Note: This must be run if you modified any models.
      • It may or may not make a migration depending on exactly what you modified, but it should still be run.

Post merge:

  • Ensure that your changes went out to the stage instance
  • Deploy to prod instance

Copy link
Member

@adamstankiewicz adamstankiewicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Though, just a quick sanity check - are we good with only testing the auto-enrollment side effects within the test_handlers unit tests versus in the viewset (where we currently have more integration-style tests for the subscription license side effects of license activation and auto-applied licenses)?

I personally don't have strong feelings one way or another; what you have here is totally fine! :)

@@ -448,8 +448,37 @@ def enroll_in_redeemable_default_enterprise_enrollment_intentions(self):
if subscription_catalog in applicable_catalog_to_enrollment_intention:
course_run_key = enrollment_intention['course_run_key']
license_uuids_by_course_run_key[course_run_key] = self.current_active_license['uuid']
break
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch on the errant break!

@iloveagent57 iloveagent57 force-pushed the aed/unittest-deafult-enrollments branch from 847632b to 86f3cff Compare December 2, 2024 20:21
@iloveagent57 iloveagent57 merged commit 0995768 into main Dec 2, 2024
3 checks passed
@iloveagent57 iloveagent57 deleted the aed/unittest-deafult-enrollments branch December 2, 2024 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants