Import waffle classes from edx_toggles instead of waffle_utils

Those classes were ported to edx_toggles. The imports remain in
waffle_utils.__init__ for backward compatibility.
This commit is contained in:
Régis Behmo
2020-10-23 14:51:35 +02:00
parent 3b127f8c92
commit 4586002956
64 changed files with 141 additions and 183 deletions

View File

@@ -3,7 +3,7 @@ Student app helpers and settings
"""
from openedx.core.djangoapps.waffle_utils import WaffleSwitchNamespace
from edx_toggles.toggles import WaffleSwitchNamespace
# Namespace for student app waffle switches
STUDENT_WAFFLE_NAMESPACE = WaffleSwitchNamespace(name='student')

View File

@@ -22,12 +22,15 @@ from django.utils.translation import ugettext_lazy as _
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
from openedx.core.djangoapps.waffle_utils import WaffleSwitch
from edx_toggles.toggles import WaffleSwitch
from openedx.core.lib.courses import clean_course_id
from student import STUDENT_WAFFLE_NAMESPACE
from student.models import (
AccountRecovery,
AccountRecoveryConfiguration,
AllowedAuthUser,
BulkChangeEnrollmentConfiguration,
BulkUnenrollConfiguration,
CourseAccessRole,
CourseEnrollment,
CourseEnrollmentAllowed,
@@ -40,10 +43,7 @@ from student.models import (
RegistrationCookieConfiguration,
UserAttribute,
UserProfile,
UserTestGroup,
BulkUnenrollConfiguration,
AccountRecoveryConfiguration,
BulkChangeEnrollmentConfiguration
UserTestGroup
)
from student.roles import REGISTERED_ACCESS_ROLES
from xmodule.modulestore.django import modulestore

View File

@@ -15,18 +15,18 @@ from django.forms import ValidationError
from django.test import TestCase, override_settings
from django.urls import reverse
from django.utils.timezone import now
from edx_toggles.toggles.testutils import override_waffle_switch
from mock import Mock
from pytz import UTC
from openedx.core.djangoapps.content.course_overviews.tests.factories import CourseOverviewFactory
from openedx.core.djangoapps.site_configuration.tests.mixins import SiteMixin
from openedx.core.djangoapps.waffle_utils.testutils import override_waffle_switch
from student.admin import COURSE_ENROLLMENT_ADMIN_SWITCH, AllowedAuthUserForm, CourseEnrollmentForm, UserAdmin
from student.models import AllowedAuthUser, CourseEnrollment, LoginFailures
from student.tests.factories import CourseEnrollmentFactory, UserFactory
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
from openedx.core.djangoapps.content.course_overviews.tests.factories import CourseOverviewFactory
from openedx.core.djangoapps.site_configuration.tests.mixins import SiteMixin
class AdminCourseRolesPageTest(SharedModuleStoreTestCase):
"""Test the django admin course roles form saving data in db.

View File

@@ -17,6 +17,7 @@ from django.test import TestCase
from django.test.utils import override_settings
from django.urls import reverse
from django.utils.timezone import now
from edx_toggles.toggles.testutils import override_waffle_flag
from milestones.tests.utils import MilestonesTestCaseMixin
from mock import patch
from opaque_keys import InvalidKeyError
@@ -25,7 +26,6 @@ from pyquery import PyQuery as pq
from six.moves import range
from course_modes.models import CourseMode
from edx_toggles.toggles.testutils import override_waffle_flag
from entitlements.tests.factories import CourseEntitlementFactory
from lms.djangoapps.certificates.tests.factories import GeneratedCertificateFactory
from openedx.core.djangoapps.catalog.tests.factories import ProgramFactory

View File

@@ -16,6 +16,7 @@ from django.utils.translation import ugettext as _
from django.views.decorators.csrf import ensure_csrf_cookie
from edx_django_utils import monitoring as monitoring_utils
from edx_django_utils.plugins import get_plugins_view_context
from edx_toggles.toggles import WaffleFlag, WaffleFlagNamespace
from opaque_keys.edx.keys import CourseKey
from pytz import UTC
from six import iteritems, text_type
@@ -42,12 +43,10 @@ from openedx.core.djangoapps.programs.utils import ProgramDataExtender, ProgramP
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
from openedx.core.djangoapps.user_api.accounts.utils import is_secondary_email_feature_enabled
from openedx.core.djangoapps.util.maintenance_banner import add_maintenance_banner
from openedx.core.djangoapps.waffle_utils import WaffleFlag, WaffleFlagNamespace
from openedx.core.djangolib.markup import HTML, Text
from openedx.features.enterprise_support.api import get_dashboard_consent_notification
from openedx.features.enterprise_support.api import (
get_dashboard_consent_notification,
get_enterprise_learner_portal_enabled_message,
get_enterprise_learner_portal_enabled_message
)
from student.api import COURSE_DASHBOARD_PLUGIN_VIEW_NAME
from student.helpers import cert_info, check_verify_status_by_course, get_resume_urls_for_enrollments