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

@@ -7,12 +7,12 @@ import crum
import ddt
from django.test import RequestFactory
from xmodule.modulestore.tests.django_utils import CourseUserType, SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
from lms.djangoapps.experiments.testutils import override_experiment_waffle_flag
from openedx.core.djangoapps.waffle_utils.testutils import override_waffle_flag
from openedx.features.calendar_sync.plugins import CalendarSyncToggleTool
from openedx.features.course_experience import CALENDAR_SYNC_FLAG, RELATIVE_DATES_FLAG
from xmodule.modulestore.tests.django_utils import CourseUserType, SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
@ddt.ddt
@@ -35,7 +35,7 @@ class TestCalendarSyncToggleTool(SharedModuleStoreTestCase):
)
@ddt.unpack
@override_waffle_flag(CALENDAR_SYNC_FLAG, active=True)
@RELATIVE_DATES_FLAG.override(active=True)
@override_experiment_waffle_flag(RELATIVE_DATES_FLAG, active=True)
def test_calendar_sync_toggle_tool_is_enabled(self, user_type, should_be_enabled):
request = RequestFactory().request()
request.user = self.create_user_for_course(self.course, user_type)