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

feat: replace waffle flag with setting #67

Merged
merged 1 commit into from
Feb 14, 2024

Conversation

alangsto
Copy link
Member

COSMO-191

To prepare for a wider release, the use of a course waffle flag to enable the learning assistant should be replaced by a platform wide django setting.

If no setting is defined, the feature will default to a disabled state.

@alangsto alangsto force-pushed the alangsto/update_waffle_flag_to_django_setting branch 3 times, most recently from 6bb55f5 to 267f981 Compare February 14, 2024 16:37
@alangsto alangsto force-pushed the alangsto/update_waffle_flag_to_django_setting branch 3 times, most recently from de6e22b to 58fd79d Compare February 14, 2024 20:43
@alangsto alangsto marked this pull request as ready for review February 14, 2024 20:43
tests/test_api.py Outdated Show resolved Hide resolved
@@ -223,7 +224,8 @@ def setUp(self):
(False, False, False, False),
)
@ddt.unpack
@patch('learning_assistant.api.learning_assistant_available')
@patch('learning_assistant.api.learning_assistant_available_flag')
@override_settings(LEARNING_ASSISTANT_AVAILABLE=False)
Copy link
Member

Choose a reason for hiding this comment

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

Do these tests fail if LEARNING_ASSISTANT_AVAILABLE=True? Or are you just trying to ensure that these tests are testing the waffle flag logic and not the Django setting?

Copy link
Member Author

Choose a reason for hiding this comment

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

I was trying to limit the scope of this test, and not introduce more booleans to test the logic of the django setting. Although now I'm realizing because I added a test for the api function learning_assistant_available, I could mock that here, and avoid overriding the setting.

@alangsto alangsto force-pushed the alangsto/update_waffle_flag_to_django_setting branch from 491ee95 to d7dd451 Compare February 14, 2024 21:18
@alangsto alangsto force-pushed the alangsto/update_waffle_flag_to_django_setting branch from d7dd451 to 2db2806 Compare February 14, 2024 21:30
@alangsto alangsto merged commit 9c016d6 into main Feb 14, 2024
8 checks passed
@alangsto alangsto deleted the alangsto/update_waffle_flag_to_django_setting branch February 14, 2024 21:33
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