Skip to content

refactor: migrate 10 more flags off FEATURES-as-dict (batch 6)#38903

Open
feanil wants to merge 10 commits into
masterfrom
feanil/features-dict-batch-6
Open

refactor: migrate 10 more flags off FEATURES-as-dict (batch 6)#38903
feanil wants to merge 10 commits into
masterfrom
feanil/features-dict-batch-6

Conversation

@feanil

@feanil feanil commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Migrates 10 more feature flags off settings.FEATURES['X'] dict-style access onto flat settings (settings.X) with @override_settings(X=Y) in tests. Follows the pattern established in #38772.

Each commit migrates a single flag:

  • ENABLE_PREREQUISITE_COURSES
  • ENABLE_DISCUSSION_HOME_PANEL
  • ENABLE_COURSE_HOME_REDIRECT
  • DISPLAY_COURSE_MODES_ON_DASHBOARD (also adds the flag + annotation to openedx/envs/common.py)
  • ENABLE_VERIFIED_CERTIFICATES
  • ENABLE_ENROLLMENT_TRACK_USER_PARTITION
  • AUTOMATIC_VERIFY_STUDENT_IDENTITY_FOR_TESTING
  • ENABLE_INSTRUCTOR_BACKGROUND_TASKS
  • ENABLE_ENROLLMENT_RESET
  • DISABLE_SET_JWT_COOKIES_FOR_TESTS

@feanil
feanil force-pushed the feanil/features-dict-batch-6 branch 4 times, most recently from 7f7db06 to 70ae384 Compare July 18, 2026 01:57

# Lots of patching to stub in our own settings, and HTTP posting
@patch.dict(settings.VERIFY_STUDENT, FAKE_SETTINGS)
@patch.dict(settings.FEATURES, {'AUTOMATIC_VERIFY_STUDENT_IDENTITY_FOR_TESTING': True})

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The goal of this test was to verify that when the management command runs, a signal is fired for re-running idv. The AUTOMATIC_VERIFY_STUDENT_IDENTITY_FOR_TESTING decides whether or not the test call to the IDV system are successful. This determines the responses we get back but is not actually relevant to the part of the system we're trying to test.

This is removed because this patch doesn't actually wrap the setup function which is where the creation happens and the value of this flag is checked. Luckily the test is written as if it should be false and so the test checks work as if this setting was never here.

We drop this patch because it is confusing and ineffective rather than converting it which would break the test and cause it to be re-written but not really changing the part of the code meant to be exercised.

@feanil
feanil force-pushed the feanil/features-dict-batch-6 branch from 70ae384 to a0d39d0 Compare July 20, 2026 15:10
@feanil
feanil marked this pull request as ready for review July 20, 2026 15:10
@feanil
feanil requested review from a team, farhan, irtazaakram and salman2013 as code owners July 20, 2026 15:10
@feanil
feanil force-pushed the feanil/features-dict-batch-6 branch from a0d39d0 to 5aed00f Compare July 20, 2026 15:19
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.

1 participant