Deprecate ExperimentWaffleFlag.override method

This is part of a removal of the many override methods of toggle
flag/namespace classes. This allows us to remove imports of test modules
from production code.
This commit is contained in:
Régis Behmo
2020-10-23 11:19:41 +02:00
parent 64a162f69c
commit 16ce16e85e
12 changed files with 117 additions and 99 deletions

View File

@@ -1,10 +1,11 @@
""" Tests for student signal receivers. """
from lms.djangoapps.courseware.toggles import (
REDIRECT_TO_COURSEWARE_MICROFRONTEND,
COURSEWARE_MICROFRONTEND_PROGRESS_MILESTONES,
COURSEWARE_MICROFRONTEND_PROGRESS_MILESTONES_FIRST_SECTION_CELEBRATION
COURSEWARE_MICROFRONTEND_PROGRESS_MILESTONES_FIRST_SECTION_CELEBRATION,
REDIRECT_TO_COURSEWARE_MICROFRONTEND
)
from lms.djangoapps.experiments.testutils import override_experiment_waffle_flag
from student.models import CourseEnrollmentCelebration
from student.tests.factories import CourseEnrollmentFactory
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
@@ -14,7 +15,7 @@ class ReceiversTest(SharedModuleStoreTestCase):
"""
Tests for dashboard utility functions
"""
@REDIRECT_TO_COURSEWARE_MICROFRONTEND.override(active=True)
@override_experiment_waffle_flag(REDIRECT_TO_COURSEWARE_MICROFRONTEND, active=True)
@COURSEWARE_MICROFRONTEND_PROGRESS_MILESTONES.override(active=True)
@COURSEWARE_MICROFRONTEND_PROGRESS_MILESTONES_FIRST_SECTION_CELEBRATION.override(active=True)
def test_celebration_created(self):