', '', '')
- @patch('student.models.cc.User.from_django_user')
+ @patch('common.djangoapps.student.models.cc.User.from_django_user')
def test_forum_discussion_xss_prevent(self, malicious_code, mock_user, mock_req):
"""
Test that XSS attack is prevented
@@ -1670,8 +1670,8 @@ class ForumDiscussionXSSTestCase(ForumsEnableMixin, UrlResetMixin, ModuleStoreTe
self.assertNotContains(resp, malicious_code)
@ddt.data('">', '', '')
- @patch('student.models.cc.User.from_django_user')
- @patch('student.models.cc.User.active_threads')
+ @patch('common.djangoapps.student.models.cc.User.from_django_user')
+ @patch('common.djangoapps.student.models.cc.User.active_threads')
def test_forum_user_profile_xss_prevent(self, malicious_code, mock_threads, mock_from_django_user, mock_request):
"""
Test that XSS attack is prevented
diff --git a/lms/djangoapps/discussion/views.py b/lms/djangoapps/discussion/views.py
index ffe9166589..f28488e78a 100644
--- a/lms/djangoapps/discussion/views.py
+++ b/lms/djangoapps/discussion/views.py
@@ -57,8 +57,8 @@ from openedx.core.djangoapps.django_comment_common.utils import (
)
from openedx.core.djangoapps.plugin_api.views import EdxFragmentView
from openedx.features.course_duration_limits.access import generate_course_expired_fragment
-from student.models import CourseEnrollment
-from util.json_request import JsonResponse, expect_json
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.util.json_request import JsonResponse, expect_json
from xmodule.modulestore.django import modulestore
log = logging.getLogger("edx.discussions")
diff --git a/lms/djangoapps/edxnotes/decorators.py b/lms/djangoapps/edxnotes/decorators.py
index 0fab13d329..277ac8ca05 100644
--- a/lms/djangoapps/edxnotes/decorators.py
+++ b/lms/djangoapps/edxnotes/decorators.py
@@ -8,7 +8,7 @@ import json
import six
from django.conf import settings
-from edxmako.shortcuts import render_to_string
+from common.djangoapps.edxmako.shortcuts import render_to_string
def edxnotes(cls):
diff --git a/lms/djangoapps/edxnotes/helpers.py b/lms/djangoapps/edxnotes/helpers.py
index beee9f368f..c6dec5e647 100644
--- a/lms/djangoapps/edxnotes/helpers.py
+++ b/lms/djangoapps/edxnotes/helpers.py
@@ -28,8 +28,8 @@ from lms.djangoapps.edxnotes.plugins import EdxNotesTab
from lms.lib.utils import get_parent_unit
from openedx.core.djangoapps.oauth_dispatch.jwt import create_jwt_for_user
from openedx.core.djangolib.markup import Text
-from student.models import anonymous_id_for_user
-from util.date_utils import get_default_time_display
+from common.djangoapps.student.models import anonymous_id_for_user
+from common.djangoapps.util.date_utils import get_default_time_display
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.exceptions import ItemNotFoundError
diff --git a/lms/djangoapps/edxnotes/tests.py b/lms/djangoapps/edxnotes/tests.py
index d83faf288e..f9074b633d 100644
--- a/lms/djangoapps/edxnotes/tests.py
+++ b/lms/djangoapps/edxnotes/tests.py
@@ -25,7 +25,7 @@ from oauth2_provider.models import Application
from lms.djangoapps.courseware.model_data import FieldDataCache
from lms.djangoapps.courseware.module_render import get_module_for_descriptor
from lms.djangoapps.courseware.tabs import get_course_tab_list
-from edxmako.shortcuts import render_to_string
+from common.djangoapps.edxmako.shortcuts import render_to_string
from . import helpers
from .decorators import edxnotes
from .exceptions import EdxNotesParseError, EdxNotesServiceUnavailable
@@ -33,7 +33,7 @@ from .plugins import EdxNotesTab
from openedx.core.djangoapps.oauth_dispatch.jwt import create_jwt_for_user
from openedx.core.djangoapps.oauth_dispatch.tests.factories import ApplicationFactory
from openedx.core.djangoapps.user_api.models import RetirementState, UserRetirementStatus
-from student.tests.factories import CourseEnrollmentFactory, SuperuserFactory, UserFactory
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory, SuperuserFactory, UserFactory
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
diff --git a/lms/djangoapps/edxnotes/views.py b/lms/djangoapps/edxnotes/views.py
index 5123c84235..012503e873 100644
--- a/lms/djangoapps/edxnotes/views.py
+++ b/lms/djangoapps/edxnotes/views.py
@@ -21,7 +21,7 @@ from six import text_type
from lms.djangoapps.courseware.courses import get_course_with_access
from lms.djangoapps.courseware.model_data import FieldDataCache
from lms.djangoapps.courseware.module_render import get_module_for_descriptor
-from edxmako.shortcuts import render_to_response
+from common.djangoapps.edxmako.shortcuts import render_to_response
from lms.djangoapps.edxnotes.exceptions import EdxNotesParseError, EdxNotesServiceUnavailable
from lms.djangoapps.edxnotes.helpers import (
DEFAULT_PAGE,
@@ -35,7 +35,7 @@ from lms.djangoapps.edxnotes.helpers import (
)
from openedx.core.djangoapps.user_api.accounts.permissions import CanRetireUser
from openedx.core.djangoapps.user_api.models import RetirementStateError, UserRetirementStatus
-from util.json_request import JsonResponse, JsonResponseBadRequest
+from common.djangoapps.util.json_request import JsonResponse, JsonResponseBadRequest
log = logging.getLogger(__name__)
diff --git a/lms/djangoapps/email_marketing/signals.py b/lms/djangoapps/email_marketing/signals.py
index 82b8655394..0625919a13 100644
--- a/lms/djangoapps/email_marketing/signals.py
+++ b/lms/djangoapps/email_marketing/signals.py
@@ -14,8 +14,8 @@ from django.dispatch import receiver
from sailthru.sailthru_error import SailthruClientError
from six import text_type
-import third_party_auth
-from course_modes.models import CourseMode
+from common.djangoapps import third_party_auth
+from common.djangoapps.course_modes.models import CourseMode
from edx_toggles.toggles import WaffleSwitchNamespace
from lms.djangoapps.email_marketing.tasks import (
get_email_cookies_via_sailthru,
@@ -26,8 +26,8 @@ from lms.djangoapps.email_marketing.tasks import (
from openedx.core.djangoapps.lang_pref import LANGUAGE_KEY
from openedx.core.djangoapps.user_authn.cookies import CREATE_LOGON_COOKIE
from openedx.core.djangoapps.user_authn.views.register import REGISTER_USER
-from student.signals import SAILTHRU_AUDIT_PURCHASE
-from util.model_utils import USER_FIELD_CHANGED
+from common.djangoapps.student.signals import SAILTHRU_AUDIT_PURCHASE
+from common.djangoapps.util.model_utils import USER_FIELD_CHANGED
from .models import EmailMarketingConfiguration
diff --git a/lms/djangoapps/email_marketing/tests/test_signals.py b/lms/djangoapps/email_marketing/tests/test_signals.py
index d21c2d0e94..4e604d3c46 100644
--- a/lms/djangoapps/email_marketing/tests/test_signals.py
+++ b/lms/djangoapps/email_marketing/tests/test_signals.py
@@ -30,9 +30,9 @@ from lms.djangoapps.email_marketing.tasks import (
update_user_email
)
from openedx.core.djangoapps.lang_pref import LANGUAGE_KEY
-from student.models import Registration
-from student.tests.factories import CourseEnrollmentFactory, UserFactory, UserProfileFactory
-from util.json_request import JsonResponse
+from common.djangoapps.student.models import Registration
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory, UserFactory, UserProfileFactory
+from common.djangoapps.util.json_request import JsonResponse
from ..models import EmailMarketingConfiguration
from ..signals import (
diff --git a/lms/djangoapps/experiments/factories.py b/lms/djangoapps/experiments/factories.py
index 68ef58ccd3..8a472a2877 100644
--- a/lms/djangoapps/experiments/factories.py
+++ b/lms/djangoapps/experiments/factories.py
@@ -7,7 +7,7 @@ import factory
import factory.fuzzy
from lms.djangoapps.experiments.models import ExperimentData, ExperimentKeyValue
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
class ExperimentDataFactory(factory.DjangoModelFactory):
diff --git a/lms/djangoapps/experiments/flags.py b/lms/djangoapps/experiments/flags.py
index 81052d9cb6..645be72362 100644
--- a/lms/djangoapps/experiments/flags.py
+++ b/lms/djangoapps/experiments/flags.py
@@ -13,7 +13,7 @@ from edx_django_utils.cache import RequestCache
from lms.djangoapps.experiments.stable_bucketing import stable_bucketing_hash_group
from openedx.core.djangoapps.waffle_utils import CourseWaffleFlag
-from track import segment
+from common.djangoapps.track import segment
log = logging.getLogger(__name__)
@@ -88,7 +88,7 @@ class ExperimentWaffleFlag(CourseWaffleFlag):
def _is_enrollment_inside_date_bounds(self, experiment_values, user, course_key):
""" Returns True if the user's enrollment (if any) is valid for the configured experiment date range """
- from student.models import CourseEnrollment
+ from common.djangoapps.student.models import CourseEnrollment
enrollment_start = experiment_values.get('enrollment_start')
enrollment_end = experiment_values.get('enrollment_end')
diff --git a/lms/djangoapps/experiments/tests/test_flags.py b/lms/djangoapps/experiments/tests/test_flags.py
index 1b9ee6d6f8..0540a65c8a 100644
--- a/lms/djangoapps/experiments/tests/test_flags.py
+++ b/lms/djangoapps/experiments/tests/test_flags.py
@@ -18,7 +18,7 @@ from lms.djangoapps.experiments.flags import ExperimentWaffleFlag
from openedx.core.djangoapps.site_configuration.tests.factories import SiteFactory
from openedx.core.djangoapps.waffle_utils import CourseWaffleFlag
from openedx.core.djangoapps.waffle_utils.models import WaffleFlagCourseOverrideModel
-from student.tests.factories import CourseEnrollmentFactory, UserFactory
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory, UserFactory
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
diff --git a/lms/djangoapps/experiments/tests/test_utils.py b/lms/djangoapps/experiments/tests/test_utils.py
index f347975423..9459b263e4 100644
--- a/lms/djangoapps/experiments/tests/test_utils.py
+++ b/lms/djangoapps/experiments/tests/test_utils.py
@@ -17,7 +17,7 @@ from lms.djangoapps.experiments.utils import (
get_unenrolled_courses,
is_enrolled_in_course_run
)
-from student.tests.factories import CourseEnrollmentFactory, UserFactory
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory, UserFactory
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/lms/djangoapps/experiments/tests/test_views.py b/lms/djangoapps/experiments/tests/test_views.py
index e5945dd5aa..101369e8ac 100644
--- a/lms/djangoapps/experiments/tests/test_views.py
+++ b/lms/djangoapps/experiments/tests/test_views.py
@@ -21,7 +21,7 @@ from rest_framework.test import APITestCase
from lms.djangoapps.experiments.factories import ExperimentDataFactory, ExperimentKeyValueFactory
from lms.djangoapps.experiments.models import ExperimentData, ExperimentKeyValue
from lms.djangoapps.experiments.serializers import ExperimentDataSerializer
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/lms/djangoapps/experiments/tests/test_views_custom.py b/lms/djangoapps/experiments/tests/test_views_custom.py
index 597f8b9991..c83bc77d75 100644
--- a/lms/djangoapps/experiments/tests/test_views_custom.py
+++ b/lms/djangoapps/experiments/tests/test_views_custom.py
@@ -11,12 +11,12 @@ from django.urls import reverse
from django.utils.timezone import now
from rest_framework.test import APITestCase
-from course_modes.models import CourseMode
-from course_modes.tests.factories import CourseModeFactory
+from common.djangoapps.course_modes.models import CourseMode
+from common.djangoapps.course_modes.tests.factories import CourseModeFactory
from edx_toggles.toggles.testutils import override_waffle_flag
from lms.djangoapps.course_blocks.transformers.tests.helpers import ModuleStoreTestCase
from lms.djangoapps.experiments.views_custom import MOBILE_UPSELL_FLAG
-from student.tests.factories import CourseEnrollmentFactory, UserFactory
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory, UserFactory
from xmodule.modulestore.tests.factories import CourseFactory
CROSS_DOMAIN_REFERER = 'https://ecommerce.edx.org'
diff --git a/lms/djangoapps/experiments/utils.py b/lms/djangoapps/experiments/utils.py
index b38f49cfdd..a18a51fd51 100644
--- a/lms/djangoapps/experiments/utils.py
+++ b/lms/djangoapps/experiments/utils.py
@@ -11,9 +11,9 @@ from django.utils.timezone import now
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
-from course_modes.models import CourseMode, format_course_price, get_cosmetic_verified_display_price
+from common.djangoapps.course_modes.models import format_course_price, get_cosmetic_verified_display_price, CourseMode
from edx_toggles.toggles import WaffleFlag, WaffleFlagNamespace
-from entitlements.models import CourseEntitlement
+from common.djangoapps.entitlements.models import CourseEntitlement
from lms.djangoapps.commerce.utils import EcommerceService
from lms.djangoapps.courseware.access import has_staff_access_to_preview_mode
from lms.djangoapps.courseware.utils import can_show_verified_upgrade, verified_upgrade_deadline_link
@@ -21,7 +21,7 @@ from openedx.core.djangoapps.catalog.utils import get_programs
from openedx.core.djangoapps.django_comment_common.models import Role
from openedx.core.djangoapps.schedules.models import Schedule
from openedx.features.course_duration_limits.access import get_user_course_duration, get_user_course_expiration_date
-from student.models import CourseEnrollment
+from common.djangoapps.student.models import CourseEnrollment
from xmodule.partitions.partitions_service import get_all_partitions_for_course, get_user_partition_groups
# Import this for backwards compatibility (so that anyone importing this function from here doesn't break)
diff --git a/lms/djangoapps/experiments/views.py b/lms/djangoapps/experiments/views.py
index caa6eacb0f..3d26c0d806 100644
--- a/lms/djangoapps/experiments/views.py
+++ b/lms/djangoapps/experiments/views.py
@@ -14,14 +14,14 @@ from opaque_keys.edx.keys import CourseKey
from rest_framework import permissions, viewsets
from rest_framework.response import Response
from rest_framework.views import APIView
-from util.json_request import JsonResponse
+from common.djangoapps.util.json_request import JsonResponse
from lms.djangoapps.experiments import filters, serializers
from lms.djangoapps.experiments.models import ExperimentData, ExperimentKeyValue
from lms.djangoapps.experiments.permissions import IsStaffOrOwner, IsStaffOrReadOnly, IsStaffOrReadOnlyForSelf
from lms.djangoapps.experiments.utils import get_experiment_user_metadata_context
from openedx.core.djangoapps.cors_csrf.authentication import SessionAuthenticationCrossDomainCsrf
-from student.models import get_user_by_username_or_email
+from common.djangoapps.student.models import get_user_by_username_or_email
User = get_user_model() # pylint: disable=invalid-name
diff --git a/lms/djangoapps/experiments/views_custom.py b/lms/djangoapps/experiments/views_custom.py
index 50c9a104eb..a1ba0d21ec 100644
--- a/lms/djangoapps/experiments/views_custom.py
+++ b/lms/djangoapps/experiments/views_custom.py
@@ -15,7 +15,7 @@ from opaque_keys.edx.keys import CourseKey
from rest_framework.response import Response
from rest_framework.views import APIView
-from course_modes.models import get_cosmetic_verified_display_price
+from common.djangoapps.course_modes.models import get_cosmetic_verified_display_price
from edx_toggles.toggles import WaffleFlag, WaffleFlagNamespace
from lms.djangoapps.commerce.utils import EcommerceService
from lms.djangoapps.courseware.utils import can_show_verified_upgrade
@@ -25,8 +25,8 @@ from openedx.core.djangoapps.cors_csrf.decorators import ensure_csrf_cookie_cros
from openedx.core.lib.api.authentication import BearerAuthenticationAllowInactiveUser
from openedx.core.lib.api.permissions import ApiKeyHeaderPermissionIsAuthenticated
from openedx.core.lib.api.view_utils import DeveloperErrorViewMixin
-from student.models import CourseEnrollment
-from track import segment
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.track import segment
# .. toggle_name: experiments.mobile_upsell_rev934
# .. toggle_implementation: WaffleFlag
diff --git a/lms/djangoapps/gating/api.py b/lms/djangoapps/gating/api.py
index 9ee405f5fa..a8d2d89891 100644
--- a/lms/djangoapps/gating/api.py
+++ b/lms/djangoapps/gating/api.py
@@ -10,7 +10,7 @@ from opaque_keys.edx.keys import UsageKey
from lms.djangoapps.courseware.entrance_exams import get_entrance_exam_content
from openedx.core.lib.gating import api as gating_api
-from util import milestones_helpers
+from common.djangoapps.util import milestones_helpers
from openedx.core.toggles import ENTRANCE_EXAMS
log = logging.getLogger(__name__)
diff --git a/lms/djangoapps/gating/tests/test_integration.py b/lms/djangoapps/gating/tests/test_integration.py
index f98b89ba2d..99d86e282d 100644
--- a/lms/djangoapps/gating/tests/test_integration.py
+++ b/lms/djangoapps/gating/tests/test_integration.py
@@ -16,7 +16,7 @@ from lms.djangoapps.grades.api import CourseGradeFactory
from lms.djangoapps.grades.tests.utils import answer_problem
from openedx.core.djangolib.testing.utils import get_mock_request
from openedx.core.lib.gating import api as gating_api
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
diff --git a/lms/djangoapps/gating/tests/test_signals.py b/lms/djangoapps/gating/tests/test_signals.py
index 42c99fe5d6..bb773a4aaf 100644
--- a/lms/djangoapps/gating/tests/test_signals.py
+++ b/lms/djangoapps/gating/tests/test_signals.py
@@ -6,7 +6,7 @@ Unit tests for gating.signals module
from mock import Mock, patch
from lms.djangoapps.gating.signals import evaluate_subsection_gated_milestones
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/lms/djangoapps/grades/api.py b/lms/djangoapps/grades/api.py
index 3c2de86d1d..f8ef149e48 100644
--- a/lms/djangoapps/grades/api.py
+++ b/lms/djangoapps/grades/api.py
@@ -27,7 +27,7 @@ from lms.djangoapps.grades.subsection_grade_factory import SubsectionGradeFactor
from lms.djangoapps.grades.tasks import compute_all_grades_for_course as task_compute_all_grades_for_course
from lms.djangoapps.grades.util_services import GradesUtilService
from lms.djangoapps.utils import _get_key
-from track.event_transaction_utils import create_new_event_transaction_id, set_event_transaction_type
+from common.djangoapps.track.event_transaction_utils import create_new_event_transaction_id, set_event_transaction_type
def graded_subsections_for_course_id(course_id):
diff --git a/lms/djangoapps/grades/events.py b/lms/djangoapps/grades/events.py
index 6f55ab177c..e4eb672965 100644
--- a/lms/djangoapps/grades/events.py
+++ b/lms/djangoapps/grades/events.py
@@ -7,8 +7,8 @@ import six
from crum import get_current_user
from eventtracking import tracker
-from track import contexts
-from track.event_transaction_utils import (
+from common.djangoapps.track import contexts
+from common.djangoapps.track.event_transaction_utils import (
create_new_event_transaction_id,
get_event_transaction_id,
get_event_transaction_type,
diff --git a/lms/djangoapps/grades/management/commands/recalculate_subsection_grades.py b/lms/djangoapps/grades/management/commands/recalculate_subsection_grades.py
index f08a05b3f7..3a2bc8de73 100644
--- a/lms/djangoapps/grades/management/commands/recalculate_subsection_grades.py
+++ b/lms/djangoapps/grades/management/commands/recalculate_subsection_grades.py
@@ -16,9 +16,9 @@ from lms.djangoapps.courseware.models import StudentModule
from lms.djangoapps.grades.constants import ScoreDatabaseTableEnum
from lms.djangoapps.grades.events import PROBLEM_SUBMITTED_EVENT_TYPE
from lms.djangoapps.grades.tasks import recalculate_subsection_grade_v3
-from student.models import user_by_anonymous_id
-from track.event_transaction_utils import create_new_event_transaction_id, set_event_transaction_type
-from util.date_utils import to_timestamp
+from common.djangoapps.student.models import user_by_anonymous_id
+from common.djangoapps.track.event_transaction_utils import create_new_event_transaction_id, set_event_transaction_type
+from common.djangoapps.util.date_utils import to_timestamp
log = logging.getLogger(__name__)
diff --git a/lms/djangoapps/grades/management/commands/tests/test_compute_grades.py b/lms/djangoapps/grades/management/commands/tests/test_compute_grades.py
index 12e86c09d1..7ca5fb9dad 100644
--- a/lms/djangoapps/grades/management/commands/tests/test_compute_grades.py
+++ b/lms/djangoapps/grades/management/commands/tests/test_compute_grades.py
@@ -14,7 +14,7 @@ from mock import ANY, patch
from lms.djangoapps.grades.config.models import ComputeGradesSetting
from lms.djangoapps.grades.management.commands import compute_grades
-from student.models import CourseEnrollment
+from common.djangoapps.student.models import CourseEnrollment
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/lms/djangoapps/grades/management/commands/tests/test_recalculate_learner_grades.py b/lms/djangoapps/grades/management/commands/tests/test_recalculate_learner_grades.py
index c50e2bbac6..fd3a60ee0b 100644
--- a/lms/djangoapps/grades/management/commands/tests/test_recalculate_learner_grades.py
+++ b/lms/djangoapps/grades/management/commands/tests/test_recalculate_learner_grades.py
@@ -9,7 +9,7 @@ import mock
from lms.djangoapps.grades.management.commands import recalculate_learner_grades
from lms.djangoapps.grades.tests.test_tasks import HasCourseWithProblemsMixin
-from student.tests.factories import CourseEnrollmentFactory, UserFactory
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory, UserFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/lms/djangoapps/grades/management/commands/tests/test_recalculate_subsection_grades.py b/lms/djangoapps/grades/management/commands/tests/test_recalculate_subsection_grades.py
index 7d4a56aca8..9ff5b72f7a 100644
--- a/lms/djangoapps/grades/management/commands/tests/test_recalculate_subsection_grades.py
+++ b/lms/djangoapps/grades/management/commands/tests/test_recalculate_subsection_grades.py
@@ -15,8 +15,8 @@ from pytz import utc
from lms.djangoapps.grades.constants import ScoreDatabaseTableEnum
from lms.djangoapps.grades.management.commands import recalculate_subsection_grades
from lms.djangoapps.grades.tests.test_tasks import HasCourseWithProblemsMixin
-from track.event_transaction_utils import get_event_transaction_id
-from util.date_utils import to_timestamp
+from common.djangoapps.track.event_transaction_utils import get_event_transaction_id
+from common.djangoapps.util.date_utils import to_timestamp
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
DATE_FORMAT = u"%Y-%m-%d %H:%M"
diff --git a/lms/djangoapps/grades/rest_api/v1/gradebook_views.py b/lms/djangoapps/grades/rest_api/v1/gradebook_views.py
index 05b97cacd5..c94098844e 100644
--- a/lms/djangoapps/grades/rest_api/v1/gradebook_views.py
+++ b/lms/djangoapps/grades/rest_api/v1/gradebook_views.py
@@ -58,16 +58,16 @@ from openedx.core.lib.api.view_utils import (
view_auth_classes
)
from openedx.core.lib.cache_utils import request_cached
-from student.auth import has_course_author_access
-from student.models import CourseEnrollment
-from student.roles import BulkRoleCache
-from track.event_transaction_utils import (
+from common.djangoapps.student.auth import has_course_author_access
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.student.roles import BulkRoleCache
+from common.djangoapps.track.event_transaction_utils import (
create_new_event_transaction_id,
get_event_transaction_id,
get_event_transaction_type,
set_event_transaction_type
)
-from util.date_utils import to_timestamp
+from common.djangoapps.util.date_utils import to_timestamp
from xmodule.modulestore.django import modulestore
from xmodule.util.misc import get_default_short_labeler
diff --git a/lms/djangoapps/grades/rest_api/v1/tests/mixins.py b/lms/djangoapps/grades/rest_api/v1/tests/mixins.py
index 695737e2c7..f0967fa510 100644
--- a/lms/djangoapps/grades/rest_api/v1/tests/mixins.py
+++ b/lms/djangoapps/grades/rest_api/v1/tests/mixins.py
@@ -11,7 +11,7 @@ from six.moves import range
from lms.djangoapps.courseware.tests.factories import GlobalStaffFactory
from lms.djangoapps.program_enrollments.tests.factories import ProgramEnrollmentFactory, ProgramCourseEnrollmentFactory
from openedx.core.djangoapps.content.course_overviews.tests.factories import CourseOverviewFactory
-from student.tests.factories import CourseEnrollmentFactory, UserFactory
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory, UserFactory
from xmodule.modulestore.tests.django_utils import TEST_DATA_SPLIT_MODULESTORE, SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
diff --git a/lms/djangoapps/grades/rest_api/v1/tests/test_gradebook_views.py b/lms/djangoapps/grades/rest_api/v1/tests/test_gradebook_views.py
index 14b46691df..d1cfe7e025 100644
--- a/lms/djangoapps/grades/rest_api/v1/tests/test_gradebook_views.py
+++ b/lms/djangoapps/grades/rest_api/v1/tests/test_gradebook_views.py
@@ -17,7 +17,7 @@ from rest_framework import status
from rest_framework.test import APITestCase
from six import text_type
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from edx_toggles.toggles.testutils import override_waffle_flag
from lms.djangoapps.certificates.models import CertificateStatuses, GeneratedCertificate
from lms.djangoapps.courseware.tests.factories import InstructorFactory, StaffFactory
@@ -37,7 +37,7 @@ from lms.djangoapps.grades.rest_api.v1.views import CourseEnrollmentPagination
from lms.djangoapps.grades.subsection_grade import ReadSubsectionGrade
from openedx.core.djangoapps.content.course_overviews.tests.factories import CourseOverviewFactory
from openedx.core.djangoapps.course_groups.tests.helpers import CohortFactory
-from student.tests.factories import CourseEnrollmentFactory, UserFactory
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory, UserFactory
from xmodule.modulestore.tests.django_utils import TEST_DATA_SPLIT_MODULESTORE, SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
diff --git a/lms/djangoapps/grades/rest_api/v1/tests/test_grading_policy_view.py b/lms/djangoapps/grades/rest_api/v1/tests/test_grading_policy_view.py
index 0fab8487ba..4e75b3cb3b 100644
--- a/lms/djangoapps/grades/rest_api/v1/tests/test_grading_policy_view.py
+++ b/lms/djangoapps/grades/rest_api/v1/tests/test_grading_policy_view.py
@@ -13,7 +13,7 @@ from pytz import UTC
from openedx.core.djangoapps.oauth_dispatch.tests.factories import ApplicationFactory, AccessTokenFactory
from capa.tests.response_xml_factory import MultipleChoiceResponseXMLFactory
from lms.djangoapps.courseware.tests.factories import GlobalStaffFactory, StaffFactory
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
diff --git a/lms/djangoapps/grades/rest_api/v1/tests/test_views.py b/lms/djangoapps/grades/rest_api/v1/tests/test_views.py
index 9c89bf4d94..d6de94533b 100644
--- a/lms/djangoapps/grades/rest_api/v1/tests/test_views.py
+++ b/lms/djangoapps/grades/rest_api/v1/tests/test_views.py
@@ -15,7 +15,7 @@ from rest_framework.test import APITestCase
from lms.djangoapps.grades.rest_api.v1.tests.mixins import GradeViewTestMixin
from lms.djangoapps.grades.rest_api.v1.views import CourseGradesView
from openedx.core.djangoapps.user_authn.tests.utils import AuthAndScopesTestMixin
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
@ddt.ddt
diff --git a/lms/djangoapps/grades/rest_api/v1/utils.py b/lms/djangoapps/grades/rest_api/v1/utils.py
index 4c2fd9af50..bdf9bba1a1 100644
--- a/lms/djangoapps/grades/rest_api/v1/utils.py
+++ b/lms/djangoapps/grades/rest_api/v1/utils.py
@@ -14,8 +14,8 @@ from rest_framework.response import Response
from lms.djangoapps.grades.course_grade_factory import CourseGradeFactory
from openedx.core.lib.api.view_utils import DeveloperErrorViewMixin
-from student.models import CourseEnrollment
-from util.query import use_read_replica_if_available
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.util.query import use_read_replica_if_available
USER_MODEL = get_user_model()
diff --git a/lms/djangoapps/grades/signals/handlers.py b/lms/djangoapps/grades/signals/handlers.py
index 887f0f5022..b56f69f911 100644
--- a/lms/djangoapps/grades/signals/handlers.py
+++ b/lms/djangoapps/grades/signals/handlers.py
@@ -15,10 +15,10 @@ from xblock.scorable import ScorableXBlockMixin, Score
from lms.djangoapps.courseware.model_data import get_score, set_score
from openedx.core.djangoapps.course_groups.signals.signals import COHORT_MEMBERSHIP_UPDATED
from openedx.core.lib.grade_utils import is_score_higher_or_equal
-from student.models import user_by_anonymous_id
-from student.signals import ENROLLMENT_TRACK_UPDATED
-from track.event_transaction_utils import get_event_transaction_id, get_event_transaction_type
-from util.date_utils import to_timestamp
+from common.djangoapps.student.models import user_by_anonymous_id
+from common.djangoapps.student.signals import ENROLLMENT_TRACK_UPDATED
+from common.djangoapps.track.event_transaction_utils import get_event_transaction_id, get_event_transaction_type
+from common.djangoapps.util.date_utils import to_timestamp
from .. import events
from ..constants import ScoreDatabaseTableEnum
diff --git a/lms/djangoapps/grades/subsection_grade_factory.py b/lms/djangoapps/grades/subsection_grade_factory.py
index 50e82cad28..35b6047c2f 100644
--- a/lms/djangoapps/grades/subsection_grade_factory.py
+++ b/lms/djangoapps/grades/subsection_grade_factory.py
@@ -14,7 +14,7 @@ from lms.djangoapps.grades.config import assume_zero_if_absent, should_persist_g
from lms.djangoapps.grades.models import PersistentSubsectionGrade
from lms.djangoapps.grades.scores import possibly_scored
from openedx.core.lib.grade_utils import is_score_higher_or_equal
-from student.models import anonymous_id_for_user
+from common.djangoapps.student.models import anonymous_id_for_user
from .course_data import CourseData
from .subsection_grade import CreateSubsectionGrade, ReadSubsectionGrade, ZeroSubsectionGrade
diff --git a/lms/djangoapps/grades/tasks.py b/lms/djangoapps/grades/tasks.py
index cbd517f9c1..a2dafd3e6e 100644
--- a/lms/djangoapps/grades/tasks.py
+++ b/lms/djangoapps/grades/tasks.py
@@ -21,9 +21,9 @@ from lms.djangoapps.courseware.model_data import get_score
from lms.djangoapps.course_blocks.api import get_course_blocks
from lms.djangoapps.grades.config.models import ComputeGradesSetting
from openedx.core.djangoapps.content.course_overviews.models import CourseOverview
-from student.models import CourseEnrollment
-from track.event_transaction_utils import set_event_transaction_id, set_event_transaction_type
-from util.date_utils import from_timestamp
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.track.event_transaction_utils import set_event_transaction_id, set_event_transaction_type
+from common.djangoapps.util.date_utils import from_timestamp
from xmodule.modulestore.django import modulestore
from .config.waffle import DISABLE_REGRADE_ON_POLICY_CHANGE, waffle
diff --git a/lms/djangoapps/grades/tests/base.py b/lms/djangoapps/grades/tests/base.py
index 17146e1cc6..2e362b3c66 100644
--- a/lms/djangoapps/grades/tests/base.py
+++ b/lms/djangoapps/grades/tests/base.py
@@ -8,8 +8,8 @@ from crum import set_current_request
from capa.tests.response_xml_factory import MultipleChoiceResponseXMLFactory
from lms.djangoapps.course_blocks.api import get_course_blocks
from openedx.core.djangolib.testing.utils import get_mock_request
-from student.models import CourseEnrollment
-from student.tests.factories import UserFactory
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
diff --git a/lms/djangoapps/grades/tests/integration/test_access.py b/lms/djangoapps/grades/tests/integration/test_access.py
index b426b37d10..e966671a3d 100644
--- a/lms/djangoapps/grades/tests/integration/test_access.py
+++ b/lms/djangoapps/grades/tests/integration/test_access.py
@@ -9,8 +9,8 @@ from capa.tests.response_xml_factory import MultipleChoiceResponseXMLFactory
from lms.djangoapps.courseware.tests.test_submitting_problems import ProblemSubmissionTestMixin
from lms.djangoapps.course_blocks.api import get_course_blocks
from openedx.core.djangolib.testing.utils import get_mock_request
-from student.models import CourseEnrollment
-from student.tests.factories import UserFactory
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
diff --git a/lms/djangoapps/grades/tests/integration/test_events.py b/lms/djangoapps/grades/tests/integration/test_events.py
index fdcc3069eb..f6f488e0e7 100644
--- a/lms/djangoapps/grades/tests/integration/test_events.py
+++ b/lms/djangoapps/grades/tests/integration/test_events.py
@@ -13,8 +13,8 @@ from lms.djangoapps.courseware.tests.test_submitting_problems import ProblemSubm
from lms.djangoapps.instructor.enrollment import reset_student_attempts
from lms.djangoapps.instructor_task.api import submit_rescore_problem_for_student
from openedx.core.djangolib.testing.utils import get_mock_request
-from student.models import CourseEnrollment
-from student.tests.factories import UserFactory
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
diff --git a/lms/djangoapps/grades/tests/integration/test_problems.py b/lms/djangoapps/grades/tests/integration/test_problems.py
index ae1815b092..675ee26d54 100644
--- a/lms/djangoapps/grades/tests/integration/test_problems.py
+++ b/lms/djangoapps/grades/tests/integration/test_problems.py
@@ -10,8 +10,8 @@ from capa.tests.response_xml_factory import MultipleChoiceResponseXMLFactory
from lms.djangoapps.courseware.tests.test_submitting_problems import ProblemSubmissionTestMixin
from lms.djangoapps.course_blocks.api import get_course_blocks
from openedx.core.djangolib.testing.utils import get_mock_request
-from student.models import CourseEnrollment
-from student.tests.factories import UserFactory
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.graders import ProblemScore
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, SharedModuleStoreTestCase
diff --git a/lms/djangoapps/grades/tests/test_api.py b/lms/djangoapps/grades/tests/test_api.py
index 6a97ef9496..681d022e42 100644
--- a/lms/djangoapps/grades/tests/test_api.py
+++ b/lms/djangoapps/grades/tests/test_api.py
@@ -9,7 +9,7 @@ from lms.djangoapps.grades.models import (
PersistentSubsectionGrade,
PersistentSubsectionGradeOverride,
)
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
diff --git a/lms/djangoapps/grades/tests/test_course_data.py b/lms/djangoapps/grades/tests/test_course_data.py
index bf6c08e73f..b305a6cc2f 100644
--- a/lms/djangoapps/grades/tests/test_course_data.py
+++ b/lms/djangoapps/grades/tests/test_course_data.py
@@ -8,7 +8,7 @@ from mock import patch
from lms.djangoapps.course_blocks.api import get_course_blocks
from openedx.core.djangoapps.content.block_structure.api import get_course_in_cache
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/lms/djangoapps/grades/tests/test_course_grade.py b/lms/djangoapps/grades/tests/test_course_grade.py
index bf8fd188af..3b867ca75e 100644
--- a/lms/djangoapps/grades/tests/test_course_grade.py
+++ b/lms/djangoapps/grades/tests/test_course_grade.py
@@ -6,8 +6,8 @@ from mock import patch
from edx_toggles.toggles.testutils import override_waffle_switch
from openedx.core.djangolib.testing.utils import get_mock_request
-from student.models import CourseEnrollment
-from student.tests.factories import UserFactory
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
diff --git a/lms/djangoapps/grades/tests/test_course_grade_factory.py b/lms/djangoapps/grades/tests/test_course_grade_factory.py
index 4ced0b961a..c410729a0a 100644
--- a/lms/djangoapps/grades/tests/test_course_grade_factory.py
+++ b/lms/djangoapps/grades/tests/test_course_grade_factory.py
@@ -13,7 +13,7 @@ from edx_toggles.toggles.testutils import override_waffle_switch
from lms.djangoapps.courseware.access import has_access
from lms.djangoapps.grades.config.tests.utils import persistent_grades_feature_flags
from openedx.core.djangoapps.content.block_structure.factory import BlockStructureFactory
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/lms/djangoapps/grades/tests/test_models.py b/lms/djangoapps/grades/tests/test_models.py
index 2a071f6ba5..44fc05ffee 100644
--- a/lms/djangoapps/grades/tests/test_models.py
+++ b/lms/djangoapps/grades/tests/test_models.py
@@ -30,8 +30,8 @@ from lms.djangoapps.grades.models import (
PersistentSubsectionGradeOverride,
VisibleBlocks
)
-from student.tests.factories import UserFactory
-from track.event_transaction_utils import get_event_transaction_id, get_event_transaction_type
+from common.djangoapps.student.tests.factories import UserFactory
+from common.djangoapps.track.event_transaction_utils import get_event_transaction_id, get_event_transaction_type
class BlockRecordListTestCase(TestCase):
diff --git a/lms/djangoapps/grades/tests/test_services.py b/lms/djangoapps/grades/tests/test_services.py
index 5da2fea458..99c934412d 100644
--- a/lms/djangoapps/grades/tests/test_services.py
+++ b/lms/djangoapps/grades/tests/test_services.py
@@ -17,7 +17,7 @@ from lms.djangoapps.grades.models import (
PersistentSubsectionGradeOverride
)
from lms.djangoapps.grades.services import GradesService
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
diff --git a/lms/djangoapps/grades/tests/test_signals.py b/lms/djangoapps/grades/tests/test_signals.py
index 3474c85a42..a434dc24af 100644
--- a/lms/djangoapps/grades/tests/test_signals.py
+++ b/lms/djangoapps/grades/tests/test_signals.py
@@ -12,7 +12,7 @@ from django.test import TestCase
from mock import MagicMock, patch
from submissions.models import score_reset, score_set
-from util.date_utils import to_timestamp
+from common.djangoapps.util.date_utils import to_timestamp
from ..constants import ScoreDatabaseTableEnum
from ..signals.handlers import (
diff --git a/lms/djangoapps/grades/tests/test_subsection_grade_factory.py b/lms/djangoapps/grades/tests/test_subsection_grade_factory.py
index 6e94df6741..c3390b716a 100644
--- a/lms/djangoapps/grades/tests/test_subsection_grade_factory.py
+++ b/lms/djangoapps/grades/tests/test_subsection_grade_factory.py
@@ -9,7 +9,7 @@ from mock import patch
from lms.djangoapps.courseware.tests.test_submitting_problems import ProblemSubmissionTestMixin
from lms.djangoapps.grades.config.tests.utils import persistent_grades_feature_flags
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from ..constants import GradeOverrideFeatureEnum
from ..models import PersistentSubsectionGrade, PersistentSubsectionGradeOverride
diff --git a/lms/djangoapps/grades/tests/test_tasks.py b/lms/djangoapps/grades/tests/test_tasks.py
index 50b7dd087d..13e95d2288 100644
--- a/lms/djangoapps/grades/tests/test_tasks.py
+++ b/lms/djangoapps/grades/tests/test_tasks.py
@@ -34,10 +34,10 @@ from lms.djangoapps.grades.tasks import (
recalculate_subsection_grade_v3
)
from openedx.core.djangoapps.content.block_structure.exceptions import BlockStructureNotFound
-from student.models import CourseEnrollment, anonymous_id_for_user
-from student.tests.factories import UserFactory
-from track.event_transaction_utils import create_new_event_transaction_id, get_event_transaction_id
-from util.date_utils import to_timestamp
+from common.djangoapps.student.models import CourseEnrollment, anonymous_id_for_user
+from common.djangoapps.student.tests.factories import UserFactory
+from common.djangoapps.track.event_transaction_utils import create_new_event_transaction_id, get_event_transaction_id
+from common.djangoapps.util.date_utils import to_timestamp
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
diff --git a/lms/djangoapps/grades/tests/test_transformer.py b/lms/djangoapps/grades/tests/test_transformer.py
index 4e3180f155..a3c38d7e05 100644
--- a/lms/djangoapps/grades/tests/test_transformer.py
+++ b/lms/djangoapps/grades/tests/test_transformer.py
@@ -15,7 +15,7 @@ from six.moves import range
from lms.djangoapps.course_blocks.api import get_course_blocks
from lms.djangoapps.course_blocks.transformers.tests.helpers import CourseStructureTestCase
from openedx.core.djangoapps.content.block_structure.api import clear_course_from_cache
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
diff --git a/lms/djangoapps/instructor/access.py b/lms/djangoapps/instructor/access.py
index fbb431b401..5ea7bde8b6 100644
--- a/lms/djangoapps/instructor/access.py
+++ b/lms/djangoapps/instructor/access.py
@@ -14,7 +14,7 @@ import logging
from lms.djangoapps.instructor.enrollment import enroll_email, get_email_params
from openedx.core.djangoapps.django_comment_common.models import Role
-from student.roles import (
+from common.djangoapps.student.roles import (
CourseBetaTesterRole, CourseCcxCoachRole, CourseDataResearcherRole,
CourseInstructorRole, CourseStaffRole
)
diff --git a/lms/djangoapps/instructor/enrollment.py b/lms/djangoapps/instructor/enrollment.py
index 74a821236f..d36049f1a2 100644
--- a/lms/djangoapps/instructor/enrollment.py
+++ b/lms/djangoapps/instructor/enrollment.py
@@ -24,7 +24,7 @@ from six import text_type
from submissions import api as sub_api # installed from the edx-submissions repository
from submissions.models import score_set
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from lms.djangoapps.courseware.models import StudentModule
from lms.djangoapps.grades.api import constants as grades_constants
from lms.djangoapps.grades.api import disconnect_submissions_signal_receiver
@@ -43,8 +43,8 @@ from openedx.core.djangoapps.lang_pref import LANGUAGE_KEY
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
from openedx.core.djangoapps.user_api.models import UserPreference
from openedx.core.djangolib.markup import Text
-from student.models import CourseEnrollment, CourseEnrollmentAllowed, anonymous_id_for_user, is_email_retired
-from track.event_transaction_utils import (
+from common.djangoapps.student.models import CourseEnrollment, CourseEnrollmentAllowed, anonymous_id_for_user, is_email_retired
+from common.djangoapps.track.event_transaction_utils import (
create_new_event_transaction_id,
get_event_transaction_id,
set_event_transaction_type
diff --git a/lms/djangoapps/instructor/services.py b/lms/djangoapps/instructor/services.py
index 4e611cacd3..22e19aff6a 100644
--- a/lms/djangoapps/instructor/services.py
+++ b/lms/djangoapps/instructor/services.py
@@ -14,8 +14,8 @@ import lms.djangoapps.instructor.enrollment as enrollment
from lms.djangoapps.courseware.models import StudentModule
from lms.djangoapps.commerce.utils import create_zendesk_ticket
from lms.djangoapps.instructor.views.tools import get_student_from_identifier
-from student import auth
-from student.roles import CourseStaffRole
+from common.djangoapps.student import auth
+from common.djangoapps.student.roles import CourseStaffRole
from xmodule.modulestore.django import modulestore
log = logging.getLogger(__name__)
diff --git a/lms/djangoapps/instructor/tests/test_access.py b/lms/djangoapps/instructor/tests/test_access.py
index c5ed16a1b8..12b49c5900 100644
--- a/lms/djangoapps/instructor/tests/test_access.py
+++ b/lms/djangoapps/instructor/tests/test_access.py
@@ -9,8 +9,8 @@ from six.moves import range
from lms.djangoapps.instructor.access import allow_access, list_with_level, revoke_access, update_forum_role
from openedx.core.djangoapps.ace_common.tests.mixins import EmailTemplateTagMixin
from openedx.core.djangoapps.django_comment_common.models import FORUM_ROLE_MODERATOR, Role
-from student.roles import CourseBetaTesterRole, CourseCcxCoachRole, CourseStaffRole
-from student.tests.factories import UserFactory
+from common.djangoapps.student.roles import CourseBetaTesterRole, CourseCcxCoachRole, CourseStaffRole
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/lms/djangoapps/instructor/tests/test_api.py b/lms/djangoapps/instructor/tests/test_api.py
index 118c6de830..4bb6c61379 100644
--- a/lms/djangoapps/instructor/tests/test_api.py
+++ b/lms/djangoapps/instructor/tests/test_api.py
@@ -34,8 +34,8 @@ from six.moves import range, zip
from testfixtures import LogCapture
from lms.djangoapps.bulk_email.models import BulkEmailFlag, CourseEmail, CourseEmailTemplate
-from course_modes.models import CourseMode
-from course_modes.tests.factories import CourseModeFactory
+from common.djangoapps.course_modes.models import CourseMode
+from common.djangoapps.course_modes.tests.factories import CourseModeFactory
from edx_toggles.toggles.testutils import override_waffle_flag
from lms.djangoapps.certificates.api import generate_user_certificates
from lms.djangoapps.certificates.models import CertificateStatuses
@@ -72,7 +72,7 @@ from openedx.core.djangoapps.site_configuration.tests.mixins import SiteMixin
from openedx.core.lib.teams_config import TeamsConfig
from openedx.core.lib.xblock_utils import grade_histogram
from openedx.features.course_experience import RELATIVE_DATES_FLAG
-from student.models import (
+from common.djangoapps.student.models import (
ALLOWEDTOENROLL_TO_ENROLLED,
ALLOWEDTOENROLL_TO_UNENROLLED,
ENROLLED_TO_ENROLLED,
@@ -87,14 +87,14 @@ from student.models import (
get_retired_email_by_email,
get_retired_username_by_username
)
-from student.roles import (
+from common.djangoapps.student.roles import (
CourseBetaTesterRole,
CourseDataResearcherRole,
CourseFinanceAdminRole,
CourseInstructorRole,
CourseSalesAdminRole
)
-from student.tests.factories import AdminFactory, UserFactory
+from common.djangoapps.student.tests.factories import AdminFactory, UserFactory
from xmodule.fields import Date
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, SharedModuleStoreTestCase
diff --git a/lms/djangoapps/instructor/tests/test_api_email_localization.py b/lms/djangoapps/instructor/tests/test_api_email_localization.py
index 1c2a72cdb3..473878dcdf 100644
--- a/lms/djangoapps/instructor/tests/test_api_email_localization.py
+++ b/lms/djangoapps/instructor/tests/test_api_email_localization.py
@@ -12,8 +12,8 @@ from six import text_type
from lms.djangoapps.courseware.tests.factories import InstructorFactory
from openedx.core.djangoapps.lang_pref import LANGUAGE_KEY
from openedx.core.djangoapps.user_api.preferences.api import delete_user_preference, set_user_preference
-from student.models import CourseEnrollment
-from student.tests.factories import UserFactory
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/lms/djangoapps/instructor/tests/test_certificates.py b/lms/djangoapps/instructor/tests/test_certificates.py
index 0597f1cd12..36600486fa 100644
--- a/lms/djangoapps/instructor/tests/test_certificates.py
+++ b/lms/djangoapps/instructor/tests/test_certificates.py
@@ -18,7 +18,7 @@ from django.test.utils import override_settings
from django.urls import reverse
from capa.xqueue_interface import XQueueInterface
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from lms.djangoapps.courseware.tests.factories import GlobalStaffFactory, InstructorFactory, UserFactory
from lms.djangoapps.certificates import api as certs_api
from lms.djangoapps.certificates.models import (
@@ -36,7 +36,7 @@ from lms.djangoapps.certificates.tests.factories import (
from lms.djangoapps.grades.tests.utils import mock_passing_grade
from lms.djangoapps.verify_student.services import IDVerificationService
from lms.djangoapps.verify_student.tests.factories import SoftwareSecurePhotoVerificationFactory
-from student.models import CourseEnrollment
+from common.djangoapps.student.models import CourseEnrollment
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/lms/djangoapps/instructor/tests/test_email.py b/lms/djangoapps/instructor/tests/test_email.py
index bb70ad370f..72fc6bb525 100644
--- a/lms/djangoapps/instructor/tests/test_email.py
+++ b/lms/djangoapps/instructor/tests/test_email.py
@@ -12,7 +12,7 @@ from six import text_type
from lms.djangoapps.bulk_email.api import is_bulk_email_enabled_for_course, is_bulk_email_feature_enabled
from lms.djangoapps.bulk_email.models import BulkEmailFlag, CourseAuthorization
-from student.tests.factories import AdminFactory
+from common.djangoapps.student.tests.factories import AdminFactory
from xmodule.modulestore.tests.django_utils import TEST_DATA_MIXED_MODULESTORE, SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/lms/djangoapps/instructor/tests/test_enrollment.py b/lms/djangoapps/instructor/tests/test_enrollment.py
index cfe5ee09e2..bae4f632cf 100644
--- a/lms/djangoapps/instructor/tests/test_enrollment.py
+++ b/lms/djangoapps/instructor/tests/test_enrollment.py
@@ -38,9 +38,9 @@ from lms.djangoapps.teams.models import CourseTeamMembership
from lms.djangoapps.teams.tests.factories import CourseTeamFactory
from openedx.core.djangoapps.ace_common.tests.mixins import EmailTemplateTagMixin
from openedx.core.djangolib.testing.utils import CacheIsolationTestCase, get_mock_request
-from student.models import CourseEnrollment, CourseEnrollmentAllowed, anonymous_id_for_user
-from student.roles import CourseCcxCoachRole
-from student.tests.factories import AdminFactory, UserFactory
+from common.djangoapps.student.models import CourseEnrollment, CourseEnrollmentAllowed, anonymous_id_for_user
+from common.djangoapps.student.roles import CourseCcxCoachRole
+from common.djangoapps.student.tests.factories import AdminFactory, UserFactory
from xmodule.modulestore.tests.django_utils import TEST_DATA_SPLIT_MODULESTORE, SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
diff --git a/lms/djangoapps/instructor/tests/test_proctoring.py b/lms/djangoapps/instructor/tests/test_proctoring.py
index b78ef1ee6a..84b37612b5 100644
--- a/lms/djangoapps/instructor/tests/test_proctoring.py
+++ b/lms/djangoapps/instructor/tests/test_proctoring.py
@@ -11,8 +11,8 @@ from six import text_type
from edx_proctoring.api import create_exam
from edx_proctoring.backends.tests.test_backend import TestBackendProvider
-from student.roles import CourseInstructorRole, CourseStaffRole
-from student.tests.factories import AdminFactory
+from common.djangoapps.student.roles import CourseInstructorRole, CourseStaffRole
+from common.djangoapps.student.tests.factories import AdminFactory
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/lms/djangoapps/instructor/tests/test_services.py b/lms/djangoapps/instructor/tests/test_services.py
index 368acba6e0..c83b81c0c5 100644
--- a/lms/djangoapps/instructor/tests/test_services.py
+++ b/lms/djangoapps/instructor/tests/test_services.py
@@ -12,8 +12,8 @@ from lms.djangoapps.courseware.models import StudentModule
from lms.djangoapps.instructor.access import allow_access
from lms.djangoapps.instructor.services import InstructorService
from lms.djangoapps.instructor.tests.test_tools import msk_from_problem_urlname
-from student.models import CourseEnrollment
-from student.tests.factories import UserFactory
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/lms/djangoapps/instructor/tests/test_spoc_gradebook.py b/lms/djangoapps/instructor/tests/test_spoc_gradebook.py
index 02175fe987..00ae66ae21 100644
--- a/lms/djangoapps/instructor/tests/test_spoc_gradebook.py
+++ b/lms/djangoapps/instructor/tests/test_spoc_gradebook.py
@@ -10,7 +10,7 @@ from six.moves import range
from capa.tests.response_xml_factory import StringResponseXMLFactory
from lms.djangoapps.courseware.tests.factories import StudentModuleFactory
from lms.djangoapps.grades.api import task_compute_all_grades_for_course
-from student.tests.factories import AdminFactory, CourseEnrollmentFactory, UserFactory
+from common.djangoapps.student.tests.factories import AdminFactory, CourseEnrollmentFactory, UserFactory
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
diff --git a/lms/djangoapps/instructor/tests/test_tools.py b/lms/djangoapps/instructor/tests/test_tools.py
index 9febba7ccc..5c653fae22 100644
--- a/lms/djangoapps/instructor/tests/test_tools.py
+++ b/lms/djangoapps/instructor/tests/test_tools.py
@@ -19,7 +19,7 @@ from edx_when.api import set_dates_for_course
from edx_when.field_data import DateLookupFieldData
from openedx.core.djangoapps.course_date_signals import handlers
from openedx.core.djangoapps.schedules.tests.factories import ScheduleFactory
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.fields import Date
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
diff --git a/lms/djangoapps/instructor/tests/utils.py b/lms/djangoapps/instructor/tests/utils.py
index 2a65e8509e..87ca8297aa 100644
--- a/lms/djangoapps/instructor/tests/utils.py
+++ b/lms/djangoapps/instructor/tests/utils.py
@@ -10,7 +10,7 @@ import random
import six
from pytz import UTC
-from util.date_utils import get_default_time_display
+from common.djangoapps.util.date_utils import get_default_time_display
class FakeInfo(object):
diff --git a/lms/djangoapps/instructor/tests/views/test_instructor_dashboard.py b/lms/djangoapps/instructor/tests/views/test_instructor_dashboard.py
index 19fe30496f..77873d8833 100644
--- a/lms/djangoapps/instructor/tests/views/test_instructor_dashboard.py
+++ b/lms/djangoapps/instructor/tests/views/test_instructor_dashboard.py
@@ -19,9 +19,9 @@ from six import text_type
from six.moves import range
from common.test.utils import XssTestMixin
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from edx_toggles.toggles.testutils import override_waffle_flag
-from edxmako.shortcuts import render_to_response
+from common.djangoapps.edxmako.shortcuts import render_to_response
from lms.djangoapps.courseware.tabs import get_course_tab_list
from lms.djangoapps.courseware.tests.factories import StaffFactory, StudentModuleFactory, UserFactory
from lms.djangoapps.courseware.tests.helpers import LoginEnrollmentTestCase
@@ -29,9 +29,9 @@ from lms.djangoapps.grades.config.waffle import WRITABLE_GRADEBOOK, waffle_flags
from lms.djangoapps.instructor.toggles import DATA_DOWNLOAD_V2
from lms.djangoapps.instructor.views.gradebook_api import calculate_page_info
from openedx.core.djangoapps.site_configuration.models import SiteConfiguration
-from student.models import CourseEnrollment
-from student.roles import CourseFinanceAdminRole
-from student.tests.factories import AdminFactory, CourseAccessRoleFactory, CourseEnrollmentFactory
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.student.roles import CourseFinanceAdminRole
+from common.djangoapps.student.tests.factories import AdminFactory, CourseAccessRoleFactory, CourseEnrollmentFactory
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.tests.django_utils import TEST_DATA_SPLIT_MODULESTORE, ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory, check_mongo_calls
diff --git a/lms/djangoapps/instructor/views/api.py b/lms/djangoapps/instructor/views/api.py
index 1dd932e10c..0c2b227af7 100644
--- a/lms/djangoapps/instructor/views/api.py
+++ b/lms/djangoapps/instructor/views/api.py
@@ -48,7 +48,7 @@ from lms.djangoapps.instructor_analytics import csvs as instructor_analytics_csv
from lms.djangoapps.instructor_analytics import distributions as instructor_analytics_distributions
from lms.djangoapps.bulk_email.api import is_bulk_email_feature_enabled
from lms.djangoapps.bulk_email.models import CourseEmail
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from lms.djangoapps.certificates import api as certs_api
from lms.djangoapps.certificates.models import (
CertificateInvalidation,
@@ -94,8 +94,8 @@ from openedx.core.djangoapps.user_api.preferences.api import get_user_preference
from openedx.core.djangolib.markup import HTML, Text
from openedx.core.lib.api.authentication import BearerAuthenticationAllowInactiveUser
from openedx.core.lib.api.view_utils import DeveloperErrorViewMixin
-from student import auth
-from student.models import (
+from common.djangoapps.student import auth
+from common.djangoapps.student.models import (
ALLOWEDTOENROLL_TO_ENROLLED,
ALLOWEDTOENROLL_TO_UNENROLLED,
DEFAULT_TRANSITION_STATE,
@@ -115,15 +115,15 @@ from student.models import (
is_email_retired,
unique_id_for_user
)
-from student.roles import CourseFinanceAdminRole, CourseSalesAdminRole
-from util.file import (
+from common.djangoapps.student.roles import CourseFinanceAdminRole, CourseSalesAdminRole
+from common.djangoapps.util.file import (
FileValidationException,
UniversalNewlineIterator,
course_and_time_based_filename_generator,
store_uploaded_file
)
-from util.json_request import JsonResponse, JsonResponseBadRequest
-from util.views import require_global_staff
+from common.djangoapps.util.json_request import JsonResponse, JsonResponseBadRequest
+from common.djangoapps.util.views import require_global_staff
from xmodule.modulestore.django import modulestore
from .. import permissions
diff --git a/lms/djangoapps/instructor/views/gradebook_api.py b/lms/djangoapps/instructor/views/gradebook_api.py
index ca8a4f0293..9a20ecdcbe 100644
--- a/lms/djangoapps/instructor/views/gradebook_api.py
+++ b/lms/djangoapps/instructor/views/gradebook_api.py
@@ -13,7 +13,7 @@ from django.views.decorators.cache import cache_control
from opaque_keys.edx.keys import CourseKey
from lms.djangoapps.courseware.courses import get_course_with_access
-from edxmako.shortcuts import render_to_response
+from common.djangoapps.edxmako.shortcuts import render_to_response
from lms.djangoapps.grades.api import CourseGradeFactory
from lms.djangoapps.instructor.views.api import require_course_permission
from xmodule.modulestore.django import modulestore
diff --git a/lms/djangoapps/instructor/views/instructor_dashboard.py b/lms/djangoapps/instructor/views/instructor_dashboard.py
index 5ad8e05315..5e3ad50821 100644
--- a/lms/djangoapps/instructor/views/instructor_dashboard.py
+++ b/lms/djangoapps/instructor/views/instructor_dashboard.py
@@ -30,8 +30,8 @@ from xblock.field_data import DictFieldData
from xblock.fields import ScopeIds
from lms.djangoapps.bulk_email.api import is_bulk_email_feature_enabled
-from course_modes.models import CourseMode, CourseModesArchive
-from edxmako.shortcuts import render_to_response
+from common.djangoapps.course_modes.models import CourseMode, CourseModesArchive
+from common.djangoapps.edxmako.shortcuts import render_to_response
from lms.djangoapps.certificates import api as certs_api
from lms.djangoapps.certificates.models import (
CertificateGenerationConfiguration,
@@ -53,12 +53,12 @@ from openedx.core.djangoapps.verified_track_content.models import VerifiedTrackC
from openedx.core.djangolib.markup import HTML, Text
from openedx.core.lib.url_utils import quote_slashes
from openedx.core.lib.xblock_utils import wrap_xblock
-from student.models import CourseEnrollment
-from student.roles import (
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.student.roles import (
CourseFinanceAdminRole, CourseInstructorRole,
CourseSalesAdminRole, CourseStaffRole
)
-from util.json_request import JsonResponse
+from common.djangoapps.util.json_request import JsonResponse
from xmodule.html_module import HtmlBlock
from xmodule.modulestore.django import modulestore
from xmodule.tabs import CourseTab
diff --git a/lms/djangoapps/instructor/views/instructor_task_helpers.py b/lms/djangoapps/instructor/views/instructor_task_helpers.py
index 177e310d74..e7eb12d234 100644
--- a/lms/djangoapps/instructor/views/instructor_task_helpers.py
+++ b/lms/djangoapps/instructor/views/instructor_task_helpers.py
@@ -13,7 +13,7 @@ from django.utils.translation import ungettext
from lms.djangoapps.bulk_email.models import CourseEmail
from lms.djangoapps.instructor_task.views import get_task_completion_info
-from util.date_utils import get_default_time_display
+from common.djangoapps.util.date_utils import get_default_time_display
log = logging.getLogger(__name__)
diff --git a/lms/djangoapps/instructor/views/tools.py b/lms/djangoapps/instructor/views/tools.py
index 7cbc0987f5..562cfa03d3 100644
--- a/lms/djangoapps/instructor/views/tools.py
+++ b/lms/djangoapps/instructor/views/tools.py
@@ -18,7 +18,7 @@ from six import string_types, text_type
from six.moves import zip
from openedx.core.djangoapps.schedules.models import Schedule
-from student.models import get_user_by_username_or_email, CourseEnrollment
+from common.djangoapps.student.models import get_user_by_username_or_email, CourseEnrollment
class DashboardError(Exception):
diff --git a/lms/djangoapps/instructor_analytics/basic.py b/lms/djangoapps/instructor_analytics/basic.py
index 6d9c9a1725..e600d72208 100644
--- a/lms/djangoapps/instructor_analytics/basic.py
+++ b/lms/djangoapps/instructor_analytics/basic.py
@@ -27,7 +27,7 @@ from lms.djangoapps.grades.api import context as grades_context
from lms.djangoapps.verify_student.services import IDVerificationService
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
from openedx.core.djangolib.markup import HTML, Text
-from student.models import CourseEnrollment, CourseEnrollmentAllowed
+from common.djangoapps.student.models import CourseEnrollment, CourseEnrollmentAllowed
log = logging.getLogger(__name__)
diff --git a/lms/djangoapps/instructor_analytics/distributions.py b/lms/djangoapps/instructor_analytics/distributions.py
index f2a847a14d..5d7c633e06 100644
--- a/lms/djangoapps/instructor_analytics/distributions.py
+++ b/lms/djangoapps/instructor_analytics/distributions.py
@@ -24,7 +24,7 @@ The distribution in a course for gender might look like:
from django.db.models import Count
-from student.models import CourseEnrollment, UserProfile
+from common.djangoapps.student.models import CourseEnrollment, UserProfile
# choices with a restricted domain, e.g. level_of_education
_EASY_CHOICE_FEATURES = ('gender', 'level_of_education')
diff --git a/lms/djangoapps/instructor_analytics/tests/test_basic.py b/lms/djangoapps/instructor_analytics/tests/test_basic.py
index b4023cc8cc..363ff20d0e 100644
--- a/lms/djangoapps/instructor_analytics/tests/test_basic.py
+++ b/lms/djangoapps/instructor_analytics/tests/test_basic.py
@@ -18,8 +18,8 @@ from opaque_keys.edx.locator import UsageKey
from six import text_type
from six.moves import range, zip
-from course_modes.models import CourseMode
-from course_modes.tests.factories import CourseModeFactory
+from common.djangoapps.course_modes.models import CourseMode
+from common.djangoapps.course_modes.tests.factories import CourseModeFactory
from lms.djangoapps.courseware.tests.factories import InstructorFactory
from lms.djangoapps.instructor_analytics.basic import (
AVAILABLE_FEATURES,
@@ -35,9 +35,9 @@ from lms.djangoapps.instructor_analytics.basic import (
list_problem_responses,
)
from openedx.core.djangoapps.course_groups.tests.helpers import CohortFactory
-from student.models import CourseEnrollment, CourseEnrollmentAllowed
-from student.roles import CourseSalesAdminRole
-from student.tests.factories import UserFactory
+from common.djangoapps.student.models import CourseEnrollment, CourseEnrollmentAllowed
+from common.djangoapps.student.roles import CourseSalesAdminRole
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
@@ -194,7 +194,7 @@ class TestAnalyticsBasic(ModuleStoreTestCase):
self.assertIn(userreport['verification_status'], ["N/A"])
# make sure that the user report respects whatever value
# is returned by verification and enrollment code
- with patch("student.models.CourseEnrollment.enrollment_mode_for_user") as enrollment_patch:
+ with patch("common.djangoapps.student.models.CourseEnrollment.enrollment_mode_for_user") as enrollment_patch:
with patch(
"lms.djangoapps.verify_student.services.IDVerificationService.verification_status_for_user"
) as verify_patch:
diff --git a/lms/djangoapps/instructor_analytics/tests/test_distributions.py b/lms/djangoapps/instructor_analytics/tests/test_distributions.py
index beb55083a4..dc96edc541 100644
--- a/lms/djangoapps/instructor_analytics/tests/test_distributions.py
+++ b/lms/djangoapps/instructor_analytics/tests/test_distributions.py
@@ -7,8 +7,8 @@ from opaque_keys.edx.locator import CourseLocator
from six.moves import range
from lms.djangoapps.instructor_analytics.distributions import AVAILABLE_PROFILE_FEATURES, profile_distribution
-from student.models import CourseEnrollment
-from student.tests.factories import UserFactory
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.student.tests.factories import UserFactory
class TestAnalyticsDistributions(TestCase):
diff --git a/lms/djangoapps/instructor_task/api.py b/lms/djangoapps/instructor_task/api.py
index 2533d5c745..d5ca3b7b26 100644
--- a/lms/djangoapps/instructor_task/api.py
+++ b/lms/djangoapps/instructor_task/api.py
@@ -43,7 +43,7 @@ from lms.djangoapps.instructor_task.tasks import (
reset_problem_attempts,
send_bulk_course_email
)
-from util import milestones_helpers
+from common.djangoapps.util import milestones_helpers
from xmodule.modulestore.django import modulestore
diff --git a/lms/djangoapps/instructor_task/api_helper.py b/lms/djangoapps/instructor_task/api_helper.py
index 0b46c5ad7f..16c7dd00c9 100644
--- a/lms/djangoapps/instructor_task/api_helper.py
+++ b/lms/djangoapps/instructor_task/api_helper.py
@@ -20,7 +20,7 @@ from six import text_type
from lms.djangoapps.courseware.courses import get_problems_in_section
from lms.djangoapps.courseware.module_render import get_xqueue_callback_url_prefix
from lms.djangoapps.instructor_task.models import PROGRESS, InstructorTask
-from util.db import outer_atomic
+from common.djangoapps.util.db import outer_atomic
from xmodule.modulestore.django import modulestore
log = logging.getLogger(__name__)
diff --git a/lms/djangoapps/instructor_task/subtasks.py b/lms/djangoapps/instructor_task/subtasks.py
index 0d1024dd06..26ab42fc74 100644
--- a/lms/djangoapps/instructor_task/subtasks.py
+++ b/lms/djangoapps/instructor_task/subtasks.py
@@ -18,7 +18,7 @@ from django.db import DatabaseError, transaction
from django.utils.encoding import python_2_unicode_compatible
from six.moves import range, zip
-from util.db import outer_atomic
+from common.djangoapps.util.db import outer_atomic
from .exceptions import DuplicateTaskException
from .models import PROGRESS, QUEUING, InstructorTask
diff --git a/lms/djangoapps/instructor_task/tasks_helper/certs.py b/lms/djangoapps/instructor_task/tasks_helper/certs.py
index 047beacf6a..04250be8f9 100644
--- a/lms/djangoapps/instructor_task/tasks_helper/certs.py
+++ b/lms/djangoapps/instructor_task/tasks_helper/certs.py
@@ -10,7 +10,7 @@ from django.db.models import Q
from lms.djangoapps.certificates.api import generate_user_certificates
from lms.djangoapps.certificates.models import CertificateStatuses, GeneratedCertificate
-from student.models import CourseEnrollment
+from common.djangoapps.student.models import CourseEnrollment
from xmodule.modulestore.django import modulestore
from .runner import TaskProgress
diff --git a/lms/djangoapps/instructor_task/tasks_helper/enrollments.py b/lms/djangoapps/instructor_task/tasks_helper/enrollments.py
index c22db99a8f..3b2b8c9588 100644
--- a/lms/djangoapps/instructor_task/tasks_helper/enrollments.py
+++ b/lms/djangoapps/instructor_task/tasks_helper/enrollments.py
@@ -12,13 +12,13 @@ from django.utils.translation import ugettext as _
from pytz import UTC
from six import StringIO
-from edxmako.shortcuts import render_to_string
+from common.djangoapps.edxmako.shortcuts import render_to_string
from lms.djangoapps.courseware.courses import get_course_by_id
from lms.djangoapps.instructor_analytics.basic import enrolled_students_features, list_may_enroll
from lms.djangoapps.instructor_analytics.csvs import format_dictlist
from lms.djangoapps.instructor_task.models import ReportStore
-from student.models import CourseAccessRole, CourseEnrollment
-from util.file import course_filename_prefix_generator
+from common.djangoapps.student.models import CourseAccessRole, CourseEnrollment
+from common.djangoapps.util.file import course_filename_prefix_generator
from .runner import TaskProgress
from .utils import tracker_emit, upload_csv_to_report_store
diff --git a/lms/djangoapps/instructor_task/tasks_helper/grades.py b/lms/djangoapps/instructor_task/tasks_helper/grades.py
index dadb72844f..911b64a702 100644
--- a/lms/djangoapps/instructor_task/tasks_helper/grades.py
+++ b/lms/djangoapps/instructor_task/tasks_helper/grades.py
@@ -19,7 +19,7 @@ from pytz import UTC
from six import text_type
from six.moves import zip, zip_longest
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from lms.djangoapps.certificates.models import CertificateWhitelist, GeneratedCertificate, certificate_info_for_user
from lms.djangoapps.courseware.courses import get_course_by_id
from lms.djangoapps.courseware.user_state_client import DjangoXBlockUserStateClient
@@ -41,8 +41,8 @@ from openedx.core.djangoapps.content.block_structure.api import get_course_in_ca
from openedx.core.djangoapps.course_groups.cohorts import bulk_cache_cohorts, get_cohort, is_course_cohorted
from openedx.core.djangoapps.user_api.course_tag.api import BulkCourseTags
from openedx.core.lib.cache_utils import get_cache
-from student.models import CourseEnrollment
-from student.roles import BulkRoleCache
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.student.roles import BulkRoleCache
from xmodule.modulestore.django import modulestore
from xmodule.partitions.partitions_service import PartitionService
from xmodule.split_test_module import get_split_user_partitions
diff --git a/lms/djangoapps/instructor_task/tasks_helper/misc.py b/lms/djangoapps/instructor_task/tasks_helper/misc.py
index b0b4729c22..b8e0fa5592 100644
--- a/lms/djangoapps/instructor_task/tasks_helper/misc.py
+++ b/lms/djangoapps/instructor_task/tasks_helper/misc.py
@@ -29,7 +29,7 @@ from lms.djangoapps.instructor_analytics.csvs import format_dictlist
from openedx.core.djangoapps.course_groups.cohorts import add_user_to_cohort
from openedx.core.djangoapps.course_groups.models import CourseUserGroup
from lms.djangoapps.survey.models import SurveyAnswer
-from util.file import UniversalNewlineIterator
+from common.djangoapps.util.file import UniversalNewlineIterator
from .runner import TaskProgress
from .utils import (
diff --git a/lms/djangoapps/instructor_task/tasks_helper/module_state.py b/lms/djangoapps/instructor_task/tasks_helper/module_state.py
index 5e8d3d9473..65a6998f96 100644
--- a/lms/djangoapps/instructor_task/tasks_helper/module_state.py
+++ b/lms/djangoapps/instructor_task/tasks_helper/module_state.py
@@ -19,10 +19,10 @@ from lms.djangoapps.courseware.model_data import DjangoKeyValueStore, FieldDataC
from lms.djangoapps.courseware.models import StudentModule
from lms.djangoapps.courseware.module_render import get_module_for_descriptor_internal
from lms.djangoapps.grades.api import events as grades_events
-from student.models import get_user_by_username_or_email
-from track.event_transaction_utils import create_new_event_transaction_id, set_event_transaction_type
-from track.views import task_track
-from util.db import outer_atomic
+from common.djangoapps.student.models import get_user_by_username_or_email
+from common.djangoapps.track.event_transaction_utils import create_new_event_transaction_id, set_event_transaction_type
+from common.djangoapps.track.views import task_track
+from common.djangoapps.util.db import outer_atomic
from xmodule.modulestore.django import modulestore
from ..exceptions import UpdateProblemModuleStateError
diff --git a/lms/djangoapps/instructor_task/tasks_helper/runner.py b/lms/djangoapps/instructor_task/tasks_helper/runner.py
index 1724e44a7d..d1bd5c62eb 100644
--- a/lms/djangoapps/instructor_task/tasks_helper/runner.py
+++ b/lms/djangoapps/instructor_task/tasks_helper/runner.py
@@ -11,7 +11,7 @@ from celery import current_task
from django.db import reset_queries
from lms.djangoapps.instructor_task.models import PROGRESS, InstructorTask
-from util.db import outer_atomic
+from common.djangoapps.util.db import outer_atomic
TASK_LOG = logging.getLogger('edx.celery.task')
diff --git a/lms/djangoapps/instructor_task/tasks_helper/utils.py b/lms/djangoapps/instructor_task/tasks_helper/utils.py
index 8a9afdb1ee..07de2e8e91 100644
--- a/lms/djangoapps/instructor_task/tasks_helper/utils.py
+++ b/lms/djangoapps/instructor_task/tasks_helper/utils.py
@@ -6,7 +6,7 @@ Utility methods for instructor tasks
from eventtracking import tracker
from lms.djangoapps.instructor_task.models import ReportStore
-from util.file import course_filename_prefix_generator
+from common.djangoapps.util.file import course_filename_prefix_generator
REPORT_REQUESTED_EVENT_NAME = u'edx.instructor.report.requested'
diff --git a/lms/djangoapps/instructor_task/tests/factories.py b/lms/djangoapps/instructor_task/tests/factories.py
index f68ec11d16..47dbefdf59 100644
--- a/lms/djangoapps/instructor_task/tests/factories.py
+++ b/lms/djangoapps/instructor_task/tests/factories.py
@@ -11,7 +11,7 @@ from factory.django import DjangoModelFactory
from opaque_keys.edx.locator import CourseLocator
from lms.djangoapps.instructor_task.models import InstructorTask
-from student.tests.factories import UserFactory as StudentUserFactory
+from common.djangoapps.student.tests.factories import UserFactory as StudentUserFactory
class InstructorTaskFactory(DjangoModelFactory):
diff --git a/lms/djangoapps/instructor_task/tests/test_base.py b/lms/djangoapps/instructor_task/tests/test_base.py
index 9e5776c9d2..be41f14fea 100644
--- a/lms/djangoapps/instructor_task/tests/test_base.py
+++ b/lms/djangoapps/instructor_task/tests/test_base.py
@@ -30,7 +30,7 @@ from lms.djangoapps.instructor_task.tests.factories import InstructorTaskFactory
from lms.djangoapps.instructor_task.views import instructor_task_status
from openedx.core.djangolib.testing.utils import CacheIsolationTestCase
from openedx.core.lib.url_utils import quote_slashes
-from student.tests.factories import CourseEnrollmentFactory, UserFactory
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory, UserFactory
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
diff --git a/lms/djangoapps/instructor_task/tests/test_subtasks.py b/lms/djangoapps/instructor_task/tests/test_subtasks.py
index e78f7cabe0..fc6fd4ef24 100644
--- a/lms/djangoapps/instructor_task/tests/test_subtasks.py
+++ b/lms/djangoapps/instructor_task/tests/test_subtasks.py
@@ -11,7 +11,7 @@ from six.moves import range
from lms.djangoapps.instructor_task.subtasks import queue_subtasks_for_query
from lms.djangoapps.instructor_task.tests.factories import InstructorTaskFactory
from lms.djangoapps.instructor_task.tests.test_base import InstructorTaskCourseTestCase
-from student.models import CourseEnrollment
+from common.djangoapps.student.models import CourseEnrollment
class TestSubtasks(InstructorTaskCourseTestCase):
diff --git a/lms/djangoapps/instructor_task/tests/test_tasks.py b/lms/djangoapps/instructor_task/tests/test_tasks.py
index 2f9a90630b..5fd342708a 100644
--- a/lms/djangoapps/instructor_task/tests/test_tasks.py
+++ b/lms/djangoapps/instructor_task/tests/test_tasks.py
@@ -17,7 +17,7 @@ from mock import MagicMock, Mock, patch
from opaque_keys.edx.keys import i4xEncoder
from six.moves import range
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from lms.djangoapps.courseware.models import StudentModule
from lms.djangoapps.courseware.tests.factories import StudentModuleFactory
from lms.djangoapps.instructor_task.exceptions import UpdateProblemModuleStateError
diff --git a/lms/djangoapps/instructor_task/tests/test_tasks_helper.py b/lms/djangoapps/instructor_task/tests/test_tasks_helper.py
index 4ebb770940..e2d2d5a47f 100644
--- a/lms/djangoapps/instructor_task/tests/test_tasks_helper.py
+++ b/lms/djangoapps/instructor_task/tests/test_tasks_helper.py
@@ -33,8 +33,8 @@ from waffle.testutils import override_switch
import openedx.core.djangoapps.user_api.course_tag.api as course_tag_api
from capa.tests.response_xml_factory import MultipleChoiceResponseXMLFactory
-from course_modes.models import CourseMode
-from course_modes.tests.factories import CourseModeFactory
+from common.djangoapps.course_modes.models import CourseMode
+from common.djangoapps.course_modes.tests.factories import CourseModeFactory
from lms.djangoapps.courseware.models import StudentModule
from lms.djangoapps.certificates.models import CertificateStatuses, GeneratedCertificate
from lms.djangoapps.certificates.tests.factories import CertificateWhitelistFactory, GeneratedCertificateFactory
@@ -75,8 +75,8 @@ from openedx.core.djangoapps.credit.tests.factories import CreditCourseFactory
from openedx.core.djangoapps.user_api.partition_schemes import RandomUserPartitionScheme
from openedx.core.djangoapps.util.testing import ContentGroupTestCase, TestConditionalContent
from openedx.core.lib.teams_config import TeamsConfig
-from student.models import ALLOWEDTOENROLL_TO_ENROLLED, CourseEnrollment, CourseEnrollmentAllowed, ManualEnrollmentAudit
-from student.tests.factories import CourseEnrollmentFactory, UserFactory
+from common.djangoapps.student.models import ALLOWEDTOENROLL_TO_ENROLLED, CourseEnrollment, CourseEnrollmentAllowed, ManualEnrollmentAudit
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory, UserFactory
from lms.djangoapps.survey.models import SurveyAnswer, SurveyForm
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
diff --git a/lms/djangoapps/learner_dashboard/tests/test_programs.py b/lms/djangoapps/learner_dashboard/tests/test_programs.py
index 2d27052c01..8af51b1749 100644
--- a/lms/djangoapps/learner_dashboard/tests/test_programs.py
+++ b/lms/djangoapps/learner_dashboard/tests/test_programs.py
@@ -27,7 +27,7 @@ from openedx.core.djangoapps.catalog.tests.factories import (
from openedx.core.djangoapps.catalog.tests.mixins import CatalogIntegrationMixin
from openedx.core.djangoapps.programs.tests.mixins import ProgramsApiConfigMixin
from openedx.core.djangolib.testing.utils import skip_unless_lms
-from student.tests.factories import CourseEnrollmentFactory, UserFactory
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory, UserFactory
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory as ModuleStoreCourseFactory
diff --git a/lms/djangoapps/learner_dashboard/views.py b/lms/djangoapps/learner_dashboard/views.py
index e77f970c08..db6c6724e8 100644
--- a/lms/djangoapps/learner_dashboard/views.py
+++ b/lms/djangoapps/learner_dashboard/views.py
@@ -4,7 +4,7 @@
from django.contrib.auth.decorators import login_required
from django.views.decorators.http import require_GET
-from edxmako.shortcuts import render_to_response
+from common.djangoapps.edxmako.shortcuts import render_to_response
from lms.djangoapps.learner_dashboard.programs import ProgramDetailsFragmentView, ProgramsFragmentView
from openedx.core.djangoapps.programs.models import ProgramsApiConfig
diff --git a/lms/djangoapps/lms_xblock/test/test_runtime.py b/lms/djangoapps/lms_xblock/test/test_runtime.py
index f08b191939..a24078cb56 100644
--- a/lms/djangoapps/lms_xblock/test/test_runtime.py
+++ b/lms/djangoapps/lms_xblock/test/test_runtime.py
@@ -16,7 +16,7 @@ from xblock.fields import ScopeIds
from lms.djangoapps.badges.tests.factories import BadgeClassFactory
from lms.djangoapps.badges.tests.test_models import get_image
from lms.djangoapps.lms_xblock.runtime import LmsModuleSystem
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore.django import ModuleI18nService
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/lms/djangoapps/lti_provider/management/commands/tests/test_resend_lti_scores.py b/lms/djangoapps/lti_provider/management/commands/tests/test_resend_lti_scores.py
index 70514373d9..18bbfbfbbc 100644
--- a/lms/djangoapps/lti_provider/management/commands/tests/test_resend_lti_scores.py
+++ b/lms/djangoapps/lti_provider/management/commands/tests/test_resend_lti_scores.py
@@ -10,7 +10,7 @@ from opaque_keys.edx.keys import CourseKey, UsageKey
from lms.djangoapps.lti_provider.management.commands import resend_lti_scores
from lms.djangoapps.lti_provider.models import GradedAssignment, LtiConsumer, OutcomeService
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.utils import TEST_DATA_DIR
from xmodule.modulestore.xml_importer import import_course_from_xml
diff --git a/lms/djangoapps/lti_provider/tests/test_outcomes.py b/lms/djangoapps/lti_provider/tests/test_outcomes.py
index c31ffe36c2..cc0f4cac55 100644
--- a/lms/djangoapps/lti_provider/tests/test_outcomes.py
+++ b/lms/djangoapps/lti_provider/tests/test_outcomes.py
@@ -10,7 +10,7 @@ from opaque_keys.edx.locator import BlockUsageLocator, CourseLocator
import lms.djangoapps.lti_provider.outcomes as outcomes
from lms.djangoapps.lti_provider.models import GradedAssignment, LtiConsumer, OutcomeService
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory, check_mongo_calls
diff --git a/lms/djangoapps/lti_provider/tests/test_tasks.py b/lms/djangoapps/lti_provider/tests/test_tasks.py
index 8c98248257..6fc387d2fa 100644
--- a/lms/djangoapps/lti_provider/tests/test_tasks.py
+++ b/lms/djangoapps/lti_provider/tests/test_tasks.py
@@ -11,7 +11,7 @@ from opaque_keys.edx.locator import BlockUsageLocator, CourseLocator
import lms.djangoapps.lti_provider.tasks as tasks
from lms.djangoapps.lti_provider.models import GradedAssignment, LtiConsumer, OutcomeService
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
class BaseOutcomeTest(TestCase):
diff --git a/lms/djangoapps/lti_provider/tests/test_users.py b/lms/djangoapps/lti_provider/tests/test_users.py
index 90401f2b28..0b083434a5 100644
--- a/lms/djangoapps/lti_provider/tests/test_users.py
+++ b/lms/djangoapps/lti_provider/tests/test_users.py
@@ -14,7 +14,7 @@ from six.moves import range
from .. import users
from ..models import LtiConsumer, LtiUser
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
class UserManagementHelperTest(TestCase):
diff --git a/lms/djangoapps/lti_provider/tests/test_views.py b/lms/djangoapps/lti_provider/tests/test_views.py
index 942d913b04..5192bfaf6f 100644
--- a/lms/djangoapps/lti_provider/tests/test_views.py
+++ b/lms/djangoapps/lti_provider/tests/test_views.py
@@ -12,7 +12,7 @@ from opaque_keys.edx.locator import BlockUsageLocator, CourseLocator
from lms.djangoapps.courseware.testutils import RenderXBlockTestMixin
from lms.djangoapps.lti_provider import models, views
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
LTI_DEFAULT_PARAMS = {
diff --git a/lms/djangoapps/lti_provider/users.py b/lms/djangoapps/lti_provider/users.py
index 73979f0e28..3ff26f99a6 100644
--- a/lms/djangoapps/lti_provider/users.py
+++ b/lms/djangoapps/lti_provider/users.py
@@ -16,7 +16,7 @@ from django.db import IntegrityError, transaction
from six.moves import range
from lms.djangoapps.lti_provider.models import LtiUser
-from student.models import UserProfile
+from common.djangoapps.student.models import UserProfile
def authenticate_lti_user(request, lti_user_id, lti_consumer):
diff --git a/lms/djangoapps/lti_provider/views.py b/lms/djangoapps/lti_provider/views.py
index f24bcfe503..cc10a368b7 100644
--- a/lms/djangoapps/lti_provider/views.py
+++ b/lms/djangoapps/lti_provider/views.py
@@ -17,7 +17,7 @@ from lms.djangoapps.lti_provider.outcomes import store_outcome_parameters
from lms.djangoapps.lti_provider.signature_validator import SignatureValidator
from lms.djangoapps.lti_provider.users import authenticate_lti_user
from openedx.core.lib.url_utils import unquote_slashes
-from util.views import add_p3p_header
+from common.djangoapps.util.views import add_p3p_header
log = logging.getLogger("edx.lti_provider")
diff --git a/lms/djangoapps/mailing/management/commands/mailchimp_sync_course.py b/lms/djangoapps/mailing/management/commands/mailchimp_sync_course.py
index 02d73c1c28..3157ad62c9 100644
--- a/lms/djangoapps/mailing/management/commands/mailchimp_sync_course.py
+++ b/lms/djangoapps/mailing/management/commands/mailchimp_sync_course.py
@@ -16,7 +16,7 @@ from django.core.management.base import BaseCommand
from mailsnake import MailSnake
from opaque_keys.edx.keys import CourseKey
-from student.models import UserProfile, unique_id_for_user
+from common.djangoapps.student.models import UserProfile, unique_id_for_user
BATCH_SIZE = 15000
# If you try to subscribe with too many users at once
diff --git a/lms/djangoapps/mobile_api/course_info/views.py b/lms/djangoapps/mobile_api/course_info/views.py
index 9f1fb4364c..835099a75d 100644
--- a/lms/djangoapps/mobile_api/course_info/views.py
+++ b/lms/djangoapps/mobile_api/course_info/views.py
@@ -8,7 +8,7 @@ from rest_framework.response import Response
from lms.djangoapps.courseware.courses import get_course_info_section_module
from openedx.core.lib.xblock_utils import get_course_update_items
-from static_replace import make_static_urls_absolute
+from common.djangoapps.static_replace import make_static_urls_absolute
from ..decorators import mobile_course_access, mobile_view
diff --git a/lms/djangoapps/mobile_api/tests/test_milestones.py b/lms/djangoapps/mobile_api/tests/test_milestones.py
index 8e305672e3..afd582cfd9 100644
--- a/lms/djangoapps/mobile_api/tests/test_milestones.py
+++ b/lms/djangoapps/mobile_api/tests/test_milestones.py
@@ -11,7 +11,7 @@ from mock import patch
from lms.djangoapps.courseware.access_response import MilestoneAccessError
from lms.djangoapps.courseware.tests.test_entrance_exam import add_entrance_exam_milestone, answer_entrance_exam_problem
from openedx.core.djangolib.testing.utils import get_mock_request
-from util.milestones_helpers import add_prerequisite_course, fulfill_course_milestone
+from common.djangoapps.util.milestones_helpers import add_prerequisite_course, fulfill_course_milestone
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
diff --git a/lms/djangoapps/mobile_api/testutils.py b/lms/djangoapps/mobile_api/testutils.py
index 0e8734a476..f344e5b3a2 100644
--- a/lms/djangoapps/mobile_api/testutils.py
+++ b/lms/djangoapps/mobile_api/testutils.py
@@ -29,8 +29,8 @@ from lms.djangoapps.courseware.tests.factories import UserFactory
from lms.djangoapps.mobile_api.models import IgnoreMobileAvailableFlagConfig
from lms.djangoapps.mobile_api.tests.test_milestones import MobileAPIMilestonesMixin
from lms.djangoapps.mobile_api.utils import API_V1
-from student import auth
-from student.models import CourseEnrollment
+from common.djangoapps.student import auth
+from common.djangoapps.student.models import CourseEnrollment
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/lms/djangoapps/mobile_api/users/serializers.py b/lms/djangoapps/mobile_api/users/serializers.py
index 94a152b6da..d8e0f8226c 100644
--- a/lms/djangoapps/mobile_api/users/serializers.py
+++ b/lms/djangoapps/mobile_api/users/serializers.py
@@ -10,8 +10,8 @@ from rest_framework.reverse import reverse
from lms.djangoapps.courseware.access import has_access
from lms.djangoapps.certificates.api import certificate_downloadable_status
from openedx.features.course_duration_limits.access import get_user_course_expiration_date
-from student.models import CourseEnrollment, User
-from util.course import get_encoded_course_sharing_utm_params, get_link_for_about_page
+from common.djangoapps.student.models import CourseEnrollment, User
+from common.djangoapps.util.course import get_encoded_course_sharing_utm_params, get_link_for_about_page
class CourseOverviewField(serializers.RelatedField):
diff --git a/lms/djangoapps/mobile_api/users/tests.py b/lms/djangoapps/mobile_api/users/tests.py
index 03af0f2545..5430aa1ef5 100644
--- a/lms/djangoapps/mobile_api/users/tests.py
+++ b/lms/djangoapps/mobile_api/users/tests.py
@@ -19,7 +19,7 @@ from mock import patch
from six.moves import range
from six.moves.urllib.parse import parse_qs
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from lms.djangoapps.courseware.access_response import MilestoneAccessError, StartDateError, VisibilityError
from lms.djangoapps.certificates.api import generate_user_certificates
from lms.djangoapps.certificates.models import CertificateStatuses
@@ -36,10 +36,10 @@ from openedx.core.djangoapps.schedules.tests.factories import ScheduleFactory
from openedx.core.lib.courses import course_image_url
from openedx.features.course_duration_limits.models import CourseDurationLimitConfig
from openedx.features.course_experience.tests.views.helpers import add_course_mode
-from student.models import CourseEnrollment
-from student.tests.factories import CourseEnrollmentFactory
-from util.milestones_helpers import set_prerequisite_courses
-from util.testing import UrlResetMixin
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory
+from common.djangoapps.util.milestones_helpers import set_prerequisite_courses
+from common.djangoapps.util.testing import UrlResetMixin
from xmodule.course_module import DEFAULT_START_DATE
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
diff --git a/lms/djangoapps/mobile_api/users/views.py b/lms/djangoapps/mobile_api/users/views.py
index 4ff60cab46..96bea4ec66 100644
--- a/lms/djangoapps/mobile_api/users/views.py
+++ b/lms/djangoapps/mobile_api/users/views.py
@@ -26,7 +26,7 @@ from lms.djangoapps.courseware.views.index import save_positions_recursively_up
from lms.djangoapps.courseware.access_utils import ACCESS_GRANTED
from lms.djangoapps.mobile_api.utils import API_V05, API_V1
from openedx.features.course_duration_limits.access import check_course_expired
-from student.models import CourseEnrollment, User
+from common.djangoapps.student.models import CourseEnrollment, User
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.exceptions import ItemNotFoundError
diff --git a/lms/djangoapps/program_enrollments/api/grades.py b/lms/djangoapps/program_enrollments/api/grades.py
index fb3292d42b..00b931bf79 100644
--- a/lms/djangoapps/program_enrollments/api/grades.py
+++ b/lms/djangoapps/program_enrollments/api/grades.py
@@ -11,7 +11,7 @@ import logging
from six import text_type
from lms.djangoapps.grades.api import CourseGradeFactory, clear_prefetched_course_grades, prefetch_course_grades
-from util.query import read_replica_or_default
+from common.djangoapps.util.query import read_replica_or_default
from .reading import fetch_program_course_enrollments
diff --git a/lms/djangoapps/program_enrollments/api/linking.py b/lms/djangoapps/program_enrollments/api/linking.py
index cc17988c63..fd3fdd6feb 100644
--- a/lms/djangoapps/program_enrollments/api/linking.py
+++ b/lms/djangoapps/program_enrollments/api/linking.py
@@ -12,9 +12,9 @@ import logging
from django.contrib.auth import get_user_model
from django.db import IntegrityError, transaction
-from course_modes.models import CourseMode
-from student.api import get_access_role_by_role_name
-from student.models import CourseEnrollmentException
+from common.djangoapps.course_modes.models import CourseMode
+from common.djangoapps.student.api import get_access_role_by_role_name
+from common.djangoapps.student.models import CourseEnrollmentException
from .reading import fetch_program_enrollments
from .writing import enroll_in_masters_track
diff --git a/lms/djangoapps/program_enrollments/api/reading.py b/lms/djangoapps/program_enrollments/api/reading.py
index c443c03730..43c61e222f 100644
--- a/lms/djangoapps/program_enrollments/api/reading.py
+++ b/lms/djangoapps/program_enrollments/api/reading.py
@@ -10,8 +10,8 @@ from organizations.models import Organization
from social_django.models import UserSocialAuth
from openedx.core.djangoapps.catalog.utils import get_programs
-from student.roles import CourseStaffRole
-from third_party_auth.models import SAMLProviderConfig
+from common.djangoapps.student.roles import CourseStaffRole
+from common.djangoapps.third_party_auth.models import SAMLProviderConfig
from ..constants import ProgramCourseEnrollmentRoles
from ..exceptions import (
diff --git a/lms/djangoapps/program_enrollments/api/tests/test_linking.py b/lms/djangoapps/program_enrollments/api/tests/test_linking.py
index c71d692e02..543139c8c8 100644
--- a/lms/djangoapps/program_enrollments/api/tests/test_linking.py
+++ b/lms/djangoapps/program_enrollments/api/tests/test_linking.py
@@ -17,9 +17,9 @@ from lms.djangoapps.program_enrollments.tests.factories import (
ProgramEnrollmentFactory
)
from openedx.core.djangoapps.content.course_overviews.tests.factories import CourseOverviewFactory
-from student.api import get_course_access_role
-from student.roles import CourseStaffRole
-from student.tests.factories import CourseAccessRoleFactory, UserFactory
+from common.djangoapps.student.api import get_course_access_role
+from common.djangoapps.student.roles import CourseStaffRole
+from common.djangoapps.student.tests.factories import CourseAccessRoleFactory, UserFactory
from ..linking import (
NO_LMS_USER_TEMPLATE,
diff --git a/lms/djangoapps/program_enrollments/api/tests/test_reading.py b/lms/djangoapps/program_enrollments/api/tests/test_reading.py
index a5dcf74fc4..606f3b1568 100644
--- a/lms/djangoapps/program_enrollments/api/tests/test_reading.py
+++ b/lms/djangoapps/program_enrollments/api/tests/test_reading.py
@@ -13,7 +13,7 @@ from opaque_keys.edx.keys import CourseKey
from organizations.tests.factories import OrganizationFactory
from social_django.models import UserSocialAuth
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from lms.djangoapps.program_enrollments.constants import ProgramCourseEnrollmentStatuses as PCEStatuses
from lms.djangoapps.program_enrollments.constants import ProgramEnrollmentStatuses as PEStatuses
from lms.djangoapps.program_enrollments.exceptions import (
@@ -33,9 +33,9 @@ from openedx.core.djangoapps.catalog.tests.factories import OrganizationFactory
from openedx.core.djangoapps.catalog.tests.factories import ProgramFactory
from openedx.core.djangoapps.content.course_overviews.tests.factories import CourseOverviewFactory
from openedx.core.djangolib.testing.utils import CacheIsolationTestCase
-from student.roles import CourseStaffRole
-from student.tests.factories import CourseEnrollmentFactory, UserFactory
-from third_party_auth.tests.factories import SAMLProviderConfigFactory
+from common.djangoapps.student.roles import CourseStaffRole
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory, UserFactory
+from common.djangoapps.third_party_auth.tests.factories import SAMLProviderConfigFactory
from ..reading import (
fetch_program_course_enrollments,
diff --git a/lms/djangoapps/program_enrollments/api/tests/test_writing.py b/lms/djangoapps/program_enrollments/api/tests/test_writing.py
index c71bd259cf..80841ae978 100644
--- a/lms/djangoapps/program_enrollments/api/tests/test_writing.py
+++ b/lms/djangoapps/program_enrollments/api/tests/test_writing.py
@@ -16,7 +16,7 @@ from django.core.cache import cache
from opaque_keys.edx.keys import CourseKey
from organizations.tests.factories import OrganizationFactory
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from lms.djangoapps.program_enrollments.constants import ProgramCourseEnrollmentRoles
from lms.djangoapps.program_enrollments.constants import ProgramCourseOperationStatuses as CourseStatuses
from lms.djangoapps.program_enrollments.constants import ProgramEnrollmentStatuses as PEStatuses
@@ -32,9 +32,9 @@ from openedx.core.djangoapps.catalog.tests.factories import OrganizationFactory
from openedx.core.djangoapps.catalog.tests.factories import ProgramFactory
from openedx.core.djangoapps.content.course_overviews.tests.factories import CourseOverviewFactory
from openedx.core.djangolib.testing.utils import CacheIsolationTestCase
-from student.roles import CourseStaffRole
-from student.tests.factories import CourseEnrollmentFactory, UserFactory
-from third_party_auth.tests.factories import SAMLProviderConfigFactory
+from common.djangoapps.student.roles import CourseStaffRole
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory, UserFactory
+from common.djangoapps.third_party_auth.tests.factories import SAMLProviderConfigFactory
from ..writing import write_program_course_enrollments, write_program_enrollments
diff --git a/lms/djangoapps/program_enrollments/api/writing.py b/lms/djangoapps/program_enrollments/api/writing.py
index e138a69e24..a0f4c17b76 100644
--- a/lms/djangoapps/program_enrollments/api/writing.py
+++ b/lms/djangoapps/program_enrollments/api/writing.py
@@ -10,10 +10,10 @@ import logging
from simple_history.utils import bulk_create_with_history
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from openedx.core.djangoapps.content.course_overviews.models import CourseOverview
-from student.models import CourseEnrollment, NonExistentCourseError
-from student.roles import CourseStaffRole
+from common.djangoapps.student.models import CourseEnrollment, NonExistentCourseError
+from common.djangoapps.student.roles import CourseStaffRole
from ..constants import ProgramCourseEnrollmentRoles, ProgramCourseEnrollmentStatuses
from ..constants import ProgramCourseOperationStatuses as ProgramCourseOpStatuses
diff --git a/lms/djangoapps/program_enrollments/constants.py b/lms/djangoapps/program_enrollments/constants.py
index 5857f576db..e3595faf58 100644
--- a/lms/djangoapps/program_enrollments/constants.py
+++ b/lms/djangoapps/program_enrollments/constants.py
@@ -2,7 +2,7 @@
Constants used throughout the program_enrollments app and exposed to other
in-process apps through api.py.
"""
-from student.roles import CourseStaffRole
+from common.djangoapps.student.roles import CourseStaffRole
class ProgramEnrollmentStatuses(object):
diff --git a/lms/djangoapps/program_enrollments/management/commands/reset_enrollment_data.py b/lms/djangoapps/program_enrollments/management/commands/reset_enrollment_data.py
index fa71747871..0bd26226d7 100644
--- a/lms/djangoapps/program_enrollments/management/commands/reset_enrollment_data.py
+++ b/lms/djangoapps/program_enrollments/management/commands/reset_enrollment_data.py
@@ -14,7 +14,7 @@ from django.db import transaction
from six.moves import input
from lms.djangoapps.program_enrollments.models import ProgramEnrollment
-from student.models import CourseEnrollment
+from common.djangoapps.student.models import CourseEnrollment
log = logging.getLogger(__name__)
diff --git a/lms/djangoapps/program_enrollments/management/commands/tests/test_migrate_saml_uids.py b/lms/djangoapps/program_enrollments/management/commands/tests/test_migrate_saml_uids.py
index b426d9d79e..f7164df247 100644
--- a/lms/djangoapps/program_enrollments/management/commands/tests/test_migrate_saml_uids.py
+++ b/lms/djangoapps/program_enrollments/management/commands/tests/test_migrate_saml_uids.py
@@ -11,7 +11,7 @@ from social_django.models import UserSocialAuth
from lms.djangoapps.program_enrollments.management.commands import migrate_saml_uids
from lms.djangoapps.program_enrollments.management.commands.tests.utils import UserSocialAuthFactory
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
_COMMAND_PATH = 'lms.djangoapps.program_enrollments.management.commands.migrate_saml_uids'
diff --git a/lms/djangoapps/program_enrollments/management/commands/tests/test_reset_enrollment_data.py b/lms/djangoapps/program_enrollments/management/commands/tests/test_reset_enrollment_data.py
index 00d7e30a7e..7ba683a6b4 100644
--- a/lms/djangoapps/program_enrollments/management/commands/tests/test_reset_enrollment_data.py
+++ b/lms/djangoapps/program_enrollments/management/commands/tests/test_reset_enrollment_data.py
@@ -15,8 +15,8 @@ from six import StringIO
from lms.djangoapps.program_enrollments.management.commands import reset_enrollment_data
from lms.djangoapps.program_enrollments.models import ProgramCourseEnrollment, ProgramEnrollment
from lms.djangoapps.program_enrollments.tests.factories import ProgramCourseEnrollmentFactory, ProgramEnrollmentFactory
-from student.models import CourseEnrollment
-from student.tests.factories import UserFactory
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.student.tests.factories import UserFactory
class TestResetEnrollmentData(TestCase):
diff --git a/lms/djangoapps/program_enrollments/management/commands/tests/utils.py b/lms/djangoapps/program_enrollments/management/commands/tests/utils.py
index 8ea752f184..1de02c032e 100644
--- a/lms/djangoapps/program_enrollments/management/commands/tests/utils.py
+++ b/lms/djangoapps/program_enrollments/management/commands/tests/utils.py
@@ -6,7 +6,7 @@ from factory import LazyAttributeSequence, SubFactory
from factory.django import DjangoModelFactory
from social_django.models import UserSocialAuth
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
class UserSocialAuthFactory(DjangoModelFactory):
diff --git a/lms/djangoapps/program_enrollments/models.py b/lms/djangoapps/program_enrollments/models.py
index dadb1bfae4..c990c08431 100644
--- a/lms/djangoapps/program_enrollments/models.py
+++ b/lms/djangoapps/program_enrollments/models.py
@@ -13,7 +13,7 @@ from opaque_keys.edx.django.models import CourseKeyField
from simple_history.models import HistoricalRecords
from user_util import user_util
-from student.models import CourseEnrollment
+from common.djangoapps.student.models import CourseEnrollment
from .constants import ProgramCourseEnrollmentRoles, ProgramCourseEnrollmentStatuses, ProgramEnrollmentStatuses
diff --git a/lms/djangoapps/program_enrollments/rest_api/v1/tests/test_views.py b/lms/djangoapps/program_enrollments/rest_api/v1/tests/test_views.py
index 2081b7a845..0c02ff3ea8 100644
--- a/lms/djangoapps/program_enrollments/rest_api/v1/tests/test_views.py
+++ b/lms/djangoapps/program_enrollments/rest_api/v1/tests/test_views.py
@@ -25,7 +25,7 @@ from six.moves import range, zip
from social_django.models import UserSocialAuth
from lms.djangoapps.bulk_email.models import BulkEmailFlag, Optout
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from lms.djangoapps.certificates.models import CertificateStatuses
from lms.djangoapps.certificates.tests.factories import GeneratedCertificateFactory
from lms.djangoapps.courseware.tests.factories import GlobalStaffFactory, InstructorFactory
@@ -50,10 +50,10 @@ from openedx.core.djangoapps.catalog.tests.factories import (
from openedx.core.djangoapps.content.course_overviews.models import CourseOverview
from openedx.core.djangoapps.content.course_overviews.tests.factories import CourseOverviewFactory
from openedx.core.djangolib.testing.utils import CacheIsolationMixin
-from student.models import CourseEnrollment
-from student.roles import CourseStaffRole
-from student.tests.factories import CourseEnrollmentFactory, UserFactory
-from third_party_auth.tests.factories import SAMLProviderConfigFactory
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.student.roles import CourseStaffRole
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory, UserFactory
+from common.djangoapps.third_party_auth.tests.factories import SAMLProviderConfigFactory
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory as ModulestoreCourseFactory
from xmodule.modulestore.tests.factories import ItemFactory
diff --git a/lms/djangoapps/program_enrollments/rest_api/v1/utils.py b/lms/djangoapps/program_enrollments/rest_api/v1/utils.py
index 828e1b1a31..f5c7f5cdae 100644
--- a/lms/djangoapps/program_enrollments/rest_api/v1/utils.py
+++ b/lms/djangoapps/program_enrollments/rest_api/v1/utils.py
@@ -12,7 +12,7 @@ from pytz import UTC
from rest_framework import status
from rest_framework.pagination import CursorPagination
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from lms.djangoapps.bulk_email.api import get_emails_enabled
from lms.djangoapps.certificates.api import get_certificates_for_user_by_course_keys
from lms.djangoapps.course_api.api import get_course_run_url, get_due_dates
@@ -20,8 +20,8 @@ from lms.djangoapps.program_enrollments.api import fetch_program_enrollments
from lms.djangoapps.program_enrollments.constants import ProgramEnrollmentStatuses
from openedx.core.djangoapps.catalog.utils import course_run_keys_for_program, get_programs, is_course_run_in_program
from openedx.core.lib.api.view_utils import verify_course_exists
-from student.helpers import get_resume_urls_for_enrollments
-from student.models import CourseEnrollment
+from common.djangoapps.student.helpers import get_resume_urls_for_enrollments
+from common.djangoapps.student.models import CourseEnrollment
from .constants import CourseRunProgressStatuses
diff --git a/lms/djangoapps/program_enrollments/rest_api/v1/views.py b/lms/djangoapps/program_enrollments/rest_api/v1/views.py
index 05a25affec..7eb80b1d7c 100644
--- a/lms/djangoapps/program_enrollments/rest_api/v1/views.py
+++ b/lms/djangoapps/program_enrollments/rest_api/v1/views.py
@@ -43,8 +43,8 @@ from openedx.core.djangoapps.catalog.utils import (
)
from openedx.core.lib.api.authentication import BearerAuthenticationAllowInactiveUser
from openedx.core.lib.api.view_utils import DeveloperErrorViewMixin, PaginatedAPIView
-from student.roles import CourseInstructorRole, CourseStaffRole, UserBasedRole
-from util.query import read_replica_or_default
+from common.djangoapps.student.roles import CourseInstructorRole, CourseStaffRole, UserBasedRole
+from common.djangoapps.util.query import read_replica_or_default
from .constants import ENABLE_ENROLLMENT_RESET_FLAG, MAX_ENROLLMENT_RECORDS
from .serializers import (
diff --git a/lms/djangoapps/program_enrollments/signals.py b/lms/djangoapps/program_enrollments/signals.py
index cd64c8278c..45ed4e6f07 100644
--- a/lms/djangoapps/program_enrollments/signals.py
+++ b/lms/djangoapps/program_enrollments/signals.py
@@ -11,7 +11,7 @@ from social_django.models import UserSocialAuth
from openedx.core.djangoapps.catalog.utils import get_programs
from openedx.core.djangoapps.user_api.accounts.signals import USER_RETIRE_LMS_MISC
-from third_party_auth.models import SAMLProviderConfig
+from common.djangoapps.third_party_auth.models import SAMLProviderConfig
from .api import fetch_program_enrollments_by_student, link_program_enrollment_to_lms_user
from .models import ProgramEnrollment
diff --git a/lms/djangoapps/program_enrollments/tests/factories.py b/lms/djangoapps/program_enrollments/tests/factories.py
index 1fef90518f..2089df1737 100644
--- a/lms/djangoapps/program_enrollments/tests/factories.py
+++ b/lms/djangoapps/program_enrollments/tests/factories.py
@@ -10,7 +10,7 @@ from factory.django import DjangoModelFactory
from opaque_keys.edx.keys import CourseKey
from lms.djangoapps.program_enrollments import models
-from student.tests.factories import CourseEnrollmentFactory, UserFactory
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory, UserFactory
class ProgramEnrollmentFactory(DjangoModelFactory):
diff --git a/lms/djangoapps/program_enrollments/tests/test_models.py b/lms/djangoapps/program_enrollments/tests/test_models.py
index 972de646f6..e3dff71ee6 100644
--- a/lms/djangoapps/program_enrollments/tests/test_models.py
+++ b/lms/djangoapps/program_enrollments/tests/test_models.py
@@ -11,9 +11,9 @@ from django.test import TestCase
from edx_django_utils.cache import RequestCache
from opaque_keys.edx.keys import CourseKey
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from openedx.core.djangoapps.content.course_overviews.tests.factories import CourseOverviewFactory
-from student.tests.factories import CourseEnrollmentFactory, UserFactory
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory, UserFactory
from ..constants import ProgramCourseEnrollmentRoles
from ..models import ProgramEnrollment
diff --git a/lms/djangoapps/program_enrollments/tests/test_signals.py b/lms/djangoapps/program_enrollments/tests/test_signals.py
index 7f07687f0d..20686ee219 100644
--- a/lms/djangoapps/program_enrollments/tests/test_signals.py
+++ b/lms/djangoapps/program_enrollments/tests/test_signals.py
@@ -12,7 +12,7 @@ from organizations.tests.factories import OrganizationFactory
from social_django.models import UserSocialAuth
from testfixtures import LogCapture
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from lms.djangoapps.program_enrollments.signals import _listen_for_lms_retire, logger
from lms.djangoapps.program_enrollments.tests.factories import ProgramCourseEnrollmentFactory, ProgramEnrollmentFactory
from openedx.core.djangoapps.catalog.cache import PROGRAM_CACHE_KEY_TPL
@@ -22,10 +22,10 @@ from openedx.core.djangoapps.content.course_overviews.models import CourseOvervi
from openedx.core.djangoapps.content.course_overviews.tests.factories import CourseOverviewFactory
from openedx.core.djangoapps.user_api.accounts.tests.retirement_helpers import fake_completed_retirement
from openedx.core.djangolib.testing.utils import CacheIsolationTestCase
-from student.models import CourseEnrollmentException
-from student.tests.factories import CourseEnrollmentFactory, UserFactory
-from third_party_auth.models import SAMLProviderConfig
-from third_party_auth.tests.factories import SAMLProviderConfigFactory
+from common.djangoapps.student.models import CourseEnrollmentException
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory, UserFactory
+from common.djangoapps.third_party_auth.models import SAMLProviderConfig
+from common.djangoapps.third_party_auth.tests.factories import SAMLProviderConfigFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
@@ -370,7 +370,7 @@ class SocialAuthEnrollmentCompletionSignalTest(CacheIsolationTestCase):
program_enrollment = self._create_waiting_program_enrollment()
self._create_waiting_course_enrollments(program_enrollment)
- with mock.patch('student.models.CourseEnrollment.enroll') as enrollMock:
+ with mock.patch('common.djangoapps.student.models.CourseEnrollment.enroll') as enrollMock:
enrollMock.side_effect = CourseEnrollmentException('something has gone wrong')
with pytest.raises(CourseEnrollmentException):
UserSocialAuth.objects.create(
diff --git a/lms/djangoapps/program_enrollments/tests/test_tasks.py b/lms/djangoapps/program_enrollments/tests/test_tasks.py
index 644c6a5747..3f849e297e 100644
--- a/lms/djangoapps/program_enrollments/tests/test_tasks.py
+++ b/lms/djangoapps/program_enrollments/tests/test_tasks.py
@@ -12,12 +12,12 @@ from freezegun import freeze_time
from opaque_keys.edx.keys import CourseKey
from testfixtures import LogCapture
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from lms.djangoapps.program_enrollments.models import ProgramCourseEnrollment, ProgramEnrollment
from lms.djangoapps.program_enrollments.tasks import expire_waiting_enrollments, log
from lms.djangoapps.program_enrollments.tests.factories import ProgramCourseEnrollmentFactory, ProgramEnrollmentFactory
from openedx.core.djangoapps.content.course_overviews.tests.factories import CourseOverviewFactory
-from student.tests.factories import CourseEnrollmentFactory, UserFactory
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory, UserFactory
class ExpireWaitingEnrollmentsTest(TestCase):
diff --git a/lms/djangoapps/static_template_view/views.py b/lms/djangoapps/static_template_view/views.py
index d9ff099b5c..76d317d1e9 100644
--- a/lms/djangoapps/static_template_view/views.py
+++ b/lms/djangoapps/static_template_view/views.py
@@ -16,10 +16,10 @@ from django.utils.safestring import mark_safe
from django.views.decorators.csrf import ensure_csrf_cookie
from mako.exceptions import TopLevelLookupException
-from edxmako.shortcuts import render_to_response, render_to_string
+from common.djangoapps.edxmako.shortcuts import render_to_response, render_to_string
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
-from util.cache import cache_if_anonymous
-from util.views import fix_crum_request
+from common.djangoapps.util.cache import cache_if_anonymous
+from common.djangoapps.util.views import fix_crum_request
valid_templates = []
diff --git a/lms/djangoapps/staticbook/tests.py b/lms/djangoapps/staticbook/tests.py
index a7ba2ce764..91ed05e3b2 100644
--- a/lms/djangoapps/staticbook/tests.py
+++ b/lms/djangoapps/staticbook/tests.py
@@ -10,7 +10,7 @@ import requests
from django.urls import NoReverseMatch, reverse
from six import text_type
-from student.tests.factories import CourseEnrollmentFactory, UserFactory
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory, UserFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/lms/djangoapps/staticbook/views.py b/lms/djangoapps/staticbook/views.py
index 22ccf609cc..8d0d9a40cd 100644
--- a/lms/djangoapps/staticbook/views.py
+++ b/lms/djangoapps/staticbook/views.py
@@ -10,8 +10,8 @@ from opaque_keys.edx.keys import CourseKey
from lms.djangoapps.courseware.access import has_access
from lms.djangoapps.courseware.courses import get_course_with_access
-from edxmako.shortcuts import render_to_response
-from static_replace import replace_static_urls
+from common.djangoapps.edxmako.shortcuts import render_to_response
+from common.djangoapps.static_replace import replace_static_urls
@login_required
diff --git a/lms/djangoapps/support/serializers.py b/lms/djangoapps/support/serializers.py
index 6247c9e538..840df93a36 100644
--- a/lms/djangoapps/support/serializers.py
+++ b/lms/djangoapps/support/serializers.py
@@ -7,7 +7,7 @@ from django.urls import reverse
from rest_framework import serializers
-from student.models import CourseEnrollment, ManualEnrollmentAudit
+from common.djangoapps.student.models import CourseEnrollment, ManualEnrollmentAudit
from lms.djangoapps.program_enrollments.models import (
ProgramEnrollment,
ProgramCourseEnrollment,
diff --git a/lms/djangoapps/support/tests/test_views.py b/lms/djangoapps/support/tests/test_views.py
index c0b00543fd..20812ddd13 100644
--- a/lms/djangoapps/support/tests/test_views.py
+++ b/lms/djangoapps/support/tests/test_views.py
@@ -22,17 +22,17 @@ from pytz import UTC
from social_django.models import UserSocialAuth
from common.test.utils import disable_signal
-from course_modes.models import CourseMode
-from course_modes.tests.factories import CourseModeFactory
+from common.djangoapps.course_modes.models import CourseMode
+from common.djangoapps.course_modes.tests.factories import CourseModeFactory
from lms.djangoapps.program_enrollments.tests.factories import ProgramCourseEnrollmentFactory, ProgramEnrollmentFactory
from lms.djangoapps.support.serializers import ProgramEnrollmentSerializer
from lms.djangoapps.verify_student.models import VerificationDeadline
from lms.djangoapps.verify_student.services import IDVerificationService
from lms.djangoapps.verify_student.tests.factories import SSOVerificationFactory
-from student.models import ENROLLED_TO_ENROLLED, CourseEnrollment, CourseEnrollmentAttribute, ManualEnrollmentAudit
-from student.roles import GlobalStaff, SupportStaffRole
-from student.tests.factories import CourseEnrollmentFactory, UserFactory
-from third_party_auth.tests.factories import SAMLProviderConfigFactory
+from common.djangoapps.student.models import ENROLLED_TO_ENROLLED, CourseEnrollment, CourseEnrollmentAttribute, ManualEnrollmentAudit
+from common.djangoapps.student.roles import GlobalStaff, SupportStaffRole
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory, UserFactory
+from common.djangoapps.third_party_auth.tests.factories import SAMLProviderConfigFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/lms/djangoapps/support/views/certificate.py b/lms/djangoapps/support/views/certificate.py
index 8a7b20946b..6019551b5e 100644
--- a/lms/djangoapps/support/views/certificate.py
+++ b/lms/djangoapps/support/views/certificate.py
@@ -7,7 +7,7 @@ from django.utils.decorators import method_decorator
from django.views.generic import View
from six.moves.urllib.parse import quote_plus, unquote
-from edxmako.shortcuts import render_to_response
+from common.djangoapps.edxmako.shortcuts import render_to_response
from lms.djangoapps.support.decorators import require_support_permission
diff --git a/lms/djangoapps/support/views/contact_us.py b/lms/djangoapps/support/views/contact_us.py
index 7a63d3f3b8..8401546df8 100644
--- a/lms/djangoapps/support/views/contact_us.py
+++ b/lms/djangoapps/support/views/contact_us.py
@@ -7,10 +7,10 @@ from django.conf import settings
from django.http import Http404
from django.views.generic import View
-from edxmako.shortcuts import render_to_response
+from common.djangoapps.edxmako.shortcuts import render_to_response
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
from openedx.features.enterprise_support import api as enterprise_api
-from student.models import CourseEnrollment
+from common.djangoapps.student.models import CourseEnrollment
class ContactUsView(View):
diff --git a/lms/djangoapps/support/views/course_entitlements.py b/lms/djangoapps/support/views/course_entitlements.py
index fef11fdc77..50063d1dbf 100644
--- a/lms/djangoapps/support/views/course_entitlements.py
+++ b/lms/djangoapps/support/views/course_entitlements.py
@@ -6,8 +6,8 @@ Support tool for changing and granting course entitlements
from django.utils.decorators import method_decorator
from django.views.generic import View
-from edxmako.shortcuts import render_to_response
-from entitlements.models import CourseEntitlementSupportDetail
+from common.djangoapps.edxmako.shortcuts import render_to_response
+from common.djangoapps.entitlements.models import CourseEntitlementSupportDetail
from lms.djangoapps.commerce.utils import EcommerceService
from lms.djangoapps.support.decorators import require_support_permission
diff --git a/lms/djangoapps/support/views/enrollments.py b/lms/djangoapps/support/views/enrollments.py
index 7240cf2658..b505af2655 100644
--- a/lms/djangoapps/support/views/enrollments.py
+++ b/lms/djangoapps/support/views/enrollments.py
@@ -16,8 +16,8 @@ from opaque_keys.edx.keys import CourseKey
from rest_framework.generics import GenericAPIView
from six import text_type
-from course_modes.models import CourseMode
-from edxmako.shortcuts import render_to_response
+from common.djangoapps.course_modes.models import CourseMode
+from common.djangoapps.edxmako.shortcuts import render_to_response
from lms.djangoapps.support.decorators import require_support_permission
from lms.djangoapps.support.serializers import ManualEnrollmentSerializer
from lms.djangoapps.verify_student.models import VerificationDeadline
@@ -25,8 +25,8 @@ from openedx.core.djangoapps.credit.email_utils import get_credit_provider_attri
from openedx.core.djangoapps.enrollments.api import get_enrollments, update_enrollment
from openedx.core.djangoapps.enrollments.errors import CourseModeNotFoundError
from openedx.core.djangoapps.enrollments.serializers import ModeSerializer
-from student.models import ENROLLED_TO_ENROLLED, CourseEnrollment, CourseEnrollmentAttribute, ManualEnrollmentAudit
-from util.json_request import JsonResponse
+from common.djangoapps.student.models import ENROLLED_TO_ENROLLED, CourseEnrollment, CourseEnrollmentAttribute, ManualEnrollmentAudit
+from common.djangoapps.util.json_request import JsonResponse
class EnrollmentSupportView(View):
diff --git a/lms/djangoapps/support/views/feature_based_enrollments.py b/lms/djangoapps/support/views/feature_based_enrollments.py
index d6511a82e9..a5b56ff339 100644
--- a/lms/djangoapps/support/views/feature_based_enrollments.py
+++ b/lms/djangoapps/support/views/feature_based_enrollments.py
@@ -9,7 +9,7 @@ from django.views.generic import View
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
-from edxmako.shortcuts import render_to_response
+from common.djangoapps.edxmako.shortcuts import render_to_response
from lms.djangoapps.support.decorators import require_support_permission
from openedx.core.djangoapps.content.course_overviews.models import CourseOverview
from openedx.features.content_type_gating.models import ContentTypeGatingConfig
diff --git a/lms/djangoapps/support/views/index.py b/lms/djangoapps/support/views/index.py
index ef81f1d58c..3f949746d0 100644
--- a/lms/djangoapps/support/views/index.py
+++ b/lms/djangoapps/support/views/index.py
@@ -6,7 +6,7 @@ Index view for the support app.
from django.urls import reverse_lazy
from django.utils.translation import ugettext_lazy as _
-from edxmako.shortcuts import render_to_response
+from common.djangoapps.edxmako.shortcuts import render_to_response
from lms.djangoapps.support.decorators import require_support_permission
SUPPORT_INDEX_URLS = [
diff --git a/lms/djangoapps/support/views/manage_user.py b/lms/djangoapps/support/views/manage_user.py
index ecf618e62e..df332fc331 100644
--- a/lms/djangoapps/support/views/manage_user.py
+++ b/lms/djangoapps/support/views/manage_user.py
@@ -11,12 +11,12 @@ from django.utils.translation import ugettext as _
from django.views.generic import View
from rest_framework.generics import GenericAPIView
-from student.models import UserPasswordToggleHistory
-from edxmako.shortcuts import render_to_response
+from common.djangoapps.student.models import UserPasswordToggleHistory
+from common.djangoapps.edxmako.shortcuts import render_to_response
from lms.djangoapps.support.decorators import require_support_permission
from openedx.core.djangoapps.user_api.accounts.serializers import AccountUserSerializer
from openedx.core.djangoapps.user_authn.utils import generate_password
-from util.json_request import JsonResponse
+from common.djangoapps.util.json_request import JsonResponse
class ManageUserSupportView(View):
diff --git a/lms/djangoapps/support/views/program_enrollments.py b/lms/djangoapps/support/views/program_enrollments.py
index 13424eedf4..80d2c83359 100644
--- a/lms/djangoapps/support/views/program_enrollments.py
+++ b/lms/djangoapps/support/views/program_enrollments.py
@@ -12,7 +12,7 @@ from django.utils.decorators import method_decorator
from django.views.generic import View
from social_django.models import UserSocialAuth
-from edxmako.shortcuts import render_to_response
+from common.djangoapps.edxmako.shortcuts import render_to_response
from lms.djangoapps.program_enrollments.api import (
fetch_program_enrollments_by_student,
get_users_by_external_keys_and_org_key,
@@ -29,7 +29,7 @@ from lms.djangoapps.support.serializers import (
serialize_user_info
)
from lms.djangoapps.verify_student.services import IDVerificationService
-from third_party_auth.models import SAMLProviderConfig
+from common.djangoapps.third_party_auth.models import SAMLProviderConfig
TEMPLATE_PATH = 'support/link_program_enrollments.html'
DATETIME_FORMAT = '%Y-%m-%dT%H:%M:%S'
diff --git a/lms/djangoapps/support/views/sso_records.py b/lms/djangoapps/support/views/sso_records.py
index 6c6313af48..32e620be2c 100644
--- a/lms/djangoapps/support/views/sso_records.py
+++ b/lms/djangoapps/support/views/sso_records.py
@@ -6,7 +6,7 @@ from social_django.models import UserSocialAuth
from lms.djangoapps.support.decorators import require_support_permission
from lms.djangoapps.support.serializers import serialize_sso_records
-from util.json_request import JsonResponse
+from common.djangoapps.util.json_request import JsonResponse
class SsoView(GenericAPIView):
diff --git a/lms/djangoapps/survey/models.py b/lms/djangoapps/survey/models.py
index 9dfa57a15b..4fb87ebac5 100644
--- a/lms/djangoapps/survey/models.py
+++ b/lms/djangoapps/survey/models.py
@@ -14,7 +14,7 @@ from model_utils.models import TimeStampedModel
from opaque_keys.edx.django.models import CourseKeyField
from openedx.core.djangolib.markup import HTML
-from student.models import User
+from common.djangoapps.student.models import User
from lms.djangoapps.survey.exceptions import SurveyFormNameAlreadyExists, SurveyFormNotFound
log = logging.getLogger("edx.survey")
diff --git a/lms/djangoapps/survey/tests/factories.py b/lms/djangoapps/survey/tests/factories.py
index 0966a40ec5..ff73e3b1e6 100644
--- a/lms/djangoapps/survey/tests/factories.py
+++ b/lms/djangoapps/survey/tests/factories.py
@@ -1,6 +1,6 @@
import factory
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from lms.djangoapps.survey.models import SurveyAnswer, SurveyForm
diff --git a/lms/djangoapps/survey/tests/test_signals.py b/lms/djangoapps/survey/tests/test_signals.py
index 3e3ac1bb33..5d0021d468 100644
--- a/lms/djangoapps/survey/tests/test_signals.py
+++ b/lms/djangoapps/survey/tests/test_signals.py
@@ -5,7 +5,7 @@ Test signal handlers for the survey app
from lms.djangoapps.survey.signals import _listen_for_lms_retire
from openedx.core.djangoapps.user_api.accounts.tests.retirement_helpers import fake_completed_retirement
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from lms.djangoapps.survey.models import SurveyAnswer
from lms.djangoapps.survey.tests.factories import SurveyAnswerFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
diff --git a/lms/djangoapps/survey/tests/test_views.py b/lms/djangoapps/survey/tests/test_views.py
index 9918e25e3c..dd928d92ee 100644
--- a/lms/djangoapps/survey/tests/test_views.py
+++ b/lms/djangoapps/survey/tests/test_views.py
@@ -10,7 +10,7 @@ import six
from django.test.client import Client
from django.urls import reverse
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from lms.djangoapps.survey.models import SurveyAnswer, SurveyForm
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/lms/djangoapps/survey/views.py b/lms/djangoapps/survey/views.py
index 68c37312bc..779a05ed78 100644
--- a/lms/djangoapps/survey/views.py
+++ b/lms/djangoapps/survey/views.py
@@ -14,7 +14,7 @@ from django.utils.html import escape
from django.views.decorators.http import require_POST
from opaque_keys.edx.keys import CourseKey
-from edxmako.shortcuts import render_to_response
+from common.djangoapps.edxmako.shortcuts import render_to_response
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
from lms.djangoapps.survey.models import SurveyForm
diff --git a/lms/djangoapps/teams/api.py b/lms/djangoapps/teams/api.py
index 80d263e068..143f3548a6 100644
--- a/lms/djangoapps/teams/api.py
+++ b/lms/djangoapps/teams/api.py
@@ -10,13 +10,13 @@ from django.db.models import Count, Q
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from lms.djangoapps.courseware.courses import has_access
from lms.djangoapps.discussion.django_comment_client.utils import has_discussion_privileges
from lms.djangoapps.teams.models import CourseTeam, CourseTeamMembership
from openedx.core.lib.teams_config import TeamsetType
-from student.models import CourseEnrollment, anonymous_id_for_user
-from student.roles import CourseInstructorRole, CourseStaffRole
+from common.djangoapps.student.models import CourseEnrollment, anonymous_id_for_user
+from common.djangoapps.student.roles import CourseInstructorRole, CourseStaffRole
from xmodule.modulestore.django import modulestore
logger = logging.getLogger(__name__)
diff --git a/lms/djangoapps/teams/csv.py b/lms/djangoapps/teams/csv.py
index c23f7ddb2e..f3690f0bbb 100644
--- a/lms/djangoapps/teams/csv.py
+++ b/lms/djangoapps/teams/csv.py
@@ -16,7 +16,7 @@ from lms.djangoapps.teams.api import (
)
from lms.djangoapps.teams.models import CourseTeam, CourseTeamMembership
from lms.djangoapps.program_enrollments.models import ProgramCourseEnrollment, ProgramEnrollment
-from student.models import CourseEnrollment
+from common.djangoapps.student.models import CourseEnrollment
from .utils import emit_team_event
diff --git a/lms/djangoapps/teams/migrations/0001_initial.py b/lms/djangoapps/teams/migrations/0001_initial.py
index 1b206d0bd0..1fdc9a60cf 100644
--- a/lms/djangoapps/teams/migrations/0001_initial.py
+++ b/lms/djangoapps/teams/migrations/0001_initial.py
@@ -6,7 +6,7 @@ from django.conf import settings
from django.db import migrations, models
from opaque_keys.edx.django.models import CourseKeyField
-import student.models
+from common.djangoapps.student import models as student_models
class Migration(migrations.Migration):
@@ -28,7 +28,7 @@ class Migration(migrations.Migration):
('date_created', models.DateTimeField(auto_now_add=True)),
('description', models.CharField(max_length=300)),
('country', django_countries.fields.CountryField(blank=True, max_length=2)),
- ('language', student.models.LanguageField(blank=True, help_text='Optional language the team uses as ISO 639-1 code.', max_length=16, choices=[['aa', 'Afar'], ['ab', 'Abkhazian'], ['af', 'Afrikaans'], ['ak', 'Akan'], ['sq', 'Albanian'], ['am', 'Amharic'], ['ar', 'Arabic'], ['an', 'Aragonese'], ['hy', 'Armenian'], ['as', 'Assamese'], ['av', 'Avaric'], ['ae', 'Avestan'], ['ay', 'Aymara'], ['az', 'Azerbaijani'], ['ba', 'Bashkir'], ['bm', 'Bambara'], ['eu', 'Basque'], ['be', 'Belarusian'], ['bn', 'Bengali'], ['bh', 'Bihari languages'], ['bi', 'Bislama'], ['bs', 'Bosnian'], ['br', 'Breton'], ['bg', 'Bulgarian'], ['my', 'Burmese'], ['ca', 'Catalan'], ['ch', 'Chamorro'], ['ce', 'Chechen'], ['zh', 'Chinese'], ['zh_HANS', 'Simplified Chinese'], ['zh_HANT', 'Traditional Chinese'], ['cu', 'Church Slavic'], ['cv', 'Chuvash'], ['kw', 'Cornish'], ['co', 'Corsican'], ['cr', 'Cree'], ['cs', 'Czech'], ['da', 'Danish'], ['dv', 'Divehi'], ['nl', 'Dutch'], ['dz', 'Dzongkha'], ['en', 'English'], ['eo', 'Esperanto'], ['et', 'Estonian'], ['ee', 'Ewe'], ['fo', 'Faroese'], ['fj', 'Fijian'], ['fi', 'Finnish'], ['fr', 'French'], ['fy', 'Western Frisian'], ['ff', 'Fulah'], ['ka', 'Georgian'], ['de', 'German'], ['gd', 'Gaelic'], ['ga', 'Irish'], ['gl', 'Galician'], ['gv', 'Manx'], ['el', 'Greek'], ['gn', 'Guarani'], ['gu', 'Gujarati'], ['ht', 'Haitian'], ['ha', 'Hausa'], ['he', 'Hebrew'], ['hz', 'Herero'], ['hi', 'Hindi'], ['ho', 'Hiri Motu'], ['hr', 'Croatian'], ['hu', 'Hungarian'], ['ig', 'Igbo'], ['is', 'Icelandic'], ['io', 'Ido'], ['ii', 'Sichuan Yi'], ['iu', 'Inuktitut'], ['ie', 'Interlingue'], ['ia', 'Interlingua'], ['id', 'Indonesian'], ['ik', 'Inupiaq'], ['it', 'Italian'], ['jv', 'Javanese'], ['ja', 'Japanese'], ['kl', 'Kalaallisut'], ['kn', 'Kannada'], ['ks', 'Kashmiri'], ['kr', 'Kanuri'], ['kk', 'Kazakh'], ['km', 'Central Khmer'], ['ki', 'Kikuyu'], ['rw', 'Kinyarwanda'], ['ky', 'Kirghiz'], ['kv', 'Komi'], ['kg', 'Kongo'], ['ko', 'Korean'], ['kj', 'Kuanyama'], ['ku', 'Kurdish'], ['lo', 'Lao'], ['la', 'Latin'], ['lv', 'Latvian'], ['li', 'Limburgan'], ['ln', 'Lingala'], ['lt', 'Lithuanian'], ['lb', 'Luxembourgish'], ['lu', 'Luba-Katanga'], ['lg', 'Ganda'], ['mk', 'Macedonian'], ['mh', 'Marshallese'], ['ml', 'Malayalam'], ['mi', 'Maori'], ['mr', 'Marathi'], ['ms', 'Malay'], ['mg', 'Malagasy'], ['mt', 'Maltese'], ['mn', 'Mongolian'], ['na', 'Nauru'], ['nv', 'Navajo'], ['nr', 'Ndebele, South'], ['nd', 'Ndebele, North'], ['ng', 'Ndonga'], ['ne', 'Nepali'], ['nn', 'Norwegian Nynorsk'], ['nb', 'Bokm\xe5l, Norwegian'], ['no', 'Norwegian'], ['ny', 'Chichewa'], ['oc', 'Occitan'], ['oj', 'Ojibwa'], ['or', 'Oriya'], ['om', 'Oromo'], ['os', 'Ossetian'], ['pa', 'Panjabi'], ['fa', 'Persian'], ['pi', 'Pali'], ['pl', 'Polish'], ['pt', 'Portuguese'], ['ps', 'Pushto'], ['qu', 'Quechua'], ['rm', 'Romansh'], ['ro', 'Romanian'], ['rn', 'Rundi'], ['ru', 'Russian'], ['sg', 'Sango'], ['sa', 'Sanskrit'], ['si', 'Sinhala'], ['sk', 'Slovak'], ['sl', 'Slovenian'], ['se', 'Northern Sami'], ['sm', 'Samoan'], ['sn', 'Shona'], ['sd', 'Sindhi'], ['so', 'Somali'], ['st', 'Sotho, Southern'], ['es', 'Spanish'], ['sc', 'Sardinian'], ['sr', 'Serbian'], ['ss', 'Swati'], ['su', 'Sundanese'], ['sw', 'Swahili'], ['sv', 'Swedish'], ['ty', 'Tahitian'], ['ta', 'Tamil'], ['tt', 'Tatar'], ['te', 'Telugu'], ['tg', 'Tajik'], ['tl', 'Tagalog'], ['th', 'Thai'], ['bo', 'Tibetan'], ['ti', 'Tigrinya'], ['to', 'Tonga (Tonga Islands)'], ['tn', 'Tswana'], ['ts', 'Tsonga'], ['tk', 'Turkmen'], ['tr', 'Turkish'], ['tw', 'Twi'], ['ug', 'Uighur'], ['uk', 'Ukrainian'], ['ur', 'Urdu'], ['uz', 'Uzbek'], ['ve', 'Venda'], ['vi', 'Vietnamese'], ['vo', 'Volap\xfck'], ['cy', 'Welsh'], ['wa', 'Walloon'], ['wo', 'Wolof'], ['xh', 'Xhosa'], ['yi', 'Yiddish'], ['yo', 'Yoruba'], ['za', 'Zhuang'], ['zu', 'Zulu']])),
+ ('language', student_models.LanguageField(blank=True, help_text='Optional language the team uses as ISO 639-1 code.', max_length=16, choices=[['aa', 'Afar'], ['ab', 'Abkhazian'], ['af', 'Afrikaans'], ['ak', 'Akan'], ['sq', 'Albanian'], ['am', 'Amharic'], ['ar', 'Arabic'], ['an', 'Aragonese'], ['hy', 'Armenian'], ['as', 'Assamese'], ['av', 'Avaric'], ['ae', 'Avestan'], ['ay', 'Aymara'], ['az', 'Azerbaijani'], ['ba', 'Bashkir'], ['bm', 'Bambara'], ['eu', 'Basque'], ['be', 'Belarusian'], ['bn', 'Bengali'], ['bh', 'Bihari languages'], ['bi', 'Bislama'], ['bs', 'Bosnian'], ['br', 'Breton'], ['bg', 'Bulgarian'], ['my', 'Burmese'], ['ca', 'Catalan'], ['ch', 'Chamorro'], ['ce', 'Chechen'], ['zh', 'Chinese'], ['zh_HANS', 'Simplified Chinese'], ['zh_HANT', 'Traditional Chinese'], ['cu', 'Church Slavic'], ['cv', 'Chuvash'], ['kw', 'Cornish'], ['co', 'Corsican'], ['cr', 'Cree'], ['cs', 'Czech'], ['da', 'Danish'], ['dv', 'Divehi'], ['nl', 'Dutch'], ['dz', 'Dzongkha'], ['en', 'English'], ['eo', 'Esperanto'], ['et', 'Estonian'], ['ee', 'Ewe'], ['fo', 'Faroese'], ['fj', 'Fijian'], ['fi', 'Finnish'], ['fr', 'French'], ['fy', 'Western Frisian'], ['ff', 'Fulah'], ['ka', 'Georgian'], ['de', 'German'], ['gd', 'Gaelic'], ['ga', 'Irish'], ['gl', 'Galician'], ['gv', 'Manx'], ['el', 'Greek'], ['gn', 'Guarani'], ['gu', 'Gujarati'], ['ht', 'Haitian'], ['ha', 'Hausa'], ['he', 'Hebrew'], ['hz', 'Herero'], ['hi', 'Hindi'], ['ho', 'Hiri Motu'], ['hr', 'Croatian'], ['hu', 'Hungarian'], ['ig', 'Igbo'], ['is', 'Icelandic'], ['io', 'Ido'], ['ii', 'Sichuan Yi'], ['iu', 'Inuktitut'], ['ie', 'Interlingue'], ['ia', 'Interlingua'], ['id', 'Indonesian'], ['ik', 'Inupiaq'], ['it', 'Italian'], ['jv', 'Javanese'], ['ja', 'Japanese'], ['kl', 'Kalaallisut'], ['kn', 'Kannada'], ['ks', 'Kashmiri'], ['kr', 'Kanuri'], ['kk', 'Kazakh'], ['km', 'Central Khmer'], ['ki', 'Kikuyu'], ['rw', 'Kinyarwanda'], ['ky', 'Kirghiz'], ['kv', 'Komi'], ['kg', 'Kongo'], ['ko', 'Korean'], ['kj', 'Kuanyama'], ['ku', 'Kurdish'], ['lo', 'Lao'], ['la', 'Latin'], ['lv', 'Latvian'], ['li', 'Limburgan'], ['ln', 'Lingala'], ['lt', 'Lithuanian'], ['lb', 'Luxembourgish'], ['lu', 'Luba-Katanga'], ['lg', 'Ganda'], ['mk', 'Macedonian'], ['mh', 'Marshallese'], ['ml', 'Malayalam'], ['mi', 'Maori'], ['mr', 'Marathi'], ['ms', 'Malay'], ['mg', 'Malagasy'], ['mt', 'Maltese'], ['mn', 'Mongolian'], ['na', 'Nauru'], ['nv', 'Navajo'], ['nr', 'Ndebele, South'], ['nd', 'Ndebele, North'], ['ng', 'Ndonga'], ['ne', 'Nepali'], ['nn', 'Norwegian Nynorsk'], ['nb', 'Bokm\xe5l, Norwegian'], ['no', 'Norwegian'], ['ny', 'Chichewa'], ['oc', 'Occitan'], ['oj', 'Ojibwa'], ['or', 'Oriya'], ['om', 'Oromo'], ['os', 'Ossetian'], ['pa', 'Panjabi'], ['fa', 'Persian'], ['pi', 'Pali'], ['pl', 'Polish'], ['pt', 'Portuguese'], ['ps', 'Pushto'], ['qu', 'Quechua'], ['rm', 'Romansh'], ['ro', 'Romanian'], ['rn', 'Rundi'], ['ru', 'Russian'], ['sg', 'Sango'], ['sa', 'Sanskrit'], ['si', 'Sinhala'], ['sk', 'Slovak'], ['sl', 'Slovenian'], ['se', 'Northern Sami'], ['sm', 'Samoan'], ['sn', 'Shona'], ['sd', 'Sindhi'], ['so', 'Somali'], ['st', 'Sotho, Southern'], ['es', 'Spanish'], ['sc', 'Sardinian'], ['sr', 'Serbian'], ['ss', 'Swati'], ['su', 'Sundanese'], ['sw', 'Swahili'], ['sv', 'Swedish'], ['ty', 'Tahitian'], ['ta', 'Tamil'], ['tt', 'Tatar'], ['te', 'Telugu'], ['tg', 'Tajik'], ['tl', 'Tagalog'], ['th', 'Thai'], ['bo', 'Tibetan'], ['ti', 'Tigrinya'], ['to', 'Tonga (Tonga Islands)'], ['tn', 'Tswana'], ['ts', 'Tsonga'], ['tk', 'Turkmen'], ['tr', 'Turkish'], ['tw', 'Twi'], ['ug', 'Uighur'], ['uk', 'Ukrainian'], ['ur', 'Urdu'], ['uz', 'Uzbek'], ['ve', 'Venda'], ['vi', 'Vietnamese'], ['vo', 'Volap\xfck'], ['cy', 'Welsh'], ['wa', 'Walloon'], ['wo', 'Wolof'], ['xh', 'Xhosa'], ['yi', 'Yiddish'], ['yo', 'Yoruba'], ['za', 'Zhuang'], ['zu', 'Zulu']])),
('last_activity_at', models.DateTimeField(db_index=True)),
('team_size', models.IntegerField(default=0, db_index=True)),
],
diff --git a/lms/djangoapps/teams/migrations/0004_alter_defaults.py b/lms/djangoapps/teams/migrations/0004_alter_defaults.py
index 078deb5c32..28a878812c 100644
--- a/lms/djangoapps/teams/migrations/0004_alter_defaults.py
+++ b/lms/djangoapps/teams/migrations/0004_alter_defaults.py
@@ -3,10 +3,10 @@
import django_countries.fields
-import student.models
from django.db import migrations, models
import lms.djangoapps.teams.models
+from common.djangoapps.student import models as student_models
class Migration(migrations.Migration):
@@ -23,7 +23,7 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='courseteam',
name='language',
- field=student.models.LanguageField(blank=True, choices=[['aa', 'Afar'], ['ab', 'Abkhazian'], ['af', 'Afrikaans'], ['ak', 'Akan'], ['sq', 'Albanian'], ['am', 'Amharic'], ['ar', 'Arabic'], ['an', 'Aragonese'], ['hy', 'Armenian'], ['as', 'Assamese'], ['av', 'Avaric'], ['ae', 'Avestan'], ['ay', 'Aymara'], ['az', 'Azerbaijani'], ['ba', 'Bashkir'], ['bm', 'Bambara'], ['eu', 'Basque'], ['be', 'Belarusian'], ['bn', 'Bengali'], ['bh', 'Bihari languages'], ['bi', 'Bislama'], ['bs', 'Bosnian'], ['br', 'Breton'], ['bg', 'Bulgarian'], ['my', 'Burmese'], ['ca', 'Catalan'], ['ch', 'Chamorro'], ['ce', 'Chechen'], ['zh', 'Chinese'], ['zh_HANS', 'Simplified Chinese'], ['zh_HANT', 'Traditional Chinese'], ['cu', 'Church Slavic'], ['cv', 'Chuvash'], ['kw', 'Cornish'], ['co', 'Corsican'], ['cr', 'Cree'], ['cs', 'Czech'], ['da', 'Danish'], ['dv', 'Divehi'], ['nl', 'Dutch'], ['dz', 'Dzongkha'], ['en', 'English'], ['eo', 'Esperanto'], ['et', 'Estonian'], ['ee', 'Ewe'], ['fo', 'Faroese'], ['fj', 'Fijian'], ['fi', 'Finnish'], ['fr', 'French'], ['fy', 'Western Frisian'], ['ff', 'Fulah'], ['ka', 'Georgian'], ['de', 'German'], ['gd', 'Gaelic'], ['ga', 'Irish'], ['gl', 'Galician'], ['gv', 'Manx'], ['el', 'Greek'], ['gn', 'Guarani'], ['gu', 'Gujarati'], ['ht', 'Haitian'], ['ha', 'Hausa'], ['he', 'Hebrew'], ['hz', 'Herero'], ['hi', 'Hindi'], ['ho', 'Hiri Motu'], ['hr', 'Croatian'], ['hu', 'Hungarian'], ['ig', 'Igbo'], ['is', 'Icelandic'], ['io', 'Ido'], ['ii', 'Sichuan Yi'], ['iu', 'Inuktitut'], ['ie', 'Interlingue'], ['ia', 'Interlingua'], ['id', 'Indonesian'], ['ik', 'Inupiaq'], ['it', 'Italian'], ['jv', 'Javanese'], ['ja', 'Japanese'], ['kl', 'Kalaallisut'], ['kn', 'Kannada'], ['ks', 'Kashmiri'], ['kr', 'Kanuri'], ['kk', 'Kazakh'], ['km', 'Central Khmer'], ['ki', 'Kikuyu'], ['rw', 'Kinyarwanda'], ['ky', 'Kirghiz'], ['kv', 'Komi'], ['kg', 'Kongo'], ['ko', 'Korean'], ['kj', 'Kuanyama'], ['ku', 'Kurdish'], ['lo', 'Lao'], ['la', 'Latin'], ['lv', 'Latvian'], ['li', 'Limburgan'], ['ln', 'Lingala'], ['lt', 'Lithuanian'], ['lb', 'Luxembourgish'], ['lu', 'Luba-Katanga'], ['lg', 'Ganda'], ['mk', 'Macedonian'], ['mh', 'Marshallese'], ['ml', 'Malayalam'], ['mi', 'Maori'], ['mr', 'Marathi'], ['ms', 'Malay'], ['mg', 'Malagasy'], ['mt', 'Maltese'], ['mn', 'Mongolian'], ['na', 'Nauru'], ['nv', 'Navajo'], ['nr', 'Ndebele, South'], ['nd', 'Ndebele, North'], ['ng', 'Ndonga'], ['ne', 'Nepali'], ['nn', 'Norwegian Nynorsk'], ['nb', 'Bokmål, Norwegian'], ['no', 'Norwegian'], ['ny', 'Chichewa'], ['oc', 'Occitan'], ['oj', 'Ojibwa'], ['or', 'Oriya'], ['om', 'Oromo'], ['os', 'Ossetian'], ['pa', 'Panjabi'], ['fa', 'Persian'], ['pi', 'Pali'], ['pl', 'Polish'], ['pt', 'Portuguese'], ['ps', 'Pushto'], ['qu', 'Quechua'], ['rm', 'Romansh'], ['ro', 'Romanian'], ['rn', 'Rundi'], ['ru', 'Russian'], ['sg', 'Sango'], ['sa', 'Sanskrit'], ['si', 'Sinhala'], ['sk', 'Slovak'], ['sl', 'Slovenian'], ['se', 'Northern Sami'], ['sm', 'Samoan'], ['sn', 'Shona'], ['sd', 'Sindhi'], ['so', 'Somali'], ['st', 'Sotho, Southern'], ['es', 'Spanish'], ['sc', 'Sardinian'], ['sr', 'Serbian'], ['ss', 'Swati'], ['su', 'Sundanese'], ['sw', 'Swahili'], ['sv', 'Swedish'], ['ty', 'Tahitian'], ['ta', 'Tamil'], ['tt', 'Tatar'], ['te', 'Telugu'], ['tg', 'Tajik'], ['tl', 'Tagalog'], ['th', 'Thai'], ['bo', 'Tibetan'], ['ti', 'Tigrinya'], ['to', 'Tonga (Tonga Islands)'], ['tn', 'Tswana'], ['ts', 'Tsonga'], ['tk', 'Turkmen'], ['tr', 'Turkish'], ['tw', 'Twi'], ['ug', 'Uighur'], ['uk', 'Ukrainian'], ['ur', 'Urdu'], ['uz', 'Uzbek'], ['ve', 'Venda'], ['vi', 'Vietnamese'], ['vo', 'Volapük'], ['cy', 'Welsh'], ['wa', 'Walloon'], ['wo', 'Wolof'], ['xh', 'Xhosa'], ['yi', 'Yiddish'], ['yo', 'Yoruba'], ['za', 'Zhuang'], ['zu', 'Zulu']], default='', help_text='Optional language the team uses as ISO 639-1 code.', max_length=16),
+ field=student_models.LanguageField(blank=True, choices=[['aa', 'Afar'], ['ab', 'Abkhazian'], ['af', 'Afrikaans'], ['ak', 'Akan'], ['sq', 'Albanian'], ['am', 'Amharic'], ['ar', 'Arabic'], ['an', 'Aragonese'], ['hy', 'Armenian'], ['as', 'Assamese'], ['av', 'Avaric'], ['ae', 'Avestan'], ['ay', 'Aymara'], ['az', 'Azerbaijani'], ['ba', 'Bashkir'], ['bm', 'Bambara'], ['eu', 'Basque'], ['be', 'Belarusian'], ['bn', 'Bengali'], ['bh', 'Bihari languages'], ['bi', 'Bislama'], ['bs', 'Bosnian'], ['br', 'Breton'], ['bg', 'Bulgarian'], ['my', 'Burmese'], ['ca', 'Catalan'], ['ch', 'Chamorro'], ['ce', 'Chechen'], ['zh', 'Chinese'], ['zh_HANS', 'Simplified Chinese'], ['zh_HANT', 'Traditional Chinese'], ['cu', 'Church Slavic'], ['cv', 'Chuvash'], ['kw', 'Cornish'], ['co', 'Corsican'], ['cr', 'Cree'], ['cs', 'Czech'], ['da', 'Danish'], ['dv', 'Divehi'], ['nl', 'Dutch'], ['dz', 'Dzongkha'], ['en', 'English'], ['eo', 'Esperanto'], ['et', 'Estonian'], ['ee', 'Ewe'], ['fo', 'Faroese'], ['fj', 'Fijian'], ['fi', 'Finnish'], ['fr', 'French'], ['fy', 'Western Frisian'], ['ff', 'Fulah'], ['ka', 'Georgian'], ['de', 'German'], ['gd', 'Gaelic'], ['ga', 'Irish'], ['gl', 'Galician'], ['gv', 'Manx'], ['el', 'Greek'], ['gn', 'Guarani'], ['gu', 'Gujarati'], ['ht', 'Haitian'], ['ha', 'Hausa'], ['he', 'Hebrew'], ['hz', 'Herero'], ['hi', 'Hindi'], ['ho', 'Hiri Motu'], ['hr', 'Croatian'], ['hu', 'Hungarian'], ['ig', 'Igbo'], ['is', 'Icelandic'], ['io', 'Ido'], ['ii', 'Sichuan Yi'], ['iu', 'Inuktitut'], ['ie', 'Interlingue'], ['ia', 'Interlingua'], ['id', 'Indonesian'], ['ik', 'Inupiaq'], ['it', 'Italian'], ['jv', 'Javanese'], ['ja', 'Japanese'], ['kl', 'Kalaallisut'], ['kn', 'Kannada'], ['ks', 'Kashmiri'], ['kr', 'Kanuri'], ['kk', 'Kazakh'], ['km', 'Central Khmer'], ['ki', 'Kikuyu'], ['rw', 'Kinyarwanda'], ['ky', 'Kirghiz'], ['kv', 'Komi'], ['kg', 'Kongo'], ['ko', 'Korean'], ['kj', 'Kuanyama'], ['ku', 'Kurdish'], ['lo', 'Lao'], ['la', 'Latin'], ['lv', 'Latvian'], ['li', 'Limburgan'], ['ln', 'Lingala'], ['lt', 'Lithuanian'], ['lb', 'Luxembourgish'], ['lu', 'Luba-Katanga'], ['lg', 'Ganda'], ['mk', 'Macedonian'], ['mh', 'Marshallese'], ['ml', 'Malayalam'], ['mi', 'Maori'], ['mr', 'Marathi'], ['ms', 'Malay'], ['mg', 'Malagasy'], ['mt', 'Maltese'], ['mn', 'Mongolian'], ['na', 'Nauru'], ['nv', 'Navajo'], ['nr', 'Ndebele, South'], ['nd', 'Ndebele, North'], ['ng', 'Ndonga'], ['ne', 'Nepali'], ['nn', 'Norwegian Nynorsk'], ['nb', 'Bokmål, Norwegian'], ['no', 'Norwegian'], ['ny', 'Chichewa'], ['oc', 'Occitan'], ['oj', 'Ojibwa'], ['or', 'Oriya'], ['om', 'Oromo'], ['os', 'Ossetian'], ['pa', 'Panjabi'], ['fa', 'Persian'], ['pi', 'Pali'], ['pl', 'Polish'], ['pt', 'Portuguese'], ['ps', 'Pushto'], ['qu', 'Quechua'], ['rm', 'Romansh'], ['ro', 'Romanian'], ['rn', 'Rundi'], ['ru', 'Russian'], ['sg', 'Sango'], ['sa', 'Sanskrit'], ['si', 'Sinhala'], ['sk', 'Slovak'], ['sl', 'Slovenian'], ['se', 'Northern Sami'], ['sm', 'Samoan'], ['sn', 'Shona'], ['sd', 'Sindhi'], ['so', 'Somali'], ['st', 'Sotho, Southern'], ['es', 'Spanish'], ['sc', 'Sardinian'], ['sr', 'Serbian'], ['ss', 'Swati'], ['su', 'Sundanese'], ['sw', 'Swahili'], ['sv', 'Swedish'], ['ty', 'Tahitian'], ['ta', 'Tamil'], ['tt', 'Tatar'], ['te', 'Telugu'], ['tg', 'Tajik'], ['tl', 'Tagalog'], ['th', 'Thai'], ['bo', 'Tibetan'], ['ti', 'Tigrinya'], ['to', 'Tonga (Tonga Islands)'], ['tn', 'Tswana'], ['ts', 'Tsonga'], ['tk', 'Turkmen'], ['tr', 'Turkish'], ['tw', 'Twi'], ['ug', 'Uighur'], ['uk', 'Ukrainian'], ['ur', 'Urdu'], ['uz', 'Uzbek'], ['ve', 'Venda'], ['vi', 'Vietnamese'], ['vo', 'Volapük'], ['cy', 'Welsh'], ['wa', 'Walloon'], ['wo', 'Wolof'], ['xh', 'Xhosa'], ['yi', 'Yiddish'], ['yo', 'Yoruba'], ['za', 'Zhuang'], ['zu', 'Zulu']], default='', help_text='Optional language the team uses as ISO 639-1 code.', max_length=16),
),
migrations.AlterField(
model_name='courseteam',
diff --git a/lms/djangoapps/teams/models.py b/lms/djangoapps/teams/models.py
index 2c8bb5251e..7f362e5806 100644
--- a/lms/djangoapps/teams/models.py
+++ b/lms/djangoapps/teams/models.py
@@ -33,7 +33,7 @@ from openedx.core.djangoapps.django_comment_common.signals import (
thread_unfollowed,
thread_voted
)
-from student.models import CourseEnrollment, LanguageField
+from common.djangoapps.student.models import CourseEnrollment, LanguageField
from .errors import (
AlreadyOnTeamInTeamset,
diff --git a/lms/djangoapps/teams/tests/test_api.py b/lms/djangoapps/teams/tests/test_api.py
index cb0839b0d0..2d82796237 100644
--- a/lms/djangoapps/teams/tests/test_api.py
+++ b/lms/djangoapps/teams/tests/test_api.py
@@ -9,14 +9,14 @@ import ddt
import mock
from opaque_keys.edx.keys import CourseKey
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from lms.djangoapps.teams import api as teams_api
from lms.djangoapps.teams.models import CourseTeam
from lms.djangoapps.teams.tests.factories import CourseTeamFactory
from openedx.core.lib.teams_config import TeamsConfig, TeamsetType
-from student.models import CourseEnrollment, AnonymousUserId
-from student.roles import CourseStaffRole
-from student.tests.factories import CourseEnrollmentFactory, UserFactory
+from common.djangoapps.student.models import CourseEnrollment, AnonymousUserId
+from common.djangoapps.student.roles import CourseStaffRole
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory, UserFactory
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/lms/djangoapps/teams/tests/test_csv.py b/lms/djangoapps/teams/tests/test_csv.py
index 4fc18db8de..337b32d406 100644
--- a/lms/djangoapps/teams/tests/test_csv.py
+++ b/lms/djangoapps/teams/tests/test_csv.py
@@ -9,8 +9,8 @@ from lms.djangoapps.teams import csv
from lms.djangoapps.teams.models import CourseTeam, CourseTeamMembership
from lms.djangoapps.teams.tests.factories import CourseTeamFactory
from openedx.core.lib.teams_config import TeamsConfig
-from student.tests.factories import CourseEnrollmentFactory, UserFactory
-from util.testing import EventTestMixin
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory, UserFactory
+from common.djangoapps.util.testing import EventTestMixin
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/lms/djangoapps/teams/tests/test_models.py b/lms/djangoapps/teams/tests/test_models.py
index a0b99fa33f..50fa17b8a4 100644
--- a/lms/djangoapps/teams/tests/test_models.py
+++ b/lms/djangoapps/teams/tests/test_models.py
@@ -14,7 +14,7 @@ import six
from mock import Mock, patch
from opaque_keys.edx.keys import CourseKey
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from lms.djangoapps.teams import TEAM_DISCUSSION_CONTEXT
from lms.djangoapps.teams.errors import AddToIncompatibleTeamError
from lms.djangoapps.teams.models import CourseTeam, CourseTeamMembership
@@ -31,8 +31,8 @@ from openedx.core.djangoapps.django_comment_common.signals import (
thread_voted
)
from openedx.core.lib.teams_config import TeamsConfig
-from student.tests.factories import CourseEnrollmentFactory, UserFactory
-from util.testing import EventTestMixin
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory, UserFactory
+from common.djangoapps.util.testing import EventTestMixin
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/lms/djangoapps/teams/tests/test_serializers.py b/lms/djangoapps/teams/tests/test_serializers.py
index e3de6e73fc..809da1c785 100644
--- a/lms/djangoapps/teams/tests/test_serializers.py
+++ b/lms/djangoapps/teams/tests/test_serializers.py
@@ -11,7 +11,7 @@ from django.test.client import RequestFactory
from lms.djangoapps.teams.serializers import BulkTeamCountTopicSerializer, MembershipSerializer, TopicSerializer
from lms.djangoapps.teams.tests.factories import CourseTeamFactory, CourseTeamMembershipFactory
from openedx.core.lib.teams_config import TeamsConfig
-from student.tests.factories import CourseEnrollmentFactory, UserFactory
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory, UserFactory
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/lms/djangoapps/teams/tests/test_services.py b/lms/djangoapps/teams/tests/test_services.py
index 6b31a9ca8c..5172ab84a5 100644
--- a/lms/djangoapps/teams/tests/test_services.py
+++ b/lms/djangoapps/teams/tests/test_services.py
@@ -6,7 +6,7 @@ Tests for any Teams app services
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from openedx.core.djangoapps.catalog.tests.factories import CourseRunFactory
-from student.tests.factories import CourseEnrollmentFactory, UserFactory
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory, UserFactory
from lms.djangoapps.teams.services import TeamsService
from lms.djangoapps.teams.tests.factories import CourseTeamFactory
diff --git a/lms/djangoapps/teams/tests/test_views.py b/lms/djangoapps/teams/tests/test_views.py
index 073b6b5cbf..2728e32faf 100644
--- a/lms/djangoapps/teams/tests/test_views.py
+++ b/lms/djangoapps/teams/tests/test_views.py
@@ -24,15 +24,15 @@ from search.search_engine_base import SearchEngine
from six.moves import range
from common.test.utils import skip_signal
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from lms.djangoapps.courseware.tests.factories import StaffFactory
from openedx.core.djangoapps.django_comment_common.models import FORUM_ROLE_COMMUNITY_TA, Role
from openedx.core.djangoapps.django_comment_common.utils import seed_permissions_roles
from openedx.core.lib.teams_config import TeamsConfig
-from student.models import CourseEnrollment
+from common.djangoapps.student.models import CourseEnrollment
from lms.djangoapps.program_enrollments.tests.factories import ProgramEnrollmentFactory
-from student.tests.factories import AdminFactory, CourseEnrollmentFactory, UserFactory
-from util.testing import EventTestMixin
+from common.djangoapps.student.tests.factories import AdminFactory, CourseEnrollmentFactory, UserFactory
+from common.djangoapps.util.testing import EventTestMixin
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
diff --git a/lms/djangoapps/teams/utils.py b/lms/djangoapps/teams/utils.py
index 3014f79a43..13e242e36c 100644
--- a/lms/djangoapps/teams/utils.py
+++ b/lms/djangoapps/teams/utils.py
@@ -5,7 +5,7 @@ Utility methods related to teams.
from eventtracking import tracker
-from track import contexts
+from common.djangoapps.track import contexts
def emit_team_event(event_name, course_key, event_data):
diff --git a/lms/djangoapps/teams/views.py b/lms/djangoapps/teams/views.py
index de81a44170..eb35d0d107 100644
--- a/lms/djangoapps/teams/views.py
+++ b/lms/djangoapps/teams/views.py
@@ -41,8 +41,8 @@ from openedx.core.lib.api.view_utils import (
add_serializer_errors,
build_api_error
)
-from student.models import CourseAccessRole, CourseEnrollment
-from util.model_utils import truncate_fields
+from common.djangoapps.student.models import CourseAccessRole, CourseEnrollment
+from common.djangoapps.util.model_utils import truncate_fields
from xmodule.modulestore.django import modulestore
from . import is_feature_enabled
diff --git a/lms/djangoapps/verify_student/management/commands/backfill_sso_verifications_for_old_account_links.py b/lms/djangoapps/verify_student/management/commands/backfill_sso_verifications_for_old_account_links.py
index 71492302ce..4126bacc6c 100644
--- a/lms/djangoapps/verify_student/management/commands/backfill_sso_verifications_for_old_account_links.py
+++ b/lms/djangoapps/verify_student/management/commands/backfill_sso_verifications_for_old_account_links.py
@@ -17,7 +17,7 @@ from social_django.models import UserSocialAuth
from common.djangoapps.third_party_auth.api.utils import filter_user_social_auth_queryset_by_provider
from lms.djangoapps.verify_student.models import SSOVerification
-from third_party_auth.provider import Registry
+from common.djangoapps.third_party_auth.provider import Registry
class Command(BaseCommand):
diff --git a/lms/djangoapps/verify_student/management/commands/populate_expiry_date.py b/lms/djangoapps/verify_student/management/commands/populate_expiry_date.py
index 4f9ed84108..0ed1c116c1 100644
--- a/lms/djangoapps/verify_student/management/commands/populate_expiry_date.py
+++ b/lms/djangoapps/verify_student/management/commands/populate_expiry_date.py
@@ -12,7 +12,7 @@ from django.core.management.base import BaseCommand
from django.db.models import F
from lms.djangoapps.verify_student.models import SoftwareSecurePhotoVerification
-from util.query import use_read_replica_if_available
+from common.djangoapps.util.query import use_read_replica_if_available
logger = logging.getLogger(__name__)
diff --git a/lms/djangoapps/verify_student/management/commands/send_verification_expiry_email.py b/lms/djangoapps/verify_student/management/commands/send_verification_expiry_email.py
index 0f53be6fab..259eeb0121 100644
--- a/lms/djangoapps/verify_student/management/commands/send_verification_expiry_email.py
+++ b/lms/djangoapps/verify_student/management/commands/send_verification_expiry_email.py
@@ -7,7 +7,7 @@ import logging
import time
from datetime import timedelta
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
@@ -17,8 +17,8 @@ from django.urls import reverse
from django.utils.timezone import now
from edx_ace import ace
from edx_ace.recipient import Recipient
-from student.models import CourseEnrollment
-from util.query import use_read_replica_if_available
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.util.query import use_read_replica_if_available
from lms.djangoapps.verify_student.message_types import VerificationExpiry
from lms.djangoapps.verify_student.models import ManualVerification, SoftwareSecurePhotoVerification, SSOVerification
diff --git a/lms/djangoapps/verify_student/management/commands/tests/test_backfill_sso_verifications_for_old_account_links.py b/lms/djangoapps/verify_student/management/commands/tests/test_backfill_sso_verifications_for_old_account_links.py
index 666b9e6e1c..b0181efaa3 100644
--- a/lms/djangoapps/verify_student/management/commands/tests/test_backfill_sso_verifications_for_old_account_links.py
+++ b/lms/djangoapps/verify_student/management/commands/tests/test_backfill_sso_verifications_for_old_account_links.py
@@ -10,7 +10,7 @@ from django.core.management.base import CommandError
from lms.djangoapps.program_enrollments.management.commands.tests.utils import UserSocialAuthFactory
from lms.djangoapps.verify_student.models import SSOVerification
from lms.djangoapps.verify_student.tests.factories import SSOVerificationFactory
-from third_party_auth.tests.testutil import TestCase
+from common.djangoapps.third_party_auth.tests.testutil import TestCase
class TestBackfillSSOVerificationsCommand(TestCase):
diff --git a/lms/djangoapps/verify_student/management/commands/tests/test_manual_verify_student.py b/lms/djangoapps/verify_student/management/commands/tests/test_manual_verify_student.py
index c85704026e..cd2ac26bdf 100644
--- a/lms/djangoapps/verify_student/management/commands/tests/test_manual_verify_student.py
+++ b/lms/djangoapps/verify_student/management/commands/tests/test_manual_verify_student.py
@@ -15,7 +15,7 @@ from testfixtures import LogCapture
from lms.djangoapps.verify_student.models import ManualVerification
from lms.djangoapps.verify_student.utils import earliest_allowed_verification_date
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
LOGGER_NAME = 'lms.djangoapps.verify_student.management.commands.manual_verifications'
diff --git a/lms/djangoapps/verify_student/management/commands/tests/test_populate_expiry_date.py b/lms/djangoapps/verify_student/management/commands/tests/test_populate_expiry_date.py
index 8a3ec881f9..35445b5cbc 100644
--- a/lms/djangoapps/verify_student/management/commands/tests/test_populate_expiry_date.py
+++ b/lms/djangoapps/verify_student/management/commands/tests/test_populate_expiry_date.py
@@ -14,7 +14,7 @@ from testfixtures import LogCapture
from common.test.utils import MockS3BotoMixin
from lms.djangoapps.verify_student.models import SoftwareSecurePhotoVerification
from lms.djangoapps.verify_student.tests.test_models import FAKE_SETTINGS, mock_software_secure_post
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
LOGGER_NAME = 'lms.djangoapps.verify_student.management.commands.populate_expiry_date'
diff --git a/lms/djangoapps/verify_student/management/commands/tests/test_send_verification_expiry_email.py b/lms/djangoapps/verify_student/management/commands/tests/test_send_verification_expiry_email.py
index 7b2e950eed..964fe38c05 100644
--- a/lms/djangoapps/verify_student/management/commands/tests/test_send_verification_expiry_email.py
+++ b/lms/djangoapps/verify_student/management/commands/tests/test_send_verification_expiry_email.py
@@ -13,7 +13,7 @@ from django.test import TestCase
from django.test.utils import override_settings
from django.utils.timezone import now
from mock import patch
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from testfixtures import LogCapture
from common.test.utils import MockS3BotoMixin
diff --git a/lms/djangoapps/verify_student/management/commands/tests/test_verify_student.py b/lms/djangoapps/verify_student/management/commands/tests/test_verify_student.py
index 5cfa3667e6..c88dc6758c 100644
--- a/lms/djangoapps/verify_student/management/commands/tests/test_verify_student.py
+++ b/lms/djangoapps/verify_student/management/commands/tests/test_verify_student.py
@@ -17,7 +17,7 @@ from lms.djangoapps.verify_student.tests.test_models import (
mock_software_secure_post,
mock_software_secure_post_error
)
-from student.tests.factories import UserFactory # pylint: disable=import-error, useless-suppression
+from common.djangoapps.student.tests.factories import UserFactory # pylint: disable=import-error, useless-suppression
LOGGER_NAME = 'retry_photo_verification'
diff --git a/lms/djangoapps/verify_student/migrations/0006_ssoverification.py b/lms/djangoapps/verify_student/migrations/0006_ssoverification.py
index 9264bc512f..4f53cb9079 100644
--- a/lms/djangoapps/verify_student/migrations/0006_ssoverification.py
+++ b/lms/djangoapps/verify_student/migrations/0006_ssoverification.py
@@ -26,7 +26,19 @@ class Migration(migrations.Migration):
('name', models.CharField(blank=True, max_length=255)),
('created_at', models.DateTimeField(auto_now_add=True, db_index=True)),
('updated_at', models.DateTimeField(auto_now=True, db_index=True)),
- ('identity_provider_type', models.CharField(choices=[(u'third_party_auth.models.OAuth2ProviderConfig', u'OAuth2 Provider'), (u'third_party_auth.models.SAMLProviderConfig', u'SAML Provider'), (u'third_party_auth.models.LTIProviderConfig', u'LTI Provider')], default=u'third_party_auth.models.SAMLProviderConfig', help_text=u'Specifies which type of Identity Provider this verification originated from.', max_length=100)),
+ (
+ 'identity_provider_type',
+ models.CharField(
+ choices=[
+ (u'common.djangoapps.third_party_auth.models.OAuth2ProviderConfig', u'OAuth2 Provider'),
+ (u'common.djangoapps.third_party_auth.models.SAMLProviderConfig', u'SAML Provider'),
+ (u'common.djangoapps.third_party_auth.models.LTIProviderConfig', u'LTI Provider'),
+ ],
+ default=u'common.djangoapps.third_party_auth.models.SAMLProviderConfig',
+ help_text=u'Specifies which type of Identity Provider this verification originated from.',
+ max_length=100,
+ ),
+ ),
('identity_provider_slug', models.SlugField(default=u'default', help_text=u'The slug uniquely identifying the Identity Provider this verification originated from.', max_length=30)),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
diff --git a/lms/djangoapps/verify_student/models.py b/lms/djangoapps/verify_student/models.py
index 98ac86e438..e7a9eb95de 100644
--- a/lms/djangoapps/verify_student/models.py
+++ b/lms/djangoapps/verify_student/models.py
@@ -190,9 +190,9 @@ class SSOVerification(IDVerificationAttempt):
.. no_pii:
"""
- OAUTH2 = u'third_party_auth.models.OAuth2ProviderConfig'
- SAML = u'third_party_auth.models.SAMLProviderConfig'
- LTI = u'third_party_auth.models.LTIProviderConfig'
+ OAUTH2 = u'common.djangoapps.third_party_auth.models.OAuth2ProviderConfig'
+ SAML = u'common.djangoapps.third_party_auth.models.SAMLProviderConfig'
+ LTI = u'common.djangoapps.third_party_auth.models.LTIProviderConfig'
IDENTITY_PROVIDER_TYPE_CHOICES = (
(OAUTH2, u'OAuth2 Provider'),
(SAML, u'SAML Provider'),
diff --git a/lms/djangoapps/verify_student/services.py b/lms/djangoapps/verify_student/services.py
index e565644b09..a57df2321a 100644
--- a/lms/djangoapps/verify_student/services.py
+++ b/lms/djangoapps/verify_student/services.py
@@ -10,10 +10,10 @@ from django.urls import reverse
from django.utils import timezone
from django.utils.translation import ugettext as _
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from lms.djangoapps.verify_student.utils import is_verification_expiring_soon
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
-from student.models import User
+from common.djangoapps.student.models import User
from .models import ManualVerification, SoftwareSecurePhotoVerification, SSOVerification
from .toggles import redirect_to_idv_microfrontend
diff --git a/lms/djangoapps/verify_student/tasks.py b/lms/djangoapps/verify_student/tasks.py
index 081e241f22..9ced28e260 100644
--- a/lms/djangoapps/verify_student/tasks.py
+++ b/lms/djangoapps/verify_student/tasks.py
@@ -12,7 +12,7 @@ from celery.states import FAILURE
from django.conf import settings
from django.core.mail import EmailMessage
-from edxmako.shortcuts import render_to_string
+from common.djangoapps.edxmako.shortcuts import render_to_string
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
ACE_ROUTING_KEY = getattr(settings, 'ACE_ROUTING_KEY', None)
diff --git a/lms/djangoapps/verify_student/tests/__init__.py b/lms/djangoapps/verify_student/tests/__init__.py
index e889ad708b..e6ec9d043a 100644
--- a/lms/djangoapps/verify_student/tests/__init__.py
+++ b/lms/djangoapps/verify_student/tests/__init__.py
@@ -8,7 +8,7 @@ from django.test import TestCase
from django.utils.timezone import now
from lms.djangoapps.verify_student.models import SoftwareSecurePhotoVerification
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
class TestVerificationBase(TestCase):
diff --git a/lms/djangoapps/verify_student/tests/fake_software_secure.py b/lms/djangoapps/verify_student/tests/fake_software_secure.py
index 063162b1fd..9303b7e9c9 100644
--- a/lms/djangoapps/verify_student/tests/fake_software_secure.py
+++ b/lms/djangoapps/verify_student/tests/fake_software_secure.py
@@ -9,7 +9,7 @@ from django.urls import reverse
from django.utils.decorators import method_decorator
from django.views.generic.base import View
-from edxmako.shortcuts import render_to_response
+from common.djangoapps.edxmako.shortcuts import render_to_response
from lms.djangoapps.verify_student.models import SoftwareSecurePhotoVerification
diff --git a/lms/djangoapps/verify_student/tests/test_fake_software_secure.py b/lms/djangoapps/verify_student/tests/test_fake_software_secure.py
index ced1428482..ae4ffec876 100644
--- a/lms/djangoapps/verify_student/tests/test_fake_software_secure.py
+++ b/lms/djangoapps/verify_student/tests/test_fake_software_secure.py
@@ -7,8 +7,8 @@ from django.test import TestCase
from mock import patch
from lms.djangoapps.verify_student.models import SoftwareSecurePhotoVerification
-from student.tests.factories import UserFactory
-from util.testing import UrlResetMixin
+from common.djangoapps.student.tests.factories import UserFactory
+from common.djangoapps.util.testing import UrlResetMixin
class SoftwareSecureFakeViewTest(UrlResetMixin, TestCase):
diff --git a/lms/djangoapps/verify_student/tests/test_integration.py b/lms/djangoapps/verify_student/tests/test_integration.py
index be12b7fffc..1191d51ea7 100644
--- a/lms/djangoapps/verify_student/tests/test_integration.py
+++ b/lms/djangoapps/verify_student/tests/test_integration.py
@@ -5,10 +5,10 @@ Integration tests of the payment flow, including course mode selection.
import six
from django.urls import reverse
-from course_modes.tests.factories import CourseModeFactory
+from common.djangoapps.course_modes.tests.factories import CourseModeFactory
from lms.djangoapps.commerce.tests.mocks import mock_payment_processors
-from student.models import CourseEnrollment
-from student.tests.factories import UserFactory
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/lms/djangoapps/verify_student/tests/test_models.py b/lms/djangoapps/verify_student/tests/test_models.py
index c3af0917d7..654b9b1926 100644
--- a/lms/djangoapps/verify_student/tests/test_models.py
+++ b/lms/djangoapps/verify_student/tests/test_models.py
@@ -21,7 +21,7 @@ from lms.djangoapps.verify_student.models import (
SSOVerification,
VerificationException
)
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from lms.djangoapps.verify_student.tests import TestVerificationBase
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
diff --git a/lms/djangoapps/verify_student/tests/test_services.py b/lms/djangoapps/verify_student/tests/test_services.py
index e4a1f485ed..39c703bf92 100644
--- a/lms/djangoapps/verify_student/tests/test_services.py
+++ b/lms/djangoapps/verify_student/tests/test_services.py
@@ -14,7 +14,7 @@ from pytz import utc
from lms.djangoapps.verify_student.models import ManualVerification, SoftwareSecurePhotoVerification, SSOVerification
from lms.djangoapps.verify_student.services import IDVerificationService
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/lms/djangoapps/verify_student/tests/test_signals.py b/lms/djangoapps/verify_student/tests/test_signals.py
index d107ba67fe..2d9bc09f14 100644
--- a/lms/djangoapps/verify_student/tests/test_signals.py
+++ b/lms/djangoapps/verify_student/tests/test_signals.py
@@ -11,7 +11,7 @@ from lms.djangoapps.verify_student.models import SoftwareSecurePhotoVerification
from lms.djangoapps.verify_student.signals import _listen_for_course_publish, _listen_for_lms_retire
from lms.djangoapps.verify_student.tests.factories import SoftwareSecurePhotoVerificationFactory
from openedx.core.djangoapps.user_api.accounts.tests.retirement_helpers import fake_completed_retirement
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/lms/djangoapps/verify_student/tests/test_utils.py b/lms/djangoapps/verify_student/tests/test_utils.py
index a340968019..9adb9bf052 100644
--- a/lms/djangoapps/verify_student/tests/test_utils.py
+++ b/lms/djangoapps/verify_student/tests/test_utils.py
@@ -20,7 +20,7 @@ from lms.djangoapps.verify_student.utils import (
submit_request_to_ss,
verification_for_datetime
)
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
FAKE_SETTINGS = {
"DAYS_GOOD_FOR": 10,
diff --git a/lms/djangoapps/verify_student/tests/test_views.py b/lms/djangoapps/verify_student/tests/test_views.py
index a4ca870a71..8140362019 100644
--- a/lms/djangoapps/verify_student/tests/test_views.py
+++ b/lms/djangoapps/verify_student/tests/test_views.py
@@ -25,8 +25,8 @@ from six.moves import zip
from waffle.testutils import override_switch
from common.test.utils import MockS3BotoMixin, XssTestMixin
-from course_modes.models import CourseMode
-from course_modes.tests.factories import CourseModeFactory
+from common.djangoapps.course_modes.models import CourseMode
+from common.djangoapps.course_modes.tests.factories import CourseModeFactory
from lms.djangoapps.commerce.models import CommerceConfiguration
from lms.djangoapps.commerce.tests import TEST_API_URL, TEST_PAYMENT_DATA, TEST_PUBLIC_URL_ROOT
from lms.djangoapps.commerce.tests.mocks import mock_payment_processors
@@ -36,9 +36,9 @@ from lms.djangoapps.verify_student.views import PayAndVerifyView, checkout_with_
from openedx.core.djangoapps.embargo.test_utils import restrict_course
from openedx.core.djangoapps.theming.tests.test_util import with_comprehensive_theme
from openedx.core.djangoapps.user_api.accounts.api import get_account_settings
-from student.models import CourseEnrollment
-from student.tests.factories import CourseEnrollmentFactory, UserFactory
-from util.testing import UrlResetMixin
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory, UserFactory
+from common.djangoapps.util.testing import UrlResetMixin
from lms.djangoapps.verify_student.tests import TestVerificationBase
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.django import modulestore
diff --git a/lms/djangoapps/verify_student/views.py b/lms/djangoapps/verify_student/views.py
index c84f3134bb..7e3aded42a 100644
--- a/lms/djangoapps/verify_student/views.py
+++ b/lms/djangoapps/verify_student/views.py
@@ -29,8 +29,8 @@ from opaque_keys.edx.keys import CourseKey
from rest_framework.response import Response
from rest_framework.views import APIView
-from course_modes.models import CourseMode
-from edxmako.shortcuts import render_to_response
+from common.djangoapps.course_modes.models import CourseMode
+from common.djangoapps.edxmako.shortcuts import render_to_response
from lms.djangoapps.commerce.utils import EcommerceService, is_account_activation_requirement_disabled
from lms.djangoapps.verify_student.emails import send_verification_approved_email, send_verification_confirmation_email
from lms.djangoapps.verify_student.image import InvalidImageData, decode_image_data
@@ -45,10 +45,10 @@ from openedx.core.djangoapps.user_api.accounts import NAME_MIN_LENGTH
from openedx.core.djangoapps.user_api.accounts.api import update_account_settings
from openedx.core.djangoapps.user_api.errors import AccountValidationError, UserNotFound
from openedx.core.lib.log_utils import audit_log
-from student.models import CourseEnrollment
-from track import segment
-from util.db import outer_atomic
-from util.json_request import JsonResponse
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.track import segment
+from common.djangoapps.util.db import outer_atomic
+from common.djangoapps.util.json_request import JsonResponse
from xmodule.modulestore.django import modulestore
from .services import IDVerificationService
diff --git a/lms/envs/bok_choy.py b/lms/envs/bok_choy.py
index cab4720a5f..6c2f16e963 100644
--- a/lms/envs/bok_choy.py
+++ b/lms/envs/bok_choy.py
@@ -90,7 +90,7 @@ GRADES_DOWNLOAD = {
LOG_OVERRIDES = [
('track.middleware', logging.CRITICAL),
- ('edxmako.shortcuts', logging.ERROR),
+ ('common.djangoapps.edxmako.shortcuts', logging.ERROR),
('edx.discussion', logging.CRITICAL),
]
for log_name, log_level in LOG_OVERRIDES:
diff --git a/lms/envs/bok_choy.yml b/lms/envs/bok_choy.yml
index 9cbb67e65a..ba2ca578d5 100644
--- a/lms/envs/bok_choy.yml
+++ b/lms/envs/bok_choy.yml
@@ -20,27 +20,27 @@ BLOCK_STRUCTURES_SETTINGS:
CACHES:
celery:
BACKEND: django.core.cache.backends.memcached.MemcachedCache
- KEY_FUNCTION: util.memcache.safe_key
+ KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: integration_celery
LOCATION: ['localhost:11211']
default:
BACKEND: django.core.cache.backends.memcached.MemcachedCache
- KEY_FUNCTION: util.memcache.safe_key
+ KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: sandbox_default
LOCATION: ['localhost:11211']
general:
BACKEND: django.core.cache.backends.memcached.MemcachedCache
- KEY_FUNCTION: util.memcache.safe_key
+ KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: sandbox_general
LOCATION: ['localhost:11211']
mongo_metadata_inheritance:
BACKEND: django.core.cache.backends.memcached.MemcachedCache
- KEY_FUNCTION: util.memcache.safe_key
+ KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: integration_mongo_metadata_inheritance
LOCATION: ['localhost:11211']
staticfiles:
BACKEND: django.core.cache.backends.memcached.MemcachedCache
- KEY_FUNCTION: util.memcache.safe_key
+ KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: integration_static_files
LOCATION: ['localhost:11211']
@@ -201,7 +201,7 @@ MODULESTORE:
fs_root: '** OVERRIDDEN **'
host: [localhost]
port: 27017
- render_template: edxmako.shortcuts.render_to_string
+ render_template: common.djangoapps.edxmako.shortcuts.render_to_string
- ENGINE: xmodule.modulestore.xml.XMLModuleStore
NAME: xml
OPTIONS: {data_dir: '** OVERRIDDEN **', default_class: xmodule.hidden_module.HiddenDescriptor}
@@ -229,8 +229,8 @@ SUPPORT_SITE_LINK: https://support.example.com
SYSLOG_SERVER: ''
TECH_SUPPORT_EMAIL: technical@example.com
THIRD_PARTY_AUTH_BACKENDS: [social_core.backends.google.GoogleOAuth2, social_core.backends.linkedin.LinkedinOAuth2,
- social_core.backends.facebook.FacebookOAuth2, third_party_auth.dummy.DummyBackend,
- third_party_auth.saml.SAMLAuthBackend]
+ social_core.backends.facebook.FacebookOAuth2, common.djangoapps.third_party_auth.dummy.DummyBackend,
+ common.djangoapps.third_party_auth.saml.SAMLAuthBackend]
THIRD_PARTY_AUTH:
Google:
SOCIAL_AUTH_GOOGLE_OAUTH2_KEY": "test"
@@ -241,7 +241,7 @@ THIRD_PARTY_AUTH:
TIME_ZONE: America/New_York
TRACKING_BACKENDS:
mongo:
- ENGINE: track.backends.mongodb.MongoBackend
+ ENGINE: common.djangoapps.track.backends.mongodb.MongoBackend
OPTIONS: {collection: events, database: test}
WIKI_ENABLED: true
WAFFLE_OVERRIDE: True
diff --git a/lms/envs/bok_choy_docker.yml b/lms/envs/bok_choy_docker.yml
index dd48b3e026..21ccda2df5 100644
--- a/lms/envs/bok_choy_docker.yml
+++ b/lms/envs/bok_choy_docker.yml
@@ -9,27 +9,27 @@ BULK_EMAIL_DEFAULT_FROM_EMAIL: no-reply@example.com
CACHES:
celery:
BACKEND: django.core.cache.backends.memcached.MemcachedCache
- KEY_FUNCTION: util.memcache.safe_key
+ KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: integration_celery
LOCATION: ['edx.devstack.memcached:11211']
default:
BACKEND: django.core.cache.backends.memcached.MemcachedCache
- KEY_FUNCTION: util.memcache.safe_key
+ KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: sandbox_default
LOCATION: ['edx.devstack.memcached:11211']
general:
BACKEND: django.core.cache.backends.memcached.MemcachedCache
- KEY_FUNCTION: util.memcache.safe_key
+ KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: sandbox_general
LOCATION: ['edx.devstack.memcached:11211']
mongo_metadata_inheritance:
BACKEND: django.core.cache.backends.memcached.MemcachedCache
- KEY_FUNCTION: util.memcache.safe_key
+ KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: integration_mongo_metadata_inheritance
LOCATION: ['edx.devstack.memcached:11211']
staticfiles:
BACKEND: django.core.cache.backends.memcached.MemcachedCache
- KEY_FUNCTION: util.memcache.safe_key
+ KEY_FUNCTION: common.djangoapps.util.memcache.safe_key
KEY_PREFIX: integration_static_files
LOCATION: ['edx.devstack.memcached:11211']
CELERY_BROKER_HOSTNAME: localhost
@@ -122,7 +122,7 @@ MODULESTORE:
fs_root: '** OVERRIDDEN **'
host: [edx.devstack.mongo]
port: 27017
- render_template: edxmako.shortcuts.render_to_string
+ render_template: common.djangoapps.edxmako.shortcuts.render_to_string
- ENGINE: xmodule.modulestore.xml.XMLModuleStore
NAME: xml
OPTIONS: {data_dir: '** OVERRIDDEN **', default_class: xmodule.hidden_module.HiddenDescriptor}
@@ -143,12 +143,12 @@ SUPPORT_SITE_LINK: https://support.example.com
SYSLOG_SERVER: ''
TECH_SUPPORT_EMAIL: technical@example.com
THIRD_PARTY_AUTH_BACKENDS: [social_core.backends.google.GoogleOAuth2, social_core.backends.linkedin.LinkedinOAuth2,
- social_core.backends.facebook.FacebookOAuth2, third_party_auth.dummy.DummyBackend,
- third_party_auth.saml.SAMLAuthBackend]
+ social_core.backends.facebook.FacebookOAuth2, common.djangoapps.third_party_auth.dummy.DummyBackend,
+ common.djangoapps.third_party_auth.saml.SAMLAuthBackend]
TIME_ZONE: America/New_York
TRACKING_BACKENDS:
mongo:
- ENGINE: track.backends.mongodb.MongoBackend
+ ENGINE: common.djangoapps.track.backends.mongodb.MongoBackend
OPTIONS:
collection: events
database: test
diff --git a/lms/envs/common.py b/lms/envs/common.py
index 186a98d759..5572bd1ddf 100644
--- a/lms/envs/common.py
+++ b/lms/envs/common.py
@@ -755,12 +755,10 @@ NODE_MODULES_ROOT = REPO_ROOT / "node_modules"
DATA_DIR = COURSES_ROOT
-# TODO: Is this next line necessary?
-sys.path.append(REPO_ROOT)
-# TODO: The next two path modifications will be removed in an upcoming Open edX release.
+# TODO: This path modification exists as temporary support for deprecated import patterns.
+# It will be removed in an upcoming Open edX release.
# See docs/decisions/0007-sys-path-modification-removal.rst
sys.path.append(REPO_ROOT / 'import_shims' / 'lms')
-sys.path.append(COMMON_ROOT / 'djangoapps')
# For Node.js
@@ -789,53 +787,53 @@ DATABASE_ROUTERS = [
CACHES = {
'blockstore': {
'KEY_PREFIX': 'blockstore',
- 'KEY_FUNCTION': 'util.memcache.safe_key',
+ 'KEY_FUNCTION': 'common.djangoapps.util.memcache.safe_key',
'LOCATION': ['localhost:11211'],
'TIMEOUT': '86400', # This data should be long-lived for performance, BundleCache handles invalidation
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
},
'course_structure_cache': {
'KEY_PREFIX': 'course_structure',
- 'KEY_FUNCTION': 'util.memcache.safe_key',
+ 'KEY_FUNCTION': 'common.djangoapps.util.memcache.safe_key',
'LOCATION': ['localhost:11211'],
'TIMEOUT': '7200',
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
},
'celery': {
'KEY_PREFIX': 'celery',
- 'KEY_FUNCTION': 'util.memcache.safe_key',
+ 'KEY_FUNCTION': 'common.djangoapps.util.memcache.safe_key',
'LOCATION': ['localhost:11211'],
'TIMEOUT': '7200',
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
},
'mongo_metadata_inheritance': {
'KEY_PREFIX': 'mongo_metadata_inheritance',
- 'KEY_FUNCTION': 'util.memcache.safe_key',
+ 'KEY_FUNCTION': 'common.djangoapps.util.memcache.safe_key',
'LOCATION': ['localhost:11211'],
'TIMEOUT': 300,
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
},
'staticfiles': {
- 'KEY_FUNCTION': 'util.memcache.safe_key',
+ 'KEY_FUNCTION': 'common.djangoapps.util.memcache.safe_key',
'LOCATION': ['localhost:11211'],
'KEY_PREFIX': 'staticfiles_general',
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
},
'default': {
'VERSION': '1',
- 'KEY_FUNCTION': 'util.memcache.safe_key',
+ 'KEY_FUNCTION': 'common.djangoapps.util.memcache.safe_key',
'LOCATION': ['localhost:11211'],
'KEY_PREFIX': 'default',
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
},
'configuration': {
- 'KEY_FUNCTION': 'util.memcache.safe_key',
+ 'KEY_FUNCTION': 'common.djangoapps.util.memcache.safe_key',
'LOCATION': ['localhost:11211'],
'KEY_PREFIX': 'configuration',
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
},
'general': {
- 'KEY_FUNCTION': 'util.memcache.safe_key',
+ 'KEY_FUNCTION': 'common.djangoapps.util.memcache.safe_key',
'LOCATION': ['localhost:11211'],
'KEY_PREFIX': 'general',
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
@@ -931,7 +929,7 @@ CONTEXT_PROCESSORS = [
'sekizai.context_processors.sekizai',
# Hack to get required link URLs to password reset templates
- 'edxmako.shortcuts.marketing_link_context_processor',
+ 'common.djangoapps.edxmako.shortcuts.marketing_link_context_processor',
# Timezone processor (sends language and time_zone preference)
'lms.djangoapps.courseware.context_processor.user_timezone_locale_prefs',
@@ -965,8 +963,8 @@ TEMPLATES = [
# We have to use mako-aware template loaders to be able to include
# mako templates inside django templates (such as main_django.html).
'openedx.core.djangoapps.theming.template_loaders.ThemeTemplateLoader',
- 'edxmako.makoloader.MakoFilesystemLoader',
- 'edxmako.makoloader.MakoAppDirectoriesLoader',
+ 'common.djangoapps.edxmako.makoloader.MakoFilesystemLoader',
+ 'common.djangoapps.edxmako.makoloader.MakoAppDirectoriesLoader',
],
'context_processors': CONTEXT_PROCESSORS,
# Change 'debug' in your environment settings files - not here.
@@ -975,7 +973,7 @@ TEMPLATES = [
},
{
'NAME': 'mako',
- 'BACKEND': 'edxmako.backend.Mako',
+ 'BACKEND': 'common.djangoapps.edxmako.backend.Mako',
# Don't look for template source files inside installed applications.
'APP_DIRS': False,
# Instead, look for template source files in these dirs.
@@ -1106,7 +1104,7 @@ DEBUG_TRACK_LOG = False
TRACKING_BACKENDS = {
'logger': {
- 'ENGINE': 'track.backends.logger.LoggerBackend',
+ 'ENGINE': 'common.djangoapps.track.backends.logger.LoggerBackend',
'OPTIONS': {
'name': 'tracking'
}
@@ -1132,8 +1130,8 @@ EVENT_TRACKING_BACKENDS = {
}
},
'processors': [
- {'ENGINE': 'track.shim.LegacyFieldMappingProcessor'},
- {'ENGINE': 'track.shim.PrefixedEventProcessor'}
+ {'ENGINE': 'common.djangoapps.track.shim.LegacyFieldMappingProcessor'},
+ {'ENGINE': 'common.djangoapps.track.shim.PrefixedEventProcessor'}
]
}
},
@@ -1151,7 +1149,7 @@ EVENT_TRACKING_BACKENDS = {
}
},
{
- 'ENGINE': 'track.shim.GoogleAnalyticsProcessor'
+ 'ENGINE': 'common.djangoapps.track.shim.GoogleAnalyticsProcessor'
}
]
}
@@ -1261,7 +1259,7 @@ MODULESTORE = {
'OPTIONS': {
'default_class': 'xmodule.hidden_module.HiddenDescriptor',
'fs_root': DATA_DIR,
- 'render_template': 'edxmako.shortcuts.render_to_string',
+ 'render_template': 'common.djangoapps.edxmako.shortcuts.render_to_string',
}
},
{
@@ -1271,7 +1269,7 @@ MODULESTORE = {
'OPTIONS': {
'default_class': 'xmodule.hidden_module.HiddenDescriptor',
'fs_root': DATA_DIR,
- 'render_template': 'edxmako.shortcuts.render_to_string',
+ 'render_template': 'common.djangoapps.edxmako.shortcuts.render_to_string',
}
}
]
@@ -1715,7 +1713,7 @@ MIDDLEWARE = [
#'django.contrib.auth.middleware.AuthenticationMiddleware',
'openedx.core.djangoapps.cache_toolbox.middleware.CacheBackedAuthenticationMiddleware',
- 'student.middleware.UserStandingMiddleware',
+ 'common.djangoapps.student.middleware.UserStandingMiddleware',
'openedx.core.djangoapps.contentserver.middleware.StaticContentServer',
# Adds user tags to tracking events
@@ -1723,7 +1721,7 @@ MIDDLEWARE = [
'openedx.core.djangoapps.user_api.middleware.UserTagsEventContextMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
- 'track.middleware.TrackMiddleware',
+ 'common.djangoapps.track.middleware.TrackMiddleware',
# CORS and CSRF
'corsheaders.middleware.CorsMiddleware',
@@ -2480,12 +2478,12 @@ INSTALLED_APPS = [
'openedx.core.djangoapps.service_status',
# Display status message to students
- 'status',
+ 'common.djangoapps.status',
# For asset pipelining
- 'edxmako.apps.EdxMakoConfig',
+ 'common.djangoapps.edxmako.apps.EdxMakoConfig',
'pipeline',
- 'static_replace',
+ 'common.djangoapps.static_replace',
'webpack_loader',
# For user interface plugins
@@ -2507,13 +2505,13 @@ INSTALLED_APPS = [
# Our courseware
'lms.djangoapps.courseware',
'lms.djangoapps.coursewarehistoryextended',
- 'student.apps.StudentConfig',
+ 'common.djangoapps.student.apps.StudentConfig',
'lms.djangoapps.static_template_view',
'lms.djangoapps.staticbook',
- 'track',
+ 'common.djangoapps.track',
'eventtracking.django.apps.EventTrackingConfig',
- 'util',
+ 'common.djangoapps.util',
'lms.djangoapps.certificates.apps.CertificatesConfig',
'lms.djangoapps.dashboard',
'lms.djangoapps.instructor_task',
@@ -2531,7 +2529,7 @@ INSTALLED_APPS = [
'oauth2_provider',
'openedx.core.djangoapps.oauth_dispatch.apps.OAuthDispatchAppConfig',
- 'third_party_auth',
+ 'common.djangoapps.third_party_auth',
# System Wide Roles
'openedx.core.djangoapps.system_wide_roles',
@@ -2575,13 +2573,13 @@ INSTALLED_APPS = [
'lms.djangoapps.shoppingcart',
# Different Course Modes
- 'course_modes.apps.CourseModesConfig',
+ 'common.djangoapps.course_modes.apps.CourseModesConfig',
# Enrollment API
'openedx.core.djangoapps.enrollments',
# Entitlement API
- 'entitlements.apps.EntitlementsConfig',
+ 'common.djangoapps.entitlements.apps.EntitlementsConfig',
# Bulk Enrollment API
'lms.djangoapps.bulk_enroll',
@@ -2599,7 +2597,7 @@ INSTALLED_APPS = [
'openedx.core.djangoapps.embargo',
# Course action state
- 'course_action_state',
+ 'common.djangoapps.course_action_state',
# Additional problem types
'edx_jsme', # Molecular Structure
@@ -2640,7 +2638,7 @@ INSTALLED_APPS = [
# Course teams
'lms.djangoapps.teams',
- 'xblock_django',
+ 'common.djangoapps.xblock_django',
# programs support
'openedx.core.djangoapps.programs.apps.ProgramsConfig',
@@ -2695,7 +2693,7 @@ INSTALLED_APPS = [
'openedx.core.djangoapps.crawlers',
# Unusual migrations
- 'database_fixups',
+ 'common.djangoapps.database_fixups',
'openedx.core.djangoapps.waffle_utils',
@@ -3079,13 +3077,13 @@ AUTH_PASSWORD_VALIDATORS = [
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
},
{
- "NAME": "util.password_policy_validators.MinimumLengthValidator",
+ "NAME": "common.djangoapps.util.password_policy_validators.MinimumLengthValidator",
"OPTIONS": {
"min_length": 2
}
},
{
- "NAME": "util.password_policy_validators.MaximumLengthValidator",
+ "NAME": "common.djangoapps.util.password_policy_validators.MaximumLengthValidator",
"OPTIONS": {
"max_length": 75
}
diff --git a/lms/envs/devstack.py b/lms/envs/devstack.py
index 769228ef17..8dc01e8024 100644
--- a/lms/envs/devstack.py
+++ b/lms/envs/devstack.py
@@ -46,8 +46,8 @@ IDA_LOGOUT_URI_LIST = [
################################ LOGGERS ######################################
LOG_OVERRIDES = [
- ('track.contexts', logging.CRITICAL),
- ('track.middleware', logging.CRITICAL),
+ ('common.djangoapps.track.contexts', logging.CRITICAL),
+ ('common.djangoapps.track.middleware', logging.CRITICAL),
('lms.djangoapps.discussion.django_comment_client.utils', logging.CRITICAL),
]
for log_name, log_level in LOG_OVERRIDES:
@@ -222,8 +222,10 @@ FEATURES['ENABLE_COURSEWARE_MICROFRONTEND'] = True
########################## Third Party Auth #######################
-if FEATURES.get('ENABLE_THIRD_PARTY_AUTH') and 'third_party_auth.dummy.DummyBackend' not in AUTHENTICATION_BACKENDS:
- AUTHENTICATION_BACKENDS = ['third_party_auth.dummy.DummyBackend'] + list(AUTHENTICATION_BACKENDS)
+if FEATURES.get('ENABLE_THIRD_PARTY_AUTH') and (
+ 'common.djangoapps.third_party_auth.dummy.DummyBackend' not in AUTHENTICATION_BACKENDS
+):
+ AUTHENTICATION_BACKENDS = ['common.djangoapps.third_party_auth.dummy.DummyBackend'] + list(AUTHENTICATION_BACKENDS)
############## ECOMMERCE API CONFIGURATION SETTINGS ###############
ECOMMERCE_PUBLIC_URL_ROOT = 'http://localhost:18130'
diff --git a/lms/envs/devstack_decentralized.py b/lms/envs/devstack_decentralized.py
index f08323b752..44b0c53280 100644
--- a/lms/envs/devstack_decentralized.py
+++ b/lms/envs/devstack_decentralized.py
@@ -45,8 +45,8 @@ IDA_LOGOUT_URI_LIST = [
################################ LOGGERS ######################################
LOG_OVERRIDES = [
- ('track.contexts', logging.CRITICAL),
- ('track.middleware', logging.CRITICAL),
+ ('common.djangoapps.track.contexts', logging.CRITICAL),
+ ('common.djangoapps.track.middleware', logging.CRITICAL),
('lms.djangoapps.discussion.django_comment_client.utils', logging.CRITICAL),
]
for log_name, log_level in LOG_OVERRIDES:
@@ -188,8 +188,10 @@ FEATURES['ENABLE_COURSEWARE_MICROFRONTEND'] = True
########################## Third Party Auth #######################
-if FEATURES.get('ENABLE_THIRD_PARTY_AUTH') and 'third_party_auth.dummy.DummyBackend' not in AUTHENTICATION_BACKENDS:
- AUTHENTICATION_BACKENDS = ['third_party_auth.dummy.DummyBackend'] + list(AUTHENTICATION_BACKENDS)
+if FEATURES.get('ENABLE_THIRD_PARTY_AUTH') and (
+ 'common.djangoapps.third_party_auth.dummy.DummyBackend' not in AUTHENTICATION_BACKENDS
+):
+ AUTHENTICATION_BACKENDS = ['common.djangoapps.third_party_auth.dummy.DummyBackend'] + list(AUTHENTICATION_BACKENDS)
############## ECOMMERCE API CONFIGURATION SETTINGS ###############
ECOMMERCE_PUBLIC_URL_ROOT = 'http://localhost:18130'
diff --git a/lms/envs/docs/README.rst b/lms/envs/docs/README.rst
index 2a1d0f2326..3cacfbc6ef 100644
--- a/lms/envs/docs/README.rst
+++ b/lms/envs/docs/README.rst
@@ -87,7 +87,7 @@ when nested within each other::
},
{
'NAME': 'mako',
- 'BACKEND': 'edxmako.backend.Mako',
+ 'BACKEND': 'common.djangoapps.edxmako.backend.Mako',
'APP_DIRS': False,
'DIRS': _make_mako_template_dirs,
},
diff --git a/lms/envs/production.py b/lms/envs/production.py
index f664103932..c5d7fb1cd4 100644
--- a/lms/envs/production.py
+++ b/lms/envs/production.py
@@ -629,10 +629,10 @@ if FEATURES.get('ENABLE_THIRD_PARTY_AUTH'):
'social_core.backends.linkedin.LinkedinOAuth2',
'social_core.backends.facebook.FacebookOAuth2',
'social_core.backends.azuread.AzureADOAuth2',
- 'third_party_auth.appleid.AppleIdAuth', # vendored 'social_core.backends.apple.AppleIdAuth'
- 'third_party_auth.identityserver3.IdentityServer3',
- 'third_party_auth.saml.SAMLAuthBackend',
- 'third_party_auth.lti.LTIAuthBackend',
+ 'common.djangoapps.third_party_auth.appleid.AppleIdAuth', # vendored 'social_core.backends.apple.AppleIdAuth'
+ 'common.djangoapps.third_party_auth.identityserver3.IdentityServer3',
+ 'common.djangoapps.third_party_auth.saml.SAMLAuthBackend',
+ 'common.djangoapps.third_party_auth.lti.LTIAuthBackend',
])
AUTHENTICATION_BACKENDS = list(tmp_backends) + list(AUTHENTICATION_BACKENDS)
@@ -658,7 +658,7 @@ if FEATURES.get('ENABLE_THIRD_PARTY_AUTH'):
if ENV_TOKENS.get('THIRD_PARTY_AUTH_SAML_FETCH_PERIOD_HOURS', 24) is not None:
CELERYBEAT_SCHEDULE['refresh-saml-metadata'] = {
- 'task': 'third_party_auth.fetch_saml_metadata',
+ 'task': 'common.djangoapps.third_party_auth.fetch_saml_metadata',
'schedule': datetime.timedelta(hours=ENV_TOKENS.get('THIRD_PARTY_AUTH_SAML_FETCH_PERIOD_HOURS', 24)),
}
diff --git a/lms/envs/static.py b/lms/envs/static.py
index 7982d96460..ab0bea3b48 100644
--- a/lms/envs/static.py
+++ b/lms/envs/static.py
@@ -42,7 +42,7 @@ CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
'LOCATION': 'edx_loc_mem_cache',
- 'KEY_FUNCTION': 'util.memcache.safe_key',
+ 'KEY_FUNCTION': 'common.djangoapps.util.memcache.safe_key',
},
# The general cache is what you get if you use our util.cache. It's used for
@@ -54,7 +54,7 @@ CACHES = {
'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
'KEY_PREFIX': 'general',
'VERSION': 4,
- 'KEY_FUNCTION': 'util.memcache.safe_key',
+ 'KEY_FUNCTION': 'common.djangoapps.util.memcache.safe_key',
}
}
diff --git a/lms/envs/test.py b/lms/envs/test.py
index c65cfcc921..a59b5a8100 100644
--- a/lms/envs/test.py
+++ b/lms/envs/test.py
@@ -34,7 +34,7 @@ from xmodule.modulestore.modulestore_settings import update_module_store_setting
from .common import *
-from util.testing import patch_sessions, patch_testcase # pylint: disable=wrong-import-order
+from common.djangoapps.util.testing import patch_sessions, patch_testcase # pylint: disable=wrong-import-order
# This patch disables the commit_on_success decorator during tests
# in TestCase subclasses.
@@ -220,7 +220,7 @@ CACHES = {
# Blockstore caching tests require a cache that actually works:
'blockstore': {
'KEY_PREFIX': 'blockstore',
- 'KEY_FUNCTION': 'util.memcache.safe_key',
+ 'KEY_FUNCTION': 'common.djangoapps.util.memcache.safe_key',
'LOCATION': 'edx_loc_mem_cache',
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
},
@@ -253,10 +253,10 @@ AUTHENTICATION_BACKENDS = [
'social_core.backends.facebook.FacebookOAuth2',
'social_core.backends.azuread.AzureADOAuth2',
'social_core.backends.twitter.TwitterOAuth',
- 'third_party_auth.identityserver3.IdentityServer3',
- 'third_party_auth.dummy.DummyBackend',
- 'third_party_auth.saml.SAMLAuthBackend',
- 'third_party_auth.lti.LTIAuthBackend',
+ 'common.djangoapps.third_party_auth.identityserver3.IdentityServer3',
+ 'common.djangoapps.third_party_auth.dummy.DummyBackend',
+ 'common.djangoapps.third_party_auth.saml.SAMLAuthBackend',
+ 'common.djangoapps.third_party_auth.lti.LTIAuthBackend',
] + AUTHENTICATION_BACKENDS
THIRD_PARTY_AUTH_CUSTOM_AUTH_FORMS = {
diff --git a/lms/lib/courseware_search/lms_filter_generator.py b/lms/lib/courseware_search/lms_filter_generator.py
index 852dde71b4..e3cec0f559 100644
--- a/lms/lib/courseware_search/lms_filter_generator.py
+++ b/lms/lib/courseware_search/lms_filter_generator.py
@@ -10,7 +10,7 @@ from search.filter_generator import SearchFilterGenerator
from openedx.core.djangoapps.course_groups.partition_scheme import CohortPartitionScheme
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
from openedx.core.djangoapps.user_api.partition_schemes import RandomUserPartitionScheme
-from student.models import CourseEnrollment
+from common.djangoapps.student.models import CourseEnrollment
INCLUDE_SCHEMES = [CohortPartitionScheme, RandomUserPartitionScheme, ]
SCHEME_SUPPORTS_ASSIGNMENT = [RandomUserPartitionScheme, ]
diff --git a/lms/lib/courseware_search/test/test_lms_filter_generator.py b/lms/lib/courseware_search/test/test_lms_filter_generator.py
index 210d4192c3..ea16908892 100644
--- a/lms/lib/courseware_search/test/test_lms_filter_generator.py
+++ b/lms/lib/courseware_search/test/test_lms_filter_generator.py
@@ -7,8 +7,8 @@ import six
from mock import Mock, patch
from lms.lib.courseware_search.lms_filter_generator import LmsSearchFilterGenerator
-from student.models import CourseEnrollment
-from student.tests.factories import UserFactory
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
diff --git a/lms/static/js/instructor_dashboard/instructor_dashboard.js b/lms/static/js/instructor_dashboard/instructor_dashboard.js
index 8c1d564769..12bca47788 100644
--- a/lms/static/js/instructor_dashboard/instructor_dashboard.js
+++ b/lms/static/js/instructor_dashboard/instructor_dashboard.js
@@ -6,7 +6,7 @@ The instructor dashboard is broken into sections.
Only one section is visible at a time,
and is responsible for its own functionality.
-NOTE: plantTimeout (which is just setTimeout from util.js)
+NOTE: plantTimeout (which is just setTimeout from common.djangoapps.util.js)
is used frequently in the instructor dashboard to isolate
failures. If one piece of code under a plantTimeout fails
then it will not crash the rest of the dashboard.
diff --git a/lms/templates/courseware/course_about.html b/lms/templates/courseware/course_about.html
index 8c1ebd83b7..c09acc06d8 100644
--- a/lms/templates/courseware/course_about.html
+++ b/lms/templates/courseware/course_about.html
@@ -7,7 +7,7 @@ from django.urls import reverse
from lms.djangoapps.courseware.courses import get_course_about_section
from django.conf import settings
from six import text_type
-from edxmako.shortcuts import marketing_link
+from common.djangoapps.edxmako.shortcuts import marketing_link
from openedx.core.djangolib.js_utils import js_escaped_string
from openedx.core.djangolib.markup import clean_dangerous_html, HTML, Text
from openedx.core.lib.courses import course_image_url
diff --git a/lms/templates/courseware/gradebook.html b/lms/templates/courseware/gradebook.html
index dbae15c386..5207431873 100644
--- a/lms/templates/courseware/gradebook.html
+++ b/lms/templates/courseware/gradebook.html
@@ -79,7 +79,7 @@ from six import text_type
<%
tooltip_str = section['detail']
# We are making header labels from the first student record. So for tool tip (title),
- # I am processing this string ```section['detail']``` from student record and removing
+ # I am processing this string ```section['detail']``` from common.djangoapps.student record and removing
# all student related data i.e marks, percentage etc to get only the title of homework.
if "=" in section['detail']:
tooltip_str = section['detail'][0: section['detail'].rfind('=')]
diff --git a/lms/templates/courseware/progress.html b/lms/templates/courseware/progress.html
index 18ba42a71b..1ccf50a965 100644
--- a/lms/templates/courseware/progress.html
+++ b/lms/templates/courseware/progress.html
@@ -3,7 +3,7 @@
<%namespace name='static' file='/static_content.html'/>
<%def name="online_help_token()"><% return "progress" %>%def>
<%!
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from lms.djangoapps.certificates.models import CertificateStatuses
from lms.djangoapps.grades.api import constants as grades_constants
from django.utils.translation import ugettext as _
diff --git a/lms/templates/dashboard.html b/lms/templates/dashboard.html
index 2721a6bd27..063dea1bcf 100644
--- a/lms/templates/dashboard.html
+++ b/lms/templates/dashboard.html
@@ -9,16 +9,16 @@ from datetime import datetime, timedelta
from django.urls import reverse
from django.utils.translation import ugettext as _
from django.template import RequestContext
-from entitlements.models import CourseEntitlement
-from third_party_auth import pipeline
-from util.date_utils import strftime_localized
+from common.djangoapps.entitlements.models import CourseEntitlement
+from common.djangoapps.third_party_auth import pipeline
+from common.djangoapps.util.date_utils import strftime_localized
from opaque_keys.edx.keys import CourseKey
from openedx.core.djangoapps.content.course_overviews.models import CourseOverview
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
from openedx.core.djangolib.js_utils import dump_js_escaped_json, js_escaped_string
from openedx.core.djangolib.markup import HTML, Text
-from student.models import CourseEnrollment
+from common.djangoapps.student.models import CourseEnrollment
%>
<%
diff --git a/lms/templates/dashboard/_dashboard_certificate_information.html b/lms/templates/dashboard/_dashboard_certificate_information.html
index 62f4b81bb8..230122bcd1 100644
--- a/lms/templates/dashboard/_dashboard_certificate_information.html
+++ b/lms/templates/dashboard/_dashboard_certificate_information.html
@@ -3,8 +3,8 @@
<%!
from django.utils.translation import ugettext as _
from openedx.core.djangolib.markup import HTML, Text
-from course_modes.models import CourseMode
-from util.course import should_display_grade
+from common.djangoapps.course_modes.models import CourseMode
+from common.djangoapps.util.course import should_display_grade
%>
<%namespace name='static' file='../static_content.html'/>
diff --git a/lms/templates/dashboard/_dashboard_course_listing.html b/lms/templates/dashboard/_dashboard_course_listing.html
index 254bf81f39..621f92584b 100644
--- a/lms/templates/dashboard/_dashboard_course_listing.html
+++ b/lms/templates/dashboard/_dashboard_course_listing.html
@@ -9,13 +9,13 @@ from django.utils.http import urlencode, urlquote_plus
from django.utils.translation import ugettext as _
from django.utils.translation import ungettext
from django.urls import reverse
-from course_modes.models import CourseMode
-from course_modes.helpers import enrollment_mode_display
+from common.djangoapps.course_modes.models import CourseMode
+from common.djangoapps.course_modes.helpers import enrollment_mode_display
from lms.djangoapps.verify_student.services import IDVerificationService
from openedx.core.djangolib.js_utils import dump_js_escaped_json, js_escaped_string
from openedx.core.djangolib.markup import HTML, Text
from openedx.features.course_experience import course_home_url_name
-from student.helpers import (
+from common.djangoapps.student.helpers import (
VERIFY_STATUS_NEED_TO_VERIFY,
VERIFY_STATUS_SUBMITTED,
VERIFY_STATUS_RESUBMITTED,
@@ -24,7 +24,7 @@ from student.helpers import (
VERIFY_STATUS_NEED_TO_REVERIFY,
DISABLE_UNENROLL_CERT_STATES,
)
-from util.course import get_link_for_about_page, get_encoded_course_sharing_utm_params
+from common.djangoapps.util.course import get_link_for_about_page, get_encoded_course_sharing_utm_params
from lms.djangoapps.experiments.utils import UPSELL_TRACKING_FLAG
%>
diff --git a/lms/templates/dates_banner.html b/lms/templates/dates_banner.html
index 143fe657e1..8e95f78df7 100644
--- a/lms/templates/dates_banner.html
+++ b/lms/templates/dates_banner.html
@@ -5,7 +5,7 @@
from django.utils.translation import ugettext as _
from lms.djangoapps.courseware.date_summary import CourseAssignmentDate
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
%>
<%
diff --git a/lms/templates/financial-assistance/financial-assistance.html b/lms/templates/financial-assistance/financial-assistance.html
index 23ae661f7c..4321b6e453 100644
--- a/lms/templates/financial-assistance/financial-assistance.html
+++ b/lms/templates/financial-assistance/financial-assistance.html
@@ -4,7 +4,7 @@
from django.urls import reverse
from django.utils.translation import ugettext as _
-from edxmako.shortcuts import marketing_link
+from common.djangoapps.edxmako.shortcuts import marketing_link
%>
diff --git a/lms/templates/main.html b/lms/templates/main.html
index 93b02c7184..14b02024c3 100644
--- a/lms/templates/main.html
+++ b/lms/templates/main.html
@@ -24,7 +24,7 @@ from lms.djangoapps.courseware.access import has_access
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
from openedx.core.djangolib.js_utils import dump_js_escaped_json, js_escaped_string
from openedx.core.release import RELEASE_LINE
-from pipeline_mako import render_require_js_path_overrides
+from common.djangoapps.pipeline_mako import render_require_js_path_overrides
%>
diff --git a/lms/templates/page_banner.html b/lms/templates/page_banner.html
index 2b8139e834..1ecebd5ab0 100644
--- a/lms/templates/page_banner.html
+++ b/lms/templates/page_banner.html
@@ -9,7 +9,7 @@ from django.utils.translation import ugettext as _
from openedx.core.djangolib.markup import HTML
from openedx.core.djangoapps.util.user_messages import PageLevelMessages, UserMessage, UserMessageType
# app that handles site status messages
-from status.status import get_site_status_msg
+from common.djangoapps.status.status import get_site_status_msg
%>
<%
diff --git a/lms/templates/signup_modal.html b/lms/templates/signup_modal.html
index f8ae07a982..9f2705a9b8 100644
--- a/lms/templates/signup_modal.html
+++ b/lms/templates/signup_modal.html
@@ -6,7 +6,7 @@ from openedx.core.djangolib.js_utils import js_escaped_string
from django.conf import settings
from django.urls import reverse
from django_countries import countries
-from student.models import UserProfile
+from common.djangoapps.student.models import UserProfile
from datetime import date
import calendar
%>
diff --git a/lms/templates/sysadmin_dashboard_gitlogs.html b/lms/templates/sysadmin_dashboard_gitlogs.html
index 64d48f6b32..0a57eb59ab 100644
--- a/lms/templates/sysadmin_dashboard_gitlogs.html
+++ b/lms/templates/sysadmin_dashboard_gitlogs.html
@@ -5,7 +5,7 @@
from django.urls import reverse
from django.utils.translation import ugettext as _
from django.utils.timezone import utc as UTC
- from util.date_utils import get_time_display, DEFAULT_DATE_TIME_FORMAT
+ from common.djangoapps.util.date_utils import get_time_display, DEFAULT_DATE_TIME_FORMAT
from django.conf import settings
%>
<%namespace name='static' file='/static_content.html'/>
diff --git a/lms/tests.py b/lms/tests.py
index 3ab766ebe5..b90707bafd 100644
--- a/lms/tests.py
+++ b/lms/tests.py
@@ -7,8 +7,6 @@ import mimetypes
from django.conf import settings
from django.test import TestCase
-from edxmako import LOOKUP, add_lookup
-
log = logging.getLogger(__name__)
diff --git a/lms/urls.py b/lms/urls.py
index e79933cd07..085e604ad7 100644
--- a/lms/urls.py
+++ b/lms/urls.py
@@ -51,8 +51,8 @@ from openedx.core.djangoapps.site_configuration import helpers as configuration_
from openedx.core.djangoapps.user_authn.views.login import redirect_to_lms_login
from openedx.core.djangoapps.verified_track_content import views as verified_track_content_views
from openedx.features.enterprise_support.api import enterprise_enabled
-from student import views as student_views
-from util import views as util_views
+from common.djangoapps.student import views as student_views
+from common.djangoapps.util import views as util_views
RESET_COURSE_DEADLINES_NAME = 'reset_course_deadlines'
RENDER_XBLOCK_NAME = 'render_xblock'
@@ -95,13 +95,13 @@ notification_prefs_urls = [
urlpatterns = [
url(r'^$', branding_views.index, name='root'), # Main marketing page, or redirect to courseware
- url(r'', include('student.urls')),
+ url(r'', include('common.djangoapps.student.urls')),
# TODO: Move lms specific student views out of common code
url(r'^dashboard/?$', student_views.student_dashboard, name='dashboard'),
url(r'^change_enrollment$', student_views.change_enrollment, name='change_enrollment'),
# Event tracking endpoints
- url(r'', include('track.urls')),
+ url(r'', include('common.djangoapps.track.urls')),
# Static template view endpoints like blog, faq, etc.
url(r'', include('lms.djangoapps.static_template_view.urls')),
@@ -114,8 +114,13 @@ urlpatterns = [
url(r'^api/enrollment/v1/', include('openedx.core.djangoapps.enrollments.urls')),
# Entitlement API RESTful endpoints
- url(r'^api/entitlements/', include(('entitlements.rest_api.urls', 'common.djangoapps.entitlements'),
- namespace='entitlements_api')),
+ url(
+ r'^api/entitlements/',
+ include(
+ ('common.djangoapps.entitlements.rest_api.urls', 'common.djangoapps.entitlements'),
+ namespace='entitlements_api',
+ ),
+ ),
# Demographics API RESTful endpoints
url(r'^api/demographics/', include('openedx.core.djangoapps.demographics.rest_api.urls')),
@@ -158,9 +163,17 @@ urlpatterns = [
url(r'^lang_pref/session_language', lang_pref_views.update_session_language, name='session_language'),
# Multiple course modes and identity verification
- url(r'^course_modes/', include('course_modes.urls')),
- url(r'^api/course_modes/', include(('course_modes.rest_api.urls', 'common.djangoapps.course_mods'),
- namespace='course_modes_api')),
+ url(
+ r'^course_modes/',
+ include('common.djangoapps.course_modes.urls'),
+ ),
+ url(
+ r'^api/course_modes/',
+ include(
+ ('common.djangoapps.course_modes.rest_api.urls', 'common.djangoapps.course_mods'),
+ namespace='course_modes_api',
+ )
+ ),
url(r'^verify_student/', include('lms.djangoapps.verify_student.urls')),
@@ -836,8 +849,8 @@ urlpatterns += [
# Third-party auth.
if settings.FEATURES.get('ENABLE_THIRD_PARTY_AUTH'):
urlpatterns += [
- url(r'', include('third_party_auth.urls')),
- url(r'^api/third_party_auth/', include('third_party_auth.api.urls')),
+ url(r'', include('common.djangoapps.third_party_auth.urls')),
+ url(r'^api/third_party_auth/', include('common.djangoapps.third_party_auth.api.urls')),
]
# Enterprise
diff --git a/openedx/core/djangoapps/ace_common/template_context.py b/openedx/core/djangoapps/ace_common/template_context.py
index 2bff54cf3a..b569798a95 100644
--- a/openedx/core/djangoapps/ace_common/template_context.py
+++ b/openedx/core/djangoapps/ace_common/template_context.py
@@ -6,7 +6,7 @@ Context dictionary for templates that use the ace_common base template.
from django.conf import settings
from django.urls import NoReverseMatch, reverse
-from edxmako.shortcuts import marketing_link
+from common.djangoapps.edxmako.shortcuts import marketing_link
from openedx.core.djangoapps.theming.helpers import get_config_value_from_site_or_settings
diff --git a/openedx/core/djangoapps/ace_common/tests/mixins.py b/openedx/core/djangoapps/ace_common/tests/mixins.py
index bc6dfe3241..e2d392a488 100644
--- a/openedx/core/djangoapps/ace_common/tests/mixins.py
+++ b/openedx/core/djangoapps/ace_common/tests/mixins.py
@@ -9,7 +9,7 @@ from mock import patch
from six.moves.urllib.parse import parse_qs, urlparse # pylint: disable=import-error
from openedx.core.djangoapps.site_configuration.tests.factories import SiteFactory
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
class QueryStringAssertionMixin(object):
diff --git a/openedx/core/djangoapps/api_admin/api/v1/tests/test_views.py b/openedx/core/djangoapps/api_admin/api/v1/tests/test_views.py
index f326021c90..aab2126e12 100644
--- a/openedx/core/djangoapps/api_admin/api/v1/tests/test_views.py
+++ b/openedx/core/djangoapps/api_admin/api/v1/tests/test_views.py
@@ -11,7 +11,7 @@ from django.test import TestCase
from openedx.core.djangoapps.api_admin.tests import factories
from openedx.core.djangolib.testing.utils import skip_unless_lms
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
@skip_unless_lms
diff --git a/openedx/core/djangoapps/api_admin/management/commands/tests/test_create_api_access_request.py b/openedx/core/djangoapps/api_admin/management/commands/tests/test_create_api_access_request.py
index 8d9c6e6144..3111f98356 100644
--- a/openedx/core/djangoapps/api_admin/management/commands/tests/test_create_api_access_request.py
+++ b/openedx/core/djangoapps/api_admin/management/commands/tests/test_create_api_access_request.py
@@ -10,7 +10,7 @@ from mock import patch
from openedx.core.djangoapps.api_admin.management.commands import create_api_access_request
from openedx.core.djangoapps.api_admin.models import ApiAccessConfig, ApiAccessRequest
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
@unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Tests only valid in lms')
diff --git a/openedx/core/djangoapps/api_admin/models.py b/openedx/core/djangoapps/api_admin/models.py
index 60e7808dfb..e304569c84 100644
--- a/openedx/core/djangoapps/api_admin/models.py
+++ b/openedx/core/djangoapps/api_admin/models.py
@@ -20,7 +20,7 @@ from django.utils.encoding import python_2_unicode_compatible
from model_utils.models import TimeStampedModel
from six.moves.urllib.parse import urlunsplit # pylint: disable=import-error
-from edxmako.shortcuts import render_to_string
+from common.djangoapps.edxmako.shortcuts import render_to_string
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
log = logging.getLogger(__name__)
diff --git a/openedx/core/djangoapps/api_admin/tests/factories.py b/openedx/core/djangoapps/api_admin/tests/factories.py
index 337bbfbb32..591d871251 100644
--- a/openedx/core/djangoapps/api_admin/tests/factories.py
+++ b/openedx/core/djangoapps/api_admin/tests/factories.py
@@ -8,7 +8,7 @@ from oauth2_provider.models import get_application_model
from openedx.core.djangoapps.site_configuration.tests.factories import SiteFactory
from openedx.core.djangoapps.api_admin.models import ApiAccessRequest, Catalog
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
Application = get_application_model() # pylint: disable=invalid-name
diff --git a/openedx/core/djangoapps/api_admin/tests/test_models.py b/openedx/core/djangoapps/api_admin/tests/test_models.py
index 6e3edc4bf5..e0c9b631f0 100644
--- a/openedx/core/djangoapps/api_admin/tests/test_models.py
+++ b/openedx/core/djangoapps/api_admin/tests/test_models.py
@@ -14,7 +14,7 @@ from openedx.core.djangoapps.api_admin.models import log as model_log
from openedx.core.djangoapps.api_admin.tests.factories import ApiAccessRequestFactory
from openedx.core.djangoapps.site_configuration.tests.factories import SiteFactory
from openedx.core.djangolib.testing.utils import skip_unless_lms
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
@ddt.ddt
diff --git a/openedx/core/djangoapps/api_admin/tests/test_views.py b/openedx/core/djangoapps/api_admin/tests/test_views.py
index f612f31716..2f824d2a74 100644
--- a/openedx/core/djangoapps/api_admin/tests/test_views.py
+++ b/openedx/core/djangoapps/api_admin/tests/test_views.py
@@ -19,7 +19,7 @@ from openedx.core.djangoapps.api_admin.tests.factories import (
)
from openedx.core.djangoapps.api_admin.tests.utils import VALID_DATA
from openedx.core.djangolib.testing.utils import skip_unless_lms
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
Application = get_application_model() # pylint: disable=invalid-name
diff --git a/openedx/core/djangoapps/api_admin/views.py b/openedx/core/djangoapps/api_admin/views.py
index c5ce3cbe07..3e2dbbfdf3 100644
--- a/openedx/core/djangoapps/api_admin/views.py
+++ b/openedx/core/djangoapps/api_admin/views.py
@@ -16,7 +16,7 @@ from oauth2_provider.models import get_application_model
from oauth2_provider.views import ApplicationRegistration
from slumber.exceptions import HttpNotFoundError
-from edxmako.shortcuts import render_to_response
+from common.djangoapps.edxmako.shortcuts import render_to_response
from openedx.core.djangoapps.api_admin.decorators import require_api_access
from openedx.core.djangoapps.api_admin.forms import ApiAccessRequestForm, CatalogForm
from openedx.core.djangoapps.api_admin.models import ApiAccessRequest, Catalog
diff --git a/openedx/core/djangoapps/auth_exchange/forms.py b/openedx/core/djangoapps/auth_exchange/forms.py
index fdc9166bd6..b25860e6d6 100644
--- a/openedx/core/djangoapps/auth_exchange/forms.py
+++ b/openedx/core/djangoapps/auth_exchange/forms.py
@@ -13,7 +13,7 @@ from requests import HTTPError
from social_core.backends import oauth as social_oauth
from social_core.exceptions import AuthException
-from third_party_auth import pipeline
+from common.djangoapps.third_party_auth import pipeline
class OAuthValidationError(Exception):
diff --git a/openedx/core/djangoapps/auth_exchange/tests/test_forms.py b/openedx/core/djangoapps/auth_exchange/tests/test_forms.py
index db135b68bb..b0dd06563d 100644
--- a/openedx/core/djangoapps/auth_exchange/tests/test_forms.py
+++ b/openedx/core/djangoapps/auth_exchange/tests/test_forms.py
@@ -13,7 +13,7 @@ from django.test import TestCase
from django.test.client import RequestFactory
from social_django.models import Partial
-from third_party_auth.tests.utils import ThirdPartyOAuthTestMixinFacebook, ThirdPartyOAuthTestMixinGoogle
+from common.djangoapps.third_party_auth.tests.utils import ThirdPartyOAuthTestMixinFacebook, ThirdPartyOAuthTestMixinGoogle
from ..forms import AccessTokenExchangeForm
from .mixins import DOTAdapterMixin
diff --git a/openedx/core/djangoapps/auth_exchange/tests/test_views.py b/openedx/core/djangoapps/auth_exchange/tests/test_views.py
index 6a3f44ad52..393762797d 100644
--- a/openedx/core/djangoapps/auth_exchange/tests/test_views.py
+++ b/openedx/core/djangoapps/auth_exchange/tests/test_views.py
@@ -21,8 +21,8 @@ from rest_framework.test import APIClient
from social_django.models import Partial
from openedx.core.djangoapps.oauth_dispatch.tests import factories as dot_factories
-from student.tests.factories import UserFactory
-from third_party_auth.tests.utils import ThirdPartyOAuthTestMixinFacebook, ThirdPartyOAuthTestMixinGoogle
+from common.djangoapps.student.tests.factories import UserFactory
+from common.djangoapps.third_party_auth.tests.utils import ThirdPartyOAuthTestMixinFacebook, ThirdPartyOAuthTestMixinGoogle
from .mixins import DOTAdapterMixin
from .utils import TPA_FEATURE_ENABLED, TPA_FEATURES_KEY, AccessTokenExchangeTestMixin
diff --git a/openedx/core/djangoapps/auth_exchange/tests/utils.py b/openedx/core/djangoapps/auth_exchange/tests/utils.py
index e906a91722..0cfc360654 100644
--- a/openedx/core/djangoapps/auth_exchange/tests/utils.py
+++ b/openedx/core/djangoapps/auth_exchange/tests/utils.py
@@ -6,7 +6,7 @@ Test utilities for OAuth access token exchange
from django.conf import settings
from social_django.models import Partial, UserSocialAuth
-from third_party_auth.tests.utils import ThirdPartyOAuthTestMixin
+from common.djangoapps.third_party_auth.tests.utils import ThirdPartyOAuthTestMixin
TPA_FEATURES_KEY = 'ENABLE_THIRD_PARTY_AUTH'
TPA_FEATURE_ENABLED = TPA_FEATURES_KEY in settings.FEATURES
diff --git a/openedx/core/djangoapps/bookmarks/tests/factories.py b/openedx/core/djangoapps/bookmarks/tests/factories.py
index 7fe7f300e7..5fd497da03 100644
--- a/openedx/core/djangoapps/bookmarks/tests/factories.py
+++ b/openedx/core/djangoapps/bookmarks/tests/factories.py
@@ -9,7 +9,7 @@ import factory
from factory.django import DjangoModelFactory
from opaque_keys.edx.locator import CourseLocator
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from ..models import Bookmark, XBlockCache
diff --git a/openedx/core/djangoapps/bookmarks/tests/test_models.py b/openedx/core/djangoapps/bookmarks/tests/test_models.py
index fd00c1bf91..e60e11014b 100644
--- a/openedx/core/djangoapps/bookmarks/tests/test_models.py
+++ b/openedx/core/djangoapps/bookmarks/tests/test_models.py
@@ -16,7 +16,7 @@ from six import text_type
from six.moves import range
from openedx.core.djangolib.testing.utils import skip_unless_lms
-from student.tests.factories import AdminFactory, UserFactory
+from common.djangoapps.student.tests.factories import AdminFactory, UserFactory
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
diff --git a/openedx/core/djangoapps/cache_toolbox/tests/test_middleware.py b/openedx/core/djangoapps/cache_toolbox/tests/test_middleware.py
index 6eb5015e3e..ee4de81e82 100644
--- a/openedx/core/djangoapps/cache_toolbox/tests/test_middleware.py
+++ b/openedx/core/djangoapps/cache_toolbox/tests/test_middleware.py
@@ -8,7 +8,7 @@ from django.test import TestCase
from mock import patch
from openedx.core.djangolib.testing.utils import skip_unless_cms, skip_unless_lms
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
class CachedAuthMiddlewareTestCase(TestCase):
diff --git a/openedx/core/djangoapps/catalog/management/commands/tests/test_cache_programs.py b/openedx/core/djangoapps/catalog/management/commands/tests/test_cache_programs.py
index e7ceef8e53..93e1d3339b 100644
--- a/openedx/core/djangoapps/catalog/management/commands/tests/test_cache_programs.py
+++ b/openedx/core/djangoapps/catalog/management/commands/tests/test_cache_programs.py
@@ -23,7 +23,7 @@ from openedx.core.djangoapps.catalog.tests.factories import OrganizationFactory,
from openedx.core.djangoapps.catalog.tests.mixins import CatalogIntegrationMixin
from openedx.core.djangoapps.site_configuration.tests.mixins import SiteMixin
from openedx.core.djangolib.testing.utils import CacheIsolationTestCase, skip_unless_lms
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
@skip_unless_lms
diff --git a/openedx/core/djangoapps/catalog/tests/test_utils.py b/openedx/core/djangoapps/catalog/tests/test_utils.py
index f0216de2da..c2f2c10d88 100644
--- a/openedx/core/djangoapps/catalog/tests/test_utils.py
+++ b/openedx/core/djangoapps/catalog/tests/test_utils.py
@@ -14,9 +14,9 @@ from django.test.client import RequestFactory
from django.utils.timezone import now
from opaque_keys.edx.keys import CourseKey
-from course_modes.helpers import CourseMode
-from course_modes.tests.factories import CourseModeFactory
-from entitlements.tests.factories import CourseEntitlementFactory
+from common.djangoapps.course_modes.helpers import CourseMode
+from common.djangoapps.course_modes.tests.factories import CourseModeFactory
+from common.djangoapps.entitlements.tests.factories import CourseEntitlementFactory
from openedx.core.constants import COURSE_UNPUBLISHED
from openedx.core.djangoapps.catalog.cache import (
CATALOG_COURSE_PROGRAMS_CACHE_KEY_TPL,
@@ -59,7 +59,7 @@ from openedx.core.djangoapps.catalog.utils import (
from openedx.core.djangoapps.content.course_overviews.tests.factories import CourseOverviewFactory
from openedx.core.djangoapps.site_configuration.tests.factories import SiteFactory
from openedx.core.djangolib.testing.utils import CacheIsolationTestCase, skip_unless_lms
-from student.tests.factories import CourseEnrollmentFactory, UserFactory
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory, UserFactory
from openedx.core.djangoapps.site_configuration.tests.test_util import with_site_configuration_context
UTILS_MODULE = 'openedx.core.djangoapps.catalog.utils'
diff --git a/openedx/core/djangoapps/catalog/utils.py b/openedx/core/djangoapps/catalog/utils.py
index 2d4b8f8f39..cfeeb008db 100644
--- a/openedx/core/djangoapps/catalog/utils.py
+++ b/openedx/core/djangoapps/catalog/utils.py
@@ -14,7 +14,7 @@ from opaque_keys.edx.keys import CourseKey
from pytz import UTC
from six import text_type
-from entitlements.utils import is_course_run_entitlement_fulfillable
+from common.djangoapps.entitlements.utils import is_course_run_entitlement_fulfillable
from openedx.core.constants import COURSE_PUBLISHED
from openedx.core.djangoapps.catalog.cache import (
COURSE_PROGRAMS_CACHE_KEY_TPL,
@@ -30,7 +30,7 @@ from openedx.core.djangoapps.catalog.cache import (
from openedx.core.djangoapps.catalog.models import CatalogIntegration
from openedx.core.djangoapps.oauth_dispatch.jwt import create_jwt_for_user
from openedx.core.lib.edx_api_utils import get_edx_api_data
-from student.models import CourseEnrollment
+from common.djangoapps.student.models import CourseEnrollment
logger = logging.getLogger(__name__)
diff --git a/openedx/core/djangoapps/ccxcon/api.py b/openedx/core/djangoapps/ccxcon/api.py
index a215de6e1c..514cf122ac 100644
--- a/openedx/core/djangoapps/ccxcon/api.py
+++ b/openedx/core/djangoapps/ccxcon/api.py
@@ -16,8 +16,8 @@ from rest_framework.status import HTTP_200_OK, HTTP_201_CREATED
from lms.djangoapps.courseware.courses import get_course_by_id
from openedx.core.djangoapps.models.course_details import CourseDetails
-from student.models import anonymous_id_for_user
-from student.roles import CourseInstructorRole
+from common.djangoapps.student.models import anonymous_id_for_user
+from common.djangoapps.student.roles import CourseInstructorRole
from .models import CCXCon
diff --git a/openedx/core/djangoapps/ccxcon/tests/test_api.py b/openedx/core/djangoapps/ccxcon/tests/test_api.py
index 50437b368e..08f2b0062e 100644
--- a/openedx/core/djangoapps/ccxcon/tests/test_api.py
+++ b/openedx/core/djangoapps/ccxcon/tests/test_api.py
@@ -12,7 +12,7 @@ from opaque_keys.edx.keys import CourseKey
from six.moves import range
from openedx.core.djangoapps.ccxcon import api as ccxconapi
-from student.tests.factories import AdminFactory
+from common.djangoapps.student.tests.factories import AdminFactory
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.django_utils import TEST_DATA_SPLIT_MODULESTORE, SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
diff --git a/openedx/core/djangoapps/certificates/api.py b/openedx/core/djangoapps/certificates/api.py
index 0ae6dec631..cbaefaf875 100644
--- a/openedx/core/djangoapps/certificates/api.py
+++ b/openedx/core/djangoapps/certificates/api.py
@@ -11,7 +11,7 @@ from pytz import UTC
from lms.djangoapps.certificates.models import CertificateStatuses, CertificateWhitelist
from openedx.core.djangoapps.certificates.config import waffle
-from student.models import CourseEnrollment
+from common.djangoapps.student.models import CourseEnrollment
log = logging.getLogger(__name__)
diff --git a/openedx/core/djangoapps/certificates/tests/test_api.py b/openedx/core/djangoapps/certificates/tests/test_api.py
index ba47c71d3e..4e705a3928 100644
--- a/openedx/core/djangoapps/certificates/tests/test_api.py
+++ b/openedx/core/djangoapps/certificates/tests/test_api.py
@@ -7,15 +7,15 @@ from datetime import datetime, timedelta
import ddt
import pytz
import waffle
-from course_modes.models import CourseMode
from django.test import TestCase
from edx_toggles.toggles import WaffleSwitch
from edx_toggles.toggles.testutils import override_waffle_switch
-from student.tests.factories import CourseEnrollmentFactory, UserFactory
+from common.djangoapps.course_modes.models import CourseMode
from openedx.core.djangoapps.certificates import api
from openedx.core.djangoapps.certificates.config import waffle as certs_waffle
from openedx.core.djangoapps.content.course_overviews.tests.factories import CourseOverviewFactory
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory, UserFactory
# TODO: Copied from lms.djangoapps.certificates.models,
diff --git a/openedx/core/djangoapps/config_model_utils/utils.py b/openedx/core/djangoapps/config_model_utils/utils.py
index cc41ed263c..c0369b0fad 100644
--- a/openedx/core/djangoapps/config_model_utils/utils.py
+++ b/openedx/core/djangoapps/config_model_utils/utils.py
@@ -1,7 +1,7 @@
"""utils for feature-based enrollments"""
-from student.models import FBEEnrollmentExclusion
+from common.djangoapps.student.models import FBEEnrollmentExclusion
def is_in_holdback(enrollment):
diff --git a/openedx/core/djangoapps/content/course_overviews/models.py b/openedx/core/djangoapps/content/course_overviews/models.py
index 3073e3845f..5c0f4323b4 100644
--- a/openedx/core/djangoapps/content/course_overviews/models.py
+++ b/openedx/core/djangoapps/content/course_overviews/models.py
@@ -29,7 +29,7 @@ from openedx.core.djangoapps.catalog.models import CatalogIntegration
from openedx.core.djangoapps.lang_pref.api import get_closest_released_language
from openedx.core.djangoapps.models.course_details import CourseDetails
from openedx.core.lib.cache_utils import request_cached, RequestCache
-from static_replace.models import AssetBaseUrlConfig
+from common.djangoapps.static_replace.models import AssetBaseUrlConfig
from xmodule import block_metadata_utils, course_metadata_utils
from xmodule.course_module import DEFAULT_START_DATE, CourseDescriptor
from xmodule.error_module import ErrorDescriptor
diff --git a/openedx/core/djangoapps/content/course_overviews/tests/test_course_overviews.py b/openedx/core/djangoapps/content/course_overviews/tests/test_course_overviews.py
index 05bb64cb22..5b140cc65b 100644
--- a/openedx/core/djangoapps/content/course_overviews/tests/test_course_overviews.py
+++ b/openedx/core/djangoapps/content/course_overviews/tests/test_course_overviews.py
@@ -26,7 +26,7 @@ from openedx.core.djangoapps.dark_lang.models import DarkLangConfig
from openedx.core.djangoapps.models.course_details import CourseDetails
from openedx.core.djangolib.testing.utils import CacheIsolationTestCase
from openedx.core.lib.courses import course_image_url
-from static_replace.models import AssetBaseUrlConfig
+from common.djangoapps.static_replace.models import AssetBaseUrlConfig
from xmodule.assetstore.assetmgr import AssetManager
from xmodule.contentstore.content import StaticContent
from xmodule.contentstore.django import contentstore
diff --git a/openedx/core/djangoapps/content/learning_sequences/api/processors/enrollment.py b/openedx/core/djangoapps/content/learning_sequences/api/processors/enrollment.py
index e89ad72dd6..8a5793832a 100644
--- a/openedx/core/djangoapps/content/learning_sequences/api/processors/enrollment.py
+++ b/openedx/core/djangoapps/content/learning_sequences/api/processors/enrollment.py
@@ -2,7 +2,7 @@
Simple OutlineProcessor that removes items based on Enrollment and course visibility setting.
"""
from openedx.features.course_experience import COURSE_ENABLE_UNENROLLED_ACCESS_FLAG
-from student.models import CourseEnrollment
+from common.djangoapps.student.models import CourseEnrollment
from .base import OutlineProcessor
from ...data import CourseVisibility
diff --git a/openedx/core/djangoapps/content/learning_sequences/api/processors/schedule.py b/openedx/core/djangoapps/content/learning_sequences/api/processors/schedule.py
index 306b2423d6..5d2a437383 100644
--- a/openedx/core/djangoapps/content/learning_sequences/api/processors/schedule.py
+++ b/openedx/core/djangoapps/content/learning_sequences/api/processors/schedule.py
@@ -5,8 +5,8 @@ from datetime import datetime, timedelta
from django.contrib.auth import get_user_model
from edx_when.api import get_dates_for_course
from opaque_keys.edx.keys import CourseKey, UsageKey
-from student.auth import user_has_role
-from student.roles import CourseBetaTesterRole
+from common.djangoapps.student.auth import user_has_role
+from common.djangoapps.student.roles import CourseBetaTesterRole
from ...data import ScheduleData, ScheduleItemData, UserCourseOutlineData
from .base import OutlineProcessor
diff --git a/openedx/core/djangoapps/content/learning_sequences/api/tests/test_outlines.py b/openedx/core/djangoapps/content/learning_sequences/api/tests/test_outlines.py
index 90e961ce64..c21799477c 100644
--- a/openedx/core/djangoapps/content/learning_sequences/api/tests/test_outlines.py
+++ b/openedx/core/djangoapps/content/learning_sequences/api/tests/test_outlines.py
@@ -14,9 +14,9 @@ from edx_toggles.toggles.testutils import override_waffle_flag
from lms.djangoapps.courseware.tests.factories import BetaTesterFactory
from openedx.core.djangolib.testing.utils import CacheIsolationTestCase
from openedx.features.course_experience import COURSE_ENABLE_UNENROLLED_ACCESS_FLAG
-from student.auth import user_has_role
-from student.models import CourseEnrollment
-from student.roles import CourseBetaTesterRole
+from common.djangoapps.student.auth import user_has_role
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.student.roles import CourseBetaTesterRole
from ...data import CourseLearningSequenceData, CourseOutlineData, CourseSectionData, CourseVisibility, VisibilityData
from ..outlines import (
diff --git a/openedx/core/djangoapps/content/learning_sequences/tests/test_views.py b/openedx/core/djangoapps/content/learning_sequences/tests/test_views.py
index 7bfb5dc1f2..cbcfe97199 100644
--- a/openedx/core/djangoapps/content/learning_sequences/tests/test_views.py
+++ b/openedx/core/djangoapps/content/learning_sequences/tests/test_views.py
@@ -20,7 +20,7 @@ from opaque_keys.edx.keys import CourseKey, UsageKey
from rest_framework.test import APITestCase, APIClient
from openedx.core.djangolib.testing.utils import CacheIsolationTestCase
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from ..api import replace_course_outline
from ..data import CourseOutlineData, CourseVisibility
diff --git a/openedx/core/djangoapps/content_libraries/tests/base.py b/openedx/core/djangoapps/content_libraries/tests/base.py
index 4200d15116..18875e9416 100644
--- a/openedx/core/djangoapps/content_libraries/tests/base.py
+++ b/openedx/core/djangoapps/content_libraries/tests/base.py
@@ -14,7 +14,7 @@ from organizations.models import Organization
from rest_framework.test import APITestCase, APIClient
from search.search_engine_base import SearchEngine
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from openedx.core.djangoapps.content_libraries.libraries_index import MAX_SIZE
from openedx.core.djangoapps.content_libraries.constants import COMPLEX, ALL_RIGHTS_RESERVED
from openedx.core.djangolib.testing.utils import skip_unless_cms
diff --git a/openedx/core/djangoapps/content_libraries/tests/test_content_libraries.py b/openedx/core/djangoapps/content_libraries/tests/test_content_libraries.py
index 5dd6165a0f..f01d531b09 100644
--- a/openedx/core/djangoapps/content_libraries/tests/test_content_libraries.py
+++ b/openedx/core/djangoapps/content_libraries/tests/test_content_libraries.py
@@ -13,7 +13,7 @@ from organizations.models import Organization
from openedx.core.djangoapps.content_libraries.tests.base import ContentLibrariesRestApiTest, elasticsearch_test
from openedx.core.djangoapps.content_libraries.constants import VIDEO, COMPLEX, PROBLEM, CC_4_BY, ALL_RIGHTS_RESERVED
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
@ddt.ddt
diff --git a/openedx/core/djangoapps/content_libraries/tests/test_runtime.py b/openedx/core/djangoapps/content_libraries/tests/test_runtime.py
index 69e18fd26e..498db69019 100644
--- a/openedx/core/djangoapps/content_libraries/tests/test_runtime.py
+++ b/openedx/core/djangoapps/content_libraries/tests/test_runtime.py
@@ -24,7 +24,7 @@ from openedx.core.djangoapps.dark_lang.models import DarkLangConfig
from openedx.core.djangoapps.xblock import api as xblock_api
from openedx.core.djangolib.testing.utils import skip_unless_lms, skip_unless_cms
from openedx.core.lib import blockstore_api
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.unit_block import UnitBlock
diff --git a/openedx/core/djangoapps/contentserver/middleware.py b/openedx/core/djangoapps/contentserver/middleware.py
index ff810fff5b..21ab1d68d0 100644
--- a/openedx/core/djangoapps/contentserver/middleware.py
+++ b/openedx/core/djangoapps/contentserver/middleware.py
@@ -21,7 +21,7 @@ from opaque_keys.edx.locator import AssetLocator
from six import text_type
from openedx.core.djangoapps.header_control import force_header_for_response
-from student.models import CourseEnrollment
+from common.djangoapps.student.models import CourseEnrollment
from xmodule.assetstore.assetmgr import AssetManager
from xmodule.contentstore.content import XASSET_LOCATION_TAG, StaticContent
from xmodule.exceptions import NotFoundError
diff --git a/openedx/core/djangoapps/contentserver/test/test_contentserver.py b/openedx/core/djangoapps/contentserver/test/test_contentserver.py
index 5d8a7a1eda..80987ec227 100644
--- a/openedx/core/djangoapps/contentserver/test/test_contentserver.py
+++ b/openedx/core/djangoapps/contentserver/test/test_contentserver.py
@@ -27,8 +27,8 @@ from xmodule.assetstore.assetmgr import AssetManager
from opaque_keys import InvalidKeyError
from xmodule.modulestore.exceptions import ItemNotFoundError
-from student.models import CourseEnrollment
-from student.tests.factories import UserFactory, AdminFactory
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.student.tests.factories import UserFactory, AdminFactory
from ..middleware import parse_range_header, HTTP_DATE_FORMAT, StaticContentServer
diff --git a/openedx/core/djangoapps/cors_csrf/views.py b/openedx/core/djangoapps/cors_csrf/views.py
index b6a26900d6..d0e5f05019 100644
--- a/openedx/core/djangoapps/cors_csrf/views.py
+++ b/openedx/core/djangoapps/cors_csrf/views.py
@@ -8,7 +8,7 @@ from django.conf import settings
from django.http import HttpResponseNotFound
from django.views.decorators.cache import cache_page
-from edxmako.shortcuts import render_to_response
+from common.djangoapps.edxmako.shortcuts import render_to_response
from .models import XDomainProxyConfiguration
diff --git a/openedx/core/djangoapps/course_groups/cohorts.py b/openedx/core/djangoapps/course_groups/cohorts.py
index 20aa79f01d..458a19fe23 100644
--- a/openedx/core/djangoapps/course_groups/cohorts.py
+++ b/openedx/core/djangoapps/course_groups/cohorts.py
@@ -21,7 +21,7 @@ from eventtracking import tracker
from lms.djangoapps.courseware import courses
from openedx.core.lib.cache_utils import request_cached
-from student.models import get_user_by_username_or_email
+from common.djangoapps.student.models import get_user_by_username_or_email
from .models import (
CohortMembership,
diff --git a/openedx/core/djangoapps/course_groups/tests/test_api_views.py b/openedx/core/djangoapps/course_groups/tests/test_api_views.py
index 16599da378..fe17c954bb 100644
--- a/openedx/core/djangoapps/course_groups/tests/test_api_views.py
+++ b/openedx/core/djangoapps/course_groups/tests/test_api_views.py
@@ -13,7 +13,7 @@ from django.urls import reverse
from openedx.core.djangoapps.oauth_dispatch.tests.factories import ApplicationFactory, AccessTokenFactory
from openedx.core.djangolib.testing.utils import skip_unless_lms
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import ToyCourseFactory
diff --git a/openedx/core/djangoapps/course_groups/tests/test_cohorts.py b/openedx/core/djangoapps/course_groups/tests/test_cohorts.py
index 09f41b2e8b..efefac6f0f 100644
--- a/openedx/core/djangoapps/course_groups/tests/test_cohorts.py
+++ b/openedx/core/djangoapps/course_groups/tests/test_cohorts.py
@@ -15,8 +15,8 @@ from opaque_keys.edx.locator import CourseLocator
from six import text_type
from six.moves import range
-from student.models import CourseEnrollment
-from student.tests.factories import UserFactory
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.django_utils import TEST_DATA_MIXED_MODULESTORE, ModuleStoreTestCase
from xmodule.modulestore.tests.factories import ToyCourseFactory
diff --git a/openedx/core/djangoapps/course_groups/tests/test_partition_scheme.py b/openedx/core/djangoapps/course_groups/tests/test_partition_scheme.py
index 39c616a964..d0d2d1b153 100644
--- a/openedx/core/djangoapps/course_groups/tests/test_partition_scheme.py
+++ b/openedx/core/djangoapps/course_groups/tests/test_partition_scheme.py
@@ -11,7 +11,7 @@ from six.moves import range
from lms.djangoapps.courseware.tests.test_masquerade import StaffMasqueradeTestCase
from openedx.core.djangoapps.user_api.partition_schemes import RandomUserPartitionScheme
from openedx.core.djangolib.testing.utils import skip_unless_lms
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.django_utils import TEST_DATA_MIXED_MODULESTORE, ModuleStoreTestCase
from xmodule.modulestore.tests.factories import ToyCourseFactory
diff --git a/openedx/core/djangoapps/course_groups/tests/test_views.py b/openedx/core/djangoapps/course_groups/tests/test_views.py
index 040a6ff434..1596f6cb45 100644
--- a/openedx/core/djangoapps/course_groups/tests/test_views.py
+++ b/openedx/core/djangoapps/course_groups/tests/test_views.py
@@ -18,8 +18,8 @@ from opaque_keys.edx.locator import CourseLocator
from openedx.core.djangoapps.django_comment_common.models import CourseDiscussionSettings
from openedx.core.djangoapps.django_comment_common.utils import get_course_discussion_settings
from lms.djangoapps.courseware.tests.factories import InstructorFactory, StaffFactory
-from student.models import CourseEnrollment
-from student.tests.factories import UserFactory
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/openedx/core/djangoapps/course_groups/views.py b/openedx/core/djangoapps/course_groups/views.py
index 554f0a36d3..cb9545b23b 100644
--- a/openedx/core/djangoapps/course_groups/views.py
+++ b/openedx/core/djangoapps/course_groups/views.py
@@ -26,12 +26,12 @@ from rest_framework.response import Response
from rest_framework.serializers import Serializer
from lms.djangoapps.courseware.courses import get_course, get_course_with_access
-from edxmako.shortcuts import render_to_response
+from common.djangoapps.edxmako.shortcuts import render_to_response
from openedx.core.djangoapps.course_groups.models import CohortMembership
from openedx.core.lib.api.authentication import BearerAuthenticationAllowInactiveUser
from openedx.core.lib.api.view_utils import DeveloperErrorViewMixin
-from student.auth import has_course_author_access
-from util.json_request import JsonResponse, expect_json
+from common.djangoapps.student.auth import has_course_author_access
+from common.djangoapps.util.json_request import JsonResponse, expect_json
from . import api, cohorts
from .models import CourseUserGroup, CourseUserGroupPartitionGroup
diff --git a/openedx/core/djangoapps/courseware_api/tests/test_views.py b/openedx/core/djangoapps/courseware_api/tests/test_views.py
index e84b66a768..fa1a6e437d 100644
--- a/openedx/core/djangoapps/courseware_api/tests/test_views.py
+++ b/openedx/core/djangoapps/courseware_api/tests/test_views.py
@@ -19,8 +19,8 @@ from lms.djangoapps.certificates.tests.factories import (
from lms.djangoapps.courseware.access_utils import ACCESS_DENIED, ACCESS_GRANTED
from lms.djangoapps.courseware.tabs import ExternalLinkCourseTab
from lms.djangoapps.courseware.tests.helpers import MasqueradeMixin
-from student.models import CourseEnrollment, CourseEnrollmentCelebration
-from student.tests.factories import CourseEnrollmentCelebrationFactory, UserFactory
+from common.djangoapps.student.models import CourseEnrollment, CourseEnrollmentCelebration
+from common.djangoapps.student.tests.factories import CourseEnrollmentCelebrationFactory, UserFactory
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.django_utils import TEST_DATA_SPLIT_MODULESTORE, SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import ItemFactory, ToyCourseFactory
diff --git a/openedx/core/djangoapps/courseware_api/views.py b/openedx/core/djangoapps/courseware_api/views.py
index adc479db63..a6c3e4e3f7 100644
--- a/openedx/core/djangoapps/courseware_api/views.py
+++ b/openedx/core/djangoapps/courseware_api/views.py
@@ -19,7 +19,7 @@ from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from rest_framework.views import APIView
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from lms.djangoapps.edxnotes.helpers import is_feature_enabled
from lms.djangoapps.certificates.api import get_certificate_url
from lms.djangoapps.certificates.models import GeneratedCertificate
@@ -45,7 +45,9 @@ from openedx.features.course_duration_limits.access import (
get_user_course_expiration_date, generate_course_expired_message
)
from openedx.features.discounts.utils import generate_offer_html
-from student.models import CourseEnrollment, CourseEnrollmentCelebration, LinkedInAddToProfileConfiguration
+from common.djangoapps.student.models import (
+ CourseEnrollment, CourseEnrollmentCelebration, LinkedInAddToProfileConfiguration
+)
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.search import path_to_location
diff --git a/openedx/core/djangoapps/credentials/management/commands/tests/test_notify_credentials.py b/openedx/core/djangoapps/credentials/management/commands/tests/test_notify_credentials.py
index 4cf4549d90..57ebd3244e 100644
--- a/openedx/core/djangoapps/credentials/management/commands/tests/test_notify_credentials.py
+++ b/openedx/core/djangoapps/credentials/management/commands/tests/test_notify_credentials.py
@@ -18,7 +18,7 @@ from lms.djangoapps.grades.models import PersistentCourseGrade
from openedx.core.djangoapps.credentials.models import NotifyCredentialsConfig
from openedx.core.djangoapps.site_configuration.tests.factories import SiteConfigurationFactory
from openedx.core.djangolib.testing.utils import skip_unless_lms
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from ..notify_credentials import Command
diff --git a/openedx/core/djangoapps/credentials/signals.py b/openedx/core/djangoapps/credentials/signals.py
index be2b61129c..04f1b9705e 100644
--- a/openedx/core/djangoapps/credentials/signals.py
+++ b/openedx/core/djangoapps/credentials/signals.py
@@ -7,7 +7,7 @@ from logging import getLogger
from django.contrib.sites.models import Site
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from lms.djangoapps.certificates.models import CertificateStatuses, GeneratedCertificate
from lms.djangoapps.grades.api import CourseGradeFactory
from openedx.core.djangoapps.catalog.utils import get_programs
diff --git a/openedx/core/djangoapps/credentials/tests/test_signals.py b/openedx/core/djangoapps/credentials/tests/test_signals.py
index 311be58cc0..de34014efe 100644
--- a/openedx/core/djangoapps/credentials/tests/test_signals.py
+++ b/openedx/core/djangoapps/credentials/tests/test_signals.py
@@ -14,7 +14,7 @@ from openedx.core.djangoapps.catalog.tests.factories import CourseFactory, Cours
from openedx.core.djangoapps.credentials.signals import is_course_run_in_a_program, send_grade_if_interesting
from openedx.core.djangoapps.site_configuration.tests.factories import SiteConfigurationFactory, SiteFactory
from openedx.core.djangolib.testing.utils import skip_unless_lms
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory as XModuleCourseFactory
diff --git a/openedx/core/djangoapps/credentials/tests/test_tasks.py b/openedx/core/djangoapps/credentials/tests/test_tasks.py
index ef927306ef..d4a750ab4c 100644
--- a/openedx/core/djangoapps/credentials/tests/test_tasks.py
+++ b/openedx/core/djangoapps/credentials/tests/test_tasks.py
@@ -8,7 +8,7 @@ from django.conf import settings
from django.test import TestCase, override_settings
from openedx.core.djangolib.testing.utils import skip_unless_lms
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from openedx.core.djangoapps.credentials.tasks.v1 import tasks
diff --git a/openedx/core/djangoapps/credentials/tests/test_utils.py b/openedx/core/djangoapps/credentials/tests/test_utils.py
index 3586f571fc..da9cd6ea86 100644
--- a/openedx/core/djangoapps/credentials/tests/test_utils.py
+++ b/openedx/core/djangoapps/credentials/tests/test_utils.py
@@ -11,7 +11,7 @@ from openedx.core.djangoapps.credentials.tests.mixins import CredentialsApiConfi
from openedx.core.djangoapps.credentials.utils import get_credentials
from openedx.core.djangoapps.oauth_dispatch.tests.factories import ApplicationFactory
from openedx.core.djangolib.testing.utils import CacheIsolationTestCase, skip_unless_lms
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
UTILS_MODULE = 'openedx.core.djangoapps.credentials.utils'
diff --git a/openedx/core/djangoapps/credit/api/eligibility.py b/openedx/core/djangoapps/credit/api/eligibility.py
index 4806f81f3a..c77866b148 100644
--- a/openedx/core/djangoapps/credit/api/eligibility.py
+++ b/openedx/core/djangoapps/credit/api/eligibility.py
@@ -9,7 +9,7 @@ import logging
import six
from opaque_keys.edx.keys import CourseKey
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from openedx.core.djangoapps.credit.email_utils import send_credit_notifications
from openedx.core.djangoapps.credit.exceptions import InvalidCreditCourse, InvalidCreditRequirements
from openedx.core.djangoapps.credit.models import (
@@ -19,7 +19,7 @@ from openedx.core.djangoapps.credit.models import (
CreditRequirement,
CreditRequirementStatus
)
-from student.models import CourseEnrollment
+from common.djangoapps.student.models import CourseEnrollment
# TODO: Cleanup this mess! ECOM-2908
diff --git a/openedx/core/djangoapps/credit/api/provider.py b/openedx/core/djangoapps/credit/api/provider.py
index e19fcfa3d3..2e11ebf00c 100644
--- a/openedx/core/djangoapps/credit/api/provider.py
+++ b/openedx/core/djangoapps/credit/api/provider.py
@@ -26,9 +26,9 @@ from openedx.core.djangoapps.credit.models import (
CreditRequirementStatus
)
from openedx.core.djangoapps.credit.signature import get_shared_secret_key, signature
-from student.models import CourseEnrollment, User
-from util.date_utils import to_timestamp
-from util.json_request import JsonResponse
+from common.djangoapps.student.models import CourseEnrollment, User
+from common.djangoapps.util.date_utils import to_timestamp
+from common.djangoapps.util.json_request import JsonResponse
# TODO: Cleanup this mess! ECOM-2908
diff --git a/openedx/core/djangoapps/credit/email_utils.py b/openedx/core/djangoapps/credit/email_utils.py
index 9433021ee8..967c9725f2 100644
--- a/openedx/core/djangoapps/credit/email_utils.py
+++ b/openedx/core/djangoapps/credit/email_utils.py
@@ -20,8 +20,8 @@ from django.urls import reverse
from django.utils.translation import ugettext as _
from eventtracking import tracker
-from edxmako.shortcuts import render_to_string
-from edxmako.template import Template
+from common.djangoapps.edxmako.shortcuts import render_to_string
+from common.djangoapps.edxmako.template import Template
from openedx.core.djangoapps.commerce.utils import ecommerce_api_client
from openedx.core.djangoapps.credit.models import CreditConfig, CreditProvider
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
diff --git a/openedx/core/djangoapps/credit/serializers.py b/openedx/core/djangoapps/credit/serializers.py
index 2ff76a31b0..6277ff3f6f 100644
--- a/openedx/core/djangoapps/credit/serializers.py
+++ b/openedx/core/djangoapps/credit/serializers.py
@@ -13,7 +13,7 @@ from rest_framework.exceptions import PermissionDenied
from openedx.core.djangoapps.credit.models import CreditCourse, CreditEligibility, CreditProvider, CreditRequest
from openedx.core.djangoapps.credit.signature import get_shared_secret_key, signature
from openedx.core.lib.api.serializers import CourseKeyField
-from util.date_utils import from_timestamp
+from common.djangoapps.util.date_utils import from_timestamp
log = logging.getLogger(__name__)
diff --git a/openedx/core/djangoapps/credit/services.py b/openedx/core/djangoapps/credit/services.py
index d273bdfb1d..6499dd29ec 100644
--- a/openedx/core/djangoapps/credit/services.py
+++ b/openedx/core/djangoapps/credit/services.py
@@ -10,7 +10,7 @@ from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist
from opaque_keys.edx.keys import CourseKey
-from student.models import CourseEnrollment
+from common.djangoapps.student.models import CourseEnrollment
from xmodule.modulestore.django import modulestore
log = logging.getLogger(__name__)
diff --git a/openedx/core/djangoapps/credit/tests/factories.py b/openedx/core/djangoapps/credit/tests/factories.py
index 1aebc7ff63..8332b30f2c 100644
--- a/openedx/core/djangoapps/credit/tests/factories.py
+++ b/openedx/core/djangoapps/credit/tests/factories.py
@@ -18,7 +18,7 @@ from openedx.core.djangoapps.credit.models import (
CreditRequirement,
CreditRequirementStatus
)
-from util.date_utils import to_timestamp
+from common.djangoapps.util.date_utils import to_timestamp
class CreditCourseFactory(factory.DjangoModelFactory):
diff --git a/openedx/core/djangoapps/credit/tests/test_api.py b/openedx/core/djangoapps/credit/tests/test_api.py
index 69bc5f71a1..2eafd477e3 100644
--- a/openedx/core/djangoapps/credit/tests/test_api.py
+++ b/openedx/core/djangoapps/credit/tests/test_api.py
@@ -17,7 +17,7 @@ from django.db import connection
from django.test.utils import override_settings
from opaque_keys.edx.keys import CourseKey
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from lms.djangoapps.commerce.tests import TEST_API_URL
from openedx.core.djangoapps.credit import api
from openedx.core.djangoapps.credit.email_utils import get_credit_provider_attribute_values, make_providers_strings
@@ -39,9 +39,9 @@ from openedx.core.djangoapps.credit.models import (
CreditRequirementStatus
)
from openedx.core.djangolib.testing.utils import skip_unless_lms
-from student.models import CourseEnrollment
-from student.tests.factories import UserFactory
-from util.date_utils import from_timestamp
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.student.tests.factories import UserFactory
+from common.djangoapps.util.date_utils import from_timestamp
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/openedx/core/djangoapps/credit/tests/test_models.py b/openedx/core/djangoapps/credit/tests/test_models.py
index a48ffa1682..cb233954f1 100644
--- a/openedx/core/djangoapps/credit/tests/test_models.py
+++ b/openedx/core/djangoapps/credit/tests/test_models.py
@@ -20,7 +20,7 @@ from openedx.core.djangoapps.user_api.accounts.tests.retirement_helpers import (
setup_retirement_states
)
from openedx.core.djangoapps.user_api.models import UserRetirementStatus
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
def add_credit_course(course_key):
diff --git a/openedx/core/djangoapps/credit/tests/test_serializers.py b/openedx/core/djangoapps/credit/tests/test_serializers.py
index 9c94037983..a5da6cf3dd 100644
--- a/openedx/core/djangoapps/credit/tests/test_serializers.py
+++ b/openedx/core/djangoapps/credit/tests/test_serializers.py
@@ -8,7 +8,7 @@ from rest_framework.exceptions import PermissionDenied
from openedx.core.djangoapps.credit import serializers, signature
from openedx.core.djangoapps.credit.tests.factories import CreditEligibilityFactory, CreditProviderFactory
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
class CreditProviderSerializerTests(TestCase):
diff --git a/openedx/core/djangoapps/credit/tests/test_services.py b/openedx/core/djangoapps/credit/tests/test_services.py
index 202389f8d6..50f183f086 100644
--- a/openedx/core/djangoapps/credit/tests/test_services.py
+++ b/openedx/core/djangoapps/credit/tests/test_services.py
@@ -6,11 +6,11 @@ Tests for the Credit xBlock service
import ddt
import six
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from openedx.core.djangoapps.credit.api.eligibility import set_credit_requirements
from openedx.core.djangoapps.credit.models import CreditCourse
from openedx.core.djangoapps.credit.services import CreditService
-from student.models import CourseEnrollment, UserProfile
+from common.djangoapps.student.models import CourseEnrollment, UserProfile
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/openedx/core/djangoapps/credit/tests/test_signals.py b/openedx/core/djangoapps/credit/tests/test_signals.py
index 275174bc4b..e7fdf6c28b 100644
--- a/openedx/core/djangoapps/credit/tests/test_signals.py
+++ b/openedx/core/djangoapps/credit/tests/test_signals.py
@@ -10,13 +10,13 @@ import pytz
from django.test.client import RequestFactory
from mock import MagicMock
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from openedx.core.djangoapps.credit.api import get_credit_requirement_status, set_credit_requirements
from openedx.core.djangoapps.credit.models import CreditCourse, CreditProvider
from openedx.core.djangoapps.credit.signals import listen_for_grade_calculation
from openedx.core.djangolib.testing.utils import skip_unless_lms
-from student.models import CourseEnrollment
-from student.tests.factories import UserFactory
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/openedx/core/djangoapps/credit/tests/test_views.py b/openedx/core/djangoapps/credit/tests/test_views.py
index dffbad0b47..e4989ff235 100644
--- a/openedx/core/djangoapps/credit/tests/test_views.py
+++ b/openedx/core/djangoapps/credit/tests/test_views.py
@@ -33,8 +33,8 @@ from openedx.core.djangoapps.credit.tests.factories import (
from openedx.core.djangoapps.oauth_dispatch.jwt import create_jwt_for_user
from openedx.core.djangoapps.oauth_dispatch.tests.factories import ApplicationFactory, AccessTokenFactory
from openedx.core.djangolib.testing.utils import skip_unless_lms
-from student.tests.factories import AdminFactory, UserFactory
-from util.date_utils import to_timestamp
+from common.djangoapps.student.tests.factories import AdminFactory, UserFactory
+from common.djangoapps.util.date_utils import to_timestamp
JSON = 'application/json'
diff --git a/openedx/core/djangoapps/dark_lang/tests.py b/openedx/core/djangoapps/dark_lang/tests.py
index 4552dbd53e..76d61d2f49 100644
--- a/openedx/core/djangoapps/dark_lang/tests.py
+++ b/openedx/core/djangoapps/dark_lang/tests.py
@@ -14,7 +14,7 @@ from mock import Mock
from openedx.core.djangoapps.dark_lang.middleware import DarkLangMiddleware
from openedx.core.djangoapps.dark_lang.models import DarkLangConfig
from openedx.core.djangolib.testing.utils import CacheIsolationTestCase
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
UNSET = object()
diff --git a/openedx/core/djangoapps/debug/views.py b/openedx/core/djangoapps/debug/views.py
index 8f09c72161..37531ce46b 100644
--- a/openedx/core/djangoapps/debug/views.py
+++ b/openedx/core/djangoapps/debug/views.py
@@ -10,7 +10,7 @@ from django.http import HttpResponseNotFound
from django.template import TemplateDoesNotExist
from django.utils.translation import ugettext as _
-from edxmako.shortcuts import render_to_response
+from common.djangoapps.edxmako.shortcuts import render_to_response
from openedx.core.djangoapps.util.user_messages import PageLevelMessages
diff --git a/openedx/core/djangoapps/demographics/tests/test_status.py b/openedx/core/djangoapps/demographics/tests/test_status.py
index a8df58793c..e80b24e787 100644
--- a/openedx/core/djangoapps/demographics/tests/test_status.py
+++ b/openedx/core/djangoapps/demographics/tests/test_status.py
@@ -7,10 +7,10 @@ from django.conf import settings
from pytest import mark
from unittest import TestCase
-from course_modes.models import CourseMode
-from course_modes.tests.factories import CourseModeFactory
+from common.djangoapps.course_modes.models import CourseMode
+from common.djangoapps.course_modes.tests.factories import CourseModeFactory
from opaque_keys.edx.keys import CourseKey
-from student.tests.factories import CourseEnrollmentFactory, UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase, TEST_DATA_SPLIT_MODULESTORE
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/openedx/core/djangoapps/django_comment_common/models.py b/openedx/core/djangoapps/django_comment_common/models.py
index efd2709ead..55d8ab091e 100644
--- a/openedx/core/djangoapps/django_comment_common/models.py
+++ b/openedx/core/djangoapps/django_comment_common/models.py
@@ -17,8 +17,8 @@ from opaque_keys.edx.django.models import CourseKeyField
from six import text_type
from openedx.core.djangoapps.xmodule_django.models import NoneToEmptyManager
-from student.models import CourseEnrollment
-from student.roles import GlobalStaff
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.student.roles import GlobalStaff
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.exceptions import ItemNotFoundError
diff --git a/openedx/core/djangoapps/django_comment_common/tests.py b/openedx/core/djangoapps/django_comment_common/tests.py
index f00338e8e4..d8f2594a09 100644
--- a/openedx/core/djangoapps/django_comment_common/tests.py
+++ b/openedx/core/djangoapps/django_comment_common/tests.py
@@ -13,7 +13,7 @@ from openedx.core.djangoapps.django_comment_common.utils import (
get_course_discussion_settings,
set_course_discussion_settings
)
-from student.models import CourseEnrollment, User
+from common.djangoapps.student.models import CourseEnrollment, User
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
diff --git a/openedx/core/djangoapps/embargo/api.py b/openedx/core/djangoapps/embargo/api.py
index 7369163b1a..7c9a73ad00 100644
--- a/openedx/core/djangoapps/embargo/api.py
+++ b/openedx/core/djangoapps/embargo/api.py
@@ -15,7 +15,7 @@ from rest_framework import status
from rest_framework.response import Response
import geoip2.database
-from student.auth import has_course_author_access
+from common.djangoapps.student.auth import has_course_author_access
from .models import CountryAccessRule, RestrictedCourse
diff --git a/openedx/core/djangoapps/embargo/tests/test_api.py b/openedx/core/djangoapps/embargo/tests/test_api.py
index d996754d71..10dd306f6e 100644
--- a/openedx/core/djangoapps/embargo/tests/test_api.py
+++ b/openedx/core/djangoapps/embargo/tests/test_api.py
@@ -17,18 +17,18 @@ from django.core.cache import cache
from django.db import connection
from openedx.core.djangolib.testing.utils import skip_unless_lms
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.modulestore.tests.django_utils import (
ModuleStoreTestCase, mixed_store_config
)
-from student.roles import (
+from common.djangoapps.student.roles import (
GlobalStaff, CourseRole, OrgRole,
CourseStaffRole, CourseInstructorRole,
OrgStaffRole, OrgInstructorRole
)
-from util.testing import UrlResetMixin
+from common.djangoapps.util.testing import UrlResetMixin
from ..models import (
RestrictedCourse, Country, CountryAccessRule,
)
diff --git a/openedx/core/djangoapps/embargo/tests/test_middleware.py b/openedx/core/djangoapps/embargo/tests/test_middleware.py
index b15578e33e..b08600f9cd 100644
--- a/openedx/core/djangoapps/embargo/tests/test_middleware.py
+++ b/openedx/core/djangoapps/embargo/tests/test_middleware.py
@@ -12,8 +12,8 @@ from django.urls import reverse
from mock import patch
from openedx.core.djangolib.testing.utils import skip_unless_lms
-from student.tests.factories import UserFactory
-from util.testing import UrlResetMixin
+from common.djangoapps.student.tests.factories import UserFactory
+from common.djangoapps.util.testing import UrlResetMixin
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/openedx/core/djangoapps/embargo/tests/test_views.py b/openedx/core/djangoapps/embargo/tests/test_views.py
index ac4e982cfa..874b327205 100644
--- a/openedx/core/djangoapps/embargo/tests/test_views.py
+++ b/openedx/core/djangoapps/embargo/tests/test_views.py
@@ -14,8 +14,8 @@ from .. import messages
from lms.djangoapps.course_api.tests.mixins import CourseApiFactoryMixin
from openedx.core.djangolib.testing.utils import CacheIsolationTestCase, skip_unless_lms
from openedx.core.djangoapps.theming.tests.test_util import with_comprehensive_theme
-from student.tests.factories import UserFactory
-from util.testing import UrlResetMixin
+from common.djangoapps.student.tests.factories import UserFactory
+from common.djangoapps.util.testing import UrlResetMixin
from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
diff --git a/openedx/core/djangoapps/embargo/views.py b/openedx/core/djangoapps/embargo/views.py
index fe9bdb4faf..5fa8635e51 100644
--- a/openedx/core/djangoapps/embargo/views.py
+++ b/openedx/core/djangoapps/embargo/views.py
@@ -11,7 +11,7 @@ from rest_framework.exceptions import ValidationError
from rest_framework.response import Response
from rest_framework.views import APIView
-from edxmako.shortcuts import render_to_response
+from common.djangoapps.edxmako.shortcuts import render_to_response
from . import messages
from .api import check_course_access
diff --git a/openedx/core/djangoapps/enrollments/api.py b/openedx/core/djangoapps/enrollments/api.py
index ee46fc31fc..a71aeed556 100644
--- a/openedx/core/djangoapps/enrollments/api.py
+++ b/openedx/core/djangoapps/enrollments/api.py
@@ -12,7 +12,7 @@ from django.conf import settings
from django.core.cache import cache
from opaque_keys.edx.keys import CourseKey
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from openedx.core.djangoapps.enrollments import errors
log = logging.getLogger(__name__)
diff --git a/openedx/core/djangoapps/enrollments/data.py b/openedx/core/djangoapps/enrollments/data.py
index 448f50a52d..aaa4bfcba6 100644
--- a/openedx/core/djangoapps/enrollments/data.py
+++ b/openedx/core/djangoapps/enrollments/data.py
@@ -21,7 +21,7 @@ from openedx.core.djangoapps.enrollments.errors import (
)
from openedx.core.djangoapps.enrollments.serializers import CourseEnrollmentSerializer, CourseSerializer
from openedx.core.lib.exceptions import CourseNotFoundError
-from student.models import (
+from common.djangoapps.student.models import (
AlreadyEnrolledError,
CourseEnrollment,
CourseEnrollmentAttribute,
@@ -29,7 +29,7 @@ from student.models import (
EnrollmentClosedError,
NonExistentCourseError
)
-from student.roles import RoleCache
+from common.djangoapps.student.roles import RoleCache
log = logging.getLogger(__name__)
diff --git a/openedx/core/djangoapps/enrollments/management/tests/test_enroll_user_in_course.py b/openedx/core/djangoapps/enrollments/management/tests/test_enroll_user_in_course.py
index 566f5fe1ed..b23915b663 100644
--- a/openedx/core/djangoapps/enrollments/management/tests/test_enroll_user_in_course.py
+++ b/openedx/core/djangoapps/enrollments/management/tests/test_enroll_user_in_course.py
@@ -10,7 +10,7 @@ from django.core.management import call_command
from django.core.management.base import CommandError
from openedx.core.djangoapps.enrollments.api import get_enrollment
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/openedx/core/djangoapps/enrollments/serializers.py b/openedx/core/djangoapps/enrollments/serializers.py
index 8a1c7750ab..17739a61d1 100644
--- a/openedx/core/djangoapps/enrollments/serializers.py
+++ b/openedx/core/djangoapps/enrollments/serializers.py
@@ -7,8 +7,8 @@ import logging
from rest_framework import serializers
-from course_modes.models import CourseMode
-from student.models import CourseEnrollment
+from common.djangoapps.course_modes.models import CourseMode
+from common.djangoapps.student.models import CourseEnrollment
log = logging.getLogger(__name__)
diff --git a/openedx/core/djangoapps/enrollments/tests/test_api.py b/openedx/core/djangoapps/enrollments/tests/test_api.py
index 040791e750..6e2ec5710b 100644
--- a/openedx/core/djangoapps/enrollments/tests/test_api.py
+++ b/openedx/core/djangoapps/enrollments/tests/test_api.py
@@ -11,7 +11,7 @@ from django.conf import settings
from django.test.utils import override_settings
from mock import Mock, patch
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from openedx.core.djangoapps.enrollments import api
from openedx.core.djangoapps.enrollments.errors import (
CourseModeNotFoundError, EnrollmentApiLoadError, EnrollmentNotFoundError,
diff --git a/openedx/core/djangoapps/enrollments/tests/test_data.py b/openedx/core/djangoapps/enrollments/tests/test_data.py
index a74047a71b..0cdc6f331b 100644
--- a/openedx/core/djangoapps/enrollments/tests/test_data.py
+++ b/openedx/core/djangoapps/enrollments/tests/test_data.py
@@ -15,8 +15,8 @@ from mock import patch
from pytz import UTC
from six.moves import range
-from course_modes.models import CourseMode
-from course_modes.tests.factories import CourseModeFactory
+from common.djangoapps.course_modes.models import CourseMode
+from common.djangoapps.course_modes.tests.factories import CourseModeFactory
from openedx.core.djangoapps.enrollments import data
from openedx.core.djangoapps.enrollments.errors import (
CourseEnrollmentClosedError,
@@ -26,8 +26,8 @@ from openedx.core.djangoapps.enrollments.errors import (
)
from openedx.core.djangoapps.enrollments.serializers import CourseEnrollmentSerializer
from openedx.core.lib.exceptions import CourseNotFoundError
-from student.models import AlreadyEnrolledError, CourseEnrollment, CourseFullError, EnrollmentClosedError
-from student.tests.factories import CourseAccessRoleFactory, UserFactory, CourseEnrollmentFactory
+from common.djangoapps.student.models import AlreadyEnrolledError, CourseEnrollment, CourseFullError, EnrollmentClosedError
+from common.djangoapps.student.tests.factories import CourseAccessRoleFactory, UserFactory, CourseEnrollmentFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/openedx/core/djangoapps/enrollments/tests/test_views.py b/openedx/core/djangoapps/enrollments/tests/test_views.py
index e9a6bfa49f..38c2eedabf 100644
--- a/openedx/core/djangoapps/enrollments/tests/test_views.py
+++ b/openedx/core/djangoapps/enrollments/tests/test_views.py
@@ -27,8 +27,8 @@ from rest_framework.test import APITestCase
from six import text_type
from six.moves import range
-from course_modes.models import CourseMode
-from course_modes.tests.factories import CourseModeFactory
+from common.djangoapps.course_modes.models import CourseMode
+from common.djangoapps.course_modes.tests.factories import CourseModeFactory
from openedx.core.djangoapps.content.course_overviews.models import CourseOverview
from openedx.core.djangoapps.course_groups import cohorts
from openedx.core.djangoapps.embargo.models import Country, CountryAccessRule, RestrictedCourse
@@ -41,11 +41,11 @@ from openedx.core.djangoapps.user_api.models import RetirementState, UserOrgTag,
from openedx.core.lib.django_test_client_utils import get_absolute_url
from openedx.features.enterprise_support.tests import FAKE_ENTERPRISE_CUSTOMER
from openedx.features.enterprise_support.tests.mixins.enterprise import EnterpriseServiceMockMixin
-from student.models import CourseEnrollment
-from student.roles import CourseStaffRole
-from student.tests.factories import AdminFactory, SuperuserFactory, UserFactory
-from util.models import RateLimitConfiguration
-from util.testing import UrlResetMixin
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.student.roles import CourseStaffRole
+from common.djangoapps.student.tests.factories import AdminFactory, SuperuserFactory, UserFactory
+from common.djangoapps.util.models import RateLimitConfiguration
+from common.djangoapps.util.testing import UrlResetMixin
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, check_mongo_calls_range
diff --git a/openedx/core/djangoapps/enrollments/views.py b/openedx/core/djangoapps/enrollments/views.py
index ea5dc5c46d..efd8b12e96 100644
--- a/openedx/core/djangoapps/enrollments/views.py
+++ b/openedx/core/djangoapps/enrollments/views.py
@@ -9,7 +9,7 @@ import logging
from six import text_type
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from django.core.exceptions import ObjectDoesNotExist, ValidationError
from django.utils.decorators import method_decorator
from edx_rest_framework_extensions.auth.jwt.authentication import JwtAuthentication
@@ -46,10 +46,10 @@ from rest_framework.generics import ListAPIView
from rest_framework.response import Response
from rest_framework.throttling import UserRateThrottle
from rest_framework.views import APIView
-from student.auth import user_has_role
-from student.models import CourseEnrollment, User
-from student.roles import CourseStaffRole, GlobalStaff
-from util.disable_rate_limit import can_disable_rate_limit
+from common.djangoapps.student.auth import user_has_role
+from common.djangoapps.student.models import CourseEnrollment, User
+from common.djangoapps.student.roles import CourseStaffRole, GlobalStaff
+from common.djangoapps.util.disable_rate_limit import can_disable_rate_limit
log = logging.getLogger(__name__)
REQUIRED_ATTRIBUTES = {
diff --git a/openedx/core/djangoapps/external_user_ids/tests/test_admin_generate_id.py b/openedx/core/djangoapps/external_user_ids/tests/test_admin_generate_id.py
index f0d8878e8d..e9758b6abb 100644
--- a/openedx/core/djangoapps/external_user_ids/tests/test_admin_generate_id.py
+++ b/openedx/core/djangoapps/external_user_ids/tests/test_admin_generate_id.py
@@ -4,7 +4,7 @@
import mock
from django.contrib.admin.sites import AdminSite
from django.test import TestCase
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from openedx.core.djangoapps.external_user_ids.models import (
ExternalId,
diff --git a/openedx/core/djangoapps/external_user_ids/tests/test_signals.py b/openedx/core/djangoapps/external_user_ids/tests/test_signals.py
index 33ab1a9bc1..34aa8758ca 100644
--- a/openedx/core/djangoapps/external_user_ids/tests/test_signals.py
+++ b/openedx/core/djangoapps/external_user_ids/tests/test_signals.py
@@ -6,20 +6,20 @@ from opaque_keys.edx.keys import CourseKey
from django.core.cache import cache
from edx_django_utils.cache import RequestCache
-from entitlements.models import CourseEntitlement
+from common.djangoapps.entitlements.models import CourseEntitlement
from openedx.core.djangoapps.catalog.tests.factories import (
CourseFactory,
ProgramFactory,
)
-from student.tests.factories import TEST_PASSWORD, UserFactory, CourseEnrollmentFactory
+from common.djangoapps.student.tests.factories import TEST_PASSWORD, UserFactory, CourseEnrollmentFactory
from openedx.core.djangoapps.catalog.cache import (
CATALOG_COURSE_PROGRAMS_CACHE_KEY_TPL,
COURSE_PROGRAMS_CACHE_KEY_TPL,
PROGRAM_CACHE_KEY_TPL,
)
from openedx.core.djangoapps.external_user_ids.models import ExternalId, ExternalIdType
-from student.models import CourseEnrollment
-from course_modes.models import CourseMode
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.course_modes.models import CourseMode
from openedx.core.djangolib.testing.utils import CacheIsolationTestCase
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
diff --git a/openedx/core/djangoapps/geoinfo/tests/test_middleware.py b/openedx/core/djangoapps/geoinfo/tests/test_middleware.py
index dabb861ee8..c328ce0629 100644
--- a/openedx/core/djangoapps/geoinfo/tests/test_middleware.py
+++ b/openedx/core/djangoapps/geoinfo/tests/test_middleware.py
@@ -11,7 +11,7 @@ from django.test.client import RequestFactory
from mock import MagicMock, PropertyMock, patch
from openedx.core.djangoapps.geoinfo.middleware import CountryMiddleware
-from student.tests.factories import AnonymousUserFactory, UserFactory
+from common.djangoapps.student.tests.factories import AnonymousUserFactory, UserFactory
class CountryMiddlewareTests(TestCase):
diff --git a/openedx/core/djangoapps/heartbeat/views.py b/openedx/core/djangoapps/heartbeat/views.py
index bdba4cf0bc..6697db4d30 100644
--- a/openedx/core/djangoapps/heartbeat/views.py
+++ b/openedx/core/djangoapps/heartbeat/views.py
@@ -6,7 +6,7 @@ Views for verifying the health (heartbeat) of the app.
import logging
import six
-from util.json_request import JsonResponse
+from common.djangoapps.util.json_request import JsonResponse
from .runchecks import runchecks
diff --git a/openedx/core/djangoapps/lang_pref/tests/test_middleware.py b/openedx/core/djangoapps/lang_pref/tests/test_middleware.py
index 0c699836db..f71946a514 100644
--- a/openedx/core/djangoapps/lang_pref/tests/test_middleware.py
+++ b/openedx/core/djangoapps/lang_pref/tests/test_middleware.py
@@ -23,7 +23,7 @@ from openedx.core.djangoapps.user_api.preferences.api import (
set_user_preference
)
from openedx.core.djangolib.testing.utils import CacheIsolationTestCase
-from student.tests.factories import AnonymousUserFactory, UserFactory
+from common.djangoapps.student.tests.factories import AnonymousUserFactory, UserFactory
@ddt.ddt
diff --git a/openedx/core/djangoapps/lang_pref/tests/test_views.py b/openedx/core/djangoapps/lang_pref/tests/test_views.py
index 682e0d77dd..0984c7422e 100644
--- a/openedx/core/djangoapps/lang_pref/tests/test_views.py
+++ b/openedx/core/djangoapps/lang_pref/tests/test_views.py
@@ -10,7 +10,7 @@ from django.test import TestCase
from django.test.client import RequestFactory
from django.urls import reverse
from django.utils.translation import LANGUAGE_SESSION_KEY, get_language
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
class TestLangPrefView(TestCase):
diff --git a/openedx/core/djangoapps/oauth_dispatch/jwt.py b/openedx/core/djangoapps/oauth_dispatch/jwt.py
index 6a1be45f0b..57ef0f8977 100644
--- a/openedx/core/djangoapps/oauth_dispatch/jwt.py
+++ b/openedx/core/djangoapps/oauth_dispatch/jwt.py
@@ -10,7 +10,7 @@ from edx_rbac.utils import create_role_auth_claim_for_user
from jwkest import jwk
from jwkest.jws import JWS
-from student.models import UserProfile, anonymous_id_for_user
+from common.djangoapps.student.models import UserProfile, anonymous_id_for_user
def create_jwt_for_user(user, secret=None, aud=None, additional_claims=None, scopes=None):
diff --git a/openedx/core/djangoapps/oauth_dispatch/management/commands/tests/test_clear_expired_tokens.py b/openedx/core/djangoapps/oauth_dispatch/management/commands/tests/test_clear_expired_tokens.py
index af34319718..9a3eacb56e 100644
--- a/openedx/core/djangoapps/oauth_dispatch/management/commands/tests/test_clear_expired_tokens.py
+++ b/openedx/core/djangoapps/oauth_dispatch/management/commands/tests/test_clear_expired_tokens.py
@@ -18,7 +18,7 @@ from oauth2_provider.models import AccessToken, RefreshToken
from testfixtures import LogCapture
from openedx.core.djangoapps.oauth_dispatch.tests import factories
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
LOGGER_NAME = 'openedx.core.djangoapps.oauth_dispatch.management.commands.edx_clear_expired_tokens'
diff --git a/openedx/core/djangoapps/oauth_dispatch/management/commands/tests/test_create_dot_application.py b/openedx/core/djangoapps/oauth_dispatch/management/commands/tests/test_create_dot_application.py
index 98d7cbe563..437c71107f 100644
--- a/openedx/core/djangoapps/oauth_dispatch/management/commands/tests/test_create_dot_application.py
+++ b/openedx/core/djangoapps/oauth_dispatch/management/commands/tests/test_create_dot_application.py
@@ -9,7 +9,7 @@ from django.test import TestCase
from oauth2_provider.models import get_application_model
from openedx.core.djangoapps.oauth_dispatch.models import ApplicationAccess
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from ..create_dot_application import Command
diff --git a/openedx/core/djangoapps/oauth_dispatch/tests/factories.py b/openedx/core/djangoapps/oauth_dispatch/tests/factories.py
index fe1405cefd..a0ca20aa0a 100644
--- a/openedx/core/djangoapps/oauth_dispatch/tests/factories.py
+++ b/openedx/core/djangoapps/oauth_dispatch/tests/factories.py
@@ -10,7 +10,7 @@ from factory.fuzzy import FuzzyText
from oauth2_provider.models import AccessToken, Application, RefreshToken
from openedx.core.djangoapps.oauth_dispatch.models import ApplicationAccess
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
class ApplicationFactory(DjangoModelFactory):
diff --git a/openedx/core/djangoapps/oauth_dispatch/tests/mixins.py b/openedx/core/djangoapps/oauth_dispatch/tests/mixins.py
index b80c613f3a..64167c9b26 100644
--- a/openedx/core/djangoapps/oauth_dispatch/tests/mixins.py
+++ b/openedx/core/djangoapps/oauth_dispatch/tests/mixins.py
@@ -9,7 +9,7 @@ from jwkest.jwk import KEYS
from jwkest.jws import JWS
from jwt.exceptions import ExpiredSignatureError
-from student.models import UserProfile, anonymous_id_for_user
+from common.djangoapps.student.models import UserProfile, anonymous_id_for_user
class AccessTokenMixin(object):
diff --git a/openedx/core/djangoapps/oauth_dispatch/tests/test_api.py b/openedx/core/djangoapps/oauth_dispatch/tests/test_api.py
index 4e183b971f..4a08ef29e8 100644
--- a/openedx/core/djangoapps/oauth_dispatch/tests/test_api.py
+++ b/openedx/core/djangoapps/oauth_dispatch/tests/test_api.py
@@ -8,7 +8,7 @@ from django.http import HttpRequest
from django.test import TestCase
from oauth2_provider.models import AccessToken
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
OAUTH_PROVIDER_ENABLED = settings.FEATURES.get('ENABLE_OAUTH2_PROVIDER')
if OAUTH_PROVIDER_ENABLED:
diff --git a/openedx/core/djangoapps/oauth_dispatch/tests/test_client_credentials.py b/openedx/core/djangoapps/oauth_dispatch/tests/test_client_credentials.py
index 771d7b94c0..82db02e289 100644
--- a/openedx/core/djangoapps/oauth_dispatch/tests/test_client_credentials.py
+++ b/openedx/core/djangoapps/oauth_dispatch/tests/test_client_credentials.py
@@ -9,7 +9,7 @@ from django.test import TestCase
from django.urls import reverse
from oauth2_provider.models import Application
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from ..adapters import DOTAdapter
from . import mixins
diff --git a/openedx/core/djangoapps/oauth_dispatch/tests/test_dot_adapter.py b/openedx/core/djangoapps/oauth_dispatch/tests/test_dot_adapter.py
index d3db2e0d47..1e01febf3f 100644
--- a/openedx/core/djangoapps/oauth_dispatch/tests/test_dot_adapter.py
+++ b/openedx/core/djangoapps/oauth_dispatch/tests/test_dot_adapter.py
@@ -13,7 +13,7 @@ from django.test import TestCase
from django.utils.timezone import now
from oauth2_provider import models
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
# oauth_dispatch is not in CMS' INSTALLED_APPS so these imports will error during test collection
if settings.FEATURES.get("ENABLE_OAUTH2_PROVIDER"):
diff --git a/openedx/core/djangoapps/oauth_dispatch/tests/test_dot_overrides.py b/openedx/core/djangoapps/oauth_dispatch/tests/test_dot_overrides.py
index 7176710fbf..5a6504ae36 100644
--- a/openedx/core/djangoapps/oauth_dispatch/tests/test_dot_overrides.py
+++ b/openedx/core/djangoapps/oauth_dispatch/tests/test_dot_overrides.py
@@ -13,7 +13,7 @@ from django.contrib.auth.models import User
from django.test import RequestFactory, TestCase
from django.utils import timezone
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
# oauth_dispatch is not in CMS' INSTALLED_APPS so these imports will error during test collection
if settings.ROOT_URLCONF == 'lms.urls':
diff --git a/openedx/core/djangoapps/oauth_dispatch/tests/test_factories.py b/openedx/core/djangoapps/oauth_dispatch/tests/test_factories.py
index af26a93f4e..00dae55c8f 100644
--- a/openedx/core/djangoapps/oauth_dispatch/tests/test_factories.py
+++ b/openedx/core/djangoapps/oauth_dispatch/tests/test_factories.py
@@ -8,7 +8,7 @@ from django.test import TestCase
from oauth2_provider.models import AccessToken, Application, RefreshToken
from openedx.core.djangoapps.oauth_dispatch.tests import factories
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
@unittest.skipUnless(settings.FEATURES.get("ENABLE_OAUTH2_PROVIDER"), "OAuth2 not enabled")
diff --git a/openedx/core/djangoapps/oauth_dispatch/tests/test_jwt.py b/openedx/core/djangoapps/oauth_dispatch/tests/test_jwt.py
index 3a0d0ef886..ffb0f873b0 100644
--- a/openedx/core/djangoapps/oauth_dispatch/tests/test_jwt.py
+++ b/openedx/core/djangoapps/oauth_dispatch/tests/test_jwt.py
@@ -13,7 +13,7 @@ from openedx.core.djangoapps.oauth_dispatch import jwt as jwt_api
from openedx.core.djangoapps.oauth_dispatch.adapters import DOTAdapter
from openedx.core.djangoapps.oauth_dispatch.models import RestrictedApplication
from openedx.core.djangoapps.oauth_dispatch.tests.mixins import AccessTokenMixin
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
@ddt.ddt
diff --git a/openedx/core/djangoapps/oauth_dispatch/tests/test_views.py b/openedx/core/djangoapps/oauth_dispatch/tests/test_views.py
index 13184ae2cd..c3b5aa264a 100644
--- a/openedx/core/djangoapps/oauth_dispatch/tests/test_views.py
+++ b/openedx/core/djangoapps/oauth_dispatch/tests/test_views.py
@@ -16,8 +16,8 @@ from jwkest import jwk
from mock import call, patch
from oauth2_provider import models as dot_models
-from student.tests.factories import UserFactory
-from third_party_auth.tests.utils import ThirdPartyOAuthTestMixin, ThirdPartyOAuthTestMixinGoogle
+from common.djangoapps.student.tests.factories import UserFactory
+from common.djangoapps.third_party_auth.tests.utils import ThirdPartyOAuthTestMixin, ThirdPartyOAuthTestMixinGoogle
from . import mixins
diff --git a/openedx/core/djangoapps/olx_rest_api/adapters.py b/openedx/core/djangoapps/olx_rest_api/adapters.py
index 97af88ecda..f5cf4aa823 100644
--- a/openedx/core/djangoapps/olx_rest_api/adapters.py
+++ b/openedx/core/djangoapps/olx_rest_api/adapters.py
@@ -10,7 +10,7 @@ from opaque_keys.edx.keys import AssetKey, CourseKey
from fs.memoryfs import MemoryFS
from fs.wrapfs import WrapFS
-from static_replace import replace_static_urls
+from common.djangoapps.static_replace import replace_static_urls
from xmodule.contentstore.content import StaticContent
from xmodule.assetstore.assetmgr import AssetManager
from xmodule.modulestore.django import modulestore as store
diff --git a/openedx/core/djangoapps/olx_rest_api/test_views.py b/openedx/core/djangoapps/olx_rest_api/test_views.py
index 4e01e5752f..13233fd895 100644
--- a/openedx/core/djangoapps/olx_rest_api/test_views.py
+++ b/openedx/core/djangoapps/olx_rest_api/test_views.py
@@ -5,8 +5,8 @@ import re
from xml.dom import minidom
from openedx.core.djangolib.testing.utils import skip_unless_cms
-from student.roles import CourseStaffRole
-from student.tests.factories import CourseEnrollmentFactory, UserFactory
+from common.djangoapps.student.roles import CourseStaffRole
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory, UserFactory
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import ToyCourseFactory
diff --git a/openedx/core/djangoapps/olx_rest_api/views.py b/openedx/core/djangoapps/olx_rest_api/views.py
index 48fe29cc4e..3e2351f47d 100644
--- a/openedx/core/djangoapps/olx_rest_api/views.py
+++ b/openedx/core/djangoapps/olx_rest_api/views.py
@@ -9,7 +9,7 @@ from rest_framework.decorators import api_view
from rest_framework.exceptions import NotFound, PermissionDenied, ValidationError
from rest_framework.response import Response
-from student.auth import has_studio_read_access
+from common.djangoapps.student.auth import has_studio_read_access
from openedx.core.lib.api.view_utils import view_auth_classes
from . import adapters
diff --git a/openedx/core/djangoapps/password_policy/compliance.py b/openedx/core/djangoapps/password_policy/compliance.py
index b6283b9b28..583067efa8 100644
--- a/openedx/core/djangoapps/password_policy/compliance.py
+++ b/openedx/core/djangoapps/password_policy/compliance.py
@@ -9,8 +9,8 @@ from django.conf import settings
from django.utils.translation import ugettext as _
from openedx.core.djangolib.markup import HTML
-from util.date_utils import DEFAULT_SHORT_DATE_FORMAT, strftime_localized
-from util.password_policy_validators import validate_password
+from common.djangoapps.util.date_utils import DEFAULT_SHORT_DATE_FORMAT, strftime_localized
+from common.djangoapps.util.password_policy_validators import validate_password
class NonCompliantPasswordException(Exception):
diff --git a/openedx/core/djangoapps/password_policy/tests/test_compliance.py b/openedx/core/djangoapps/password_policy/tests/test_compliance.py
index 1f26a5efdb..ca1e447274 100644
--- a/openedx/core/djangoapps/password_policy/tests/test_compliance.py
+++ b/openedx/core/djangoapps/password_policy/tests/test_compliance.py
@@ -15,9 +15,9 @@ from openedx.core.djangoapps.password_policy.compliance import (NonCompliantPass
_get_compliance_deadline_for_user,
enforce_compliance_on_login,
should_enforce_compliance_on_login)
-from student.tests.factories import (CourseAccessRoleFactory,
- UserFactory)
-from util.password_policy_validators import ValidationError
+from common.djangoapps.student.tests.factories import (CourseAccessRoleFactory,
+ UserFactory)
+from common.djangoapps.util.password_policy_validators import ValidationError
date1 = parse_date('2018-01-01 00:00:00+00:00')
diff --git a/openedx/core/djangoapps/password_policy/tests/test_forms.py b/openedx/core/djangoapps/password_policy/tests/test_forms.py
index 1ee0691cab..0bfb3a840d 100644
--- a/openedx/core/djangoapps/password_policy/tests/test_forms.py
+++ b/openedx/core/djangoapps/password_policy/tests/test_forms.py
@@ -12,7 +12,7 @@ from openedx.core.djangoapps.password_policy.compliance import (
NonCompliantPasswordException, NonCompliantPasswordWarning
)
from openedx.core.djangoapps.password_policy.forms import PasswordPolicyAwareAdminAuthForm
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
class PasswordPolicyAwareAdminAuthFormTests(TestCase):
diff --git a/openedx/core/djangoapps/plugin_api/views.py b/openedx/core/djangoapps/plugin_api/views.py
index 965e0a1d3e..c2e07c6fcb 100644
--- a/openedx/core/djangoapps/plugin_api/views.py
+++ b/openedx/core/djangoapps/plugin_api/views.py
@@ -11,7 +11,7 @@ from django.http import HttpResponse
from django.shortcuts import render
from web_fragments.views import FragmentView
-from edxmako.shortcuts import is_any_marketing_link_set, is_marketing_link_set, marketing_link
+from common.djangoapps.edxmako.shortcuts import is_any_marketing_link_set, is_marketing_link_set, marketing_link
log = logging.getLogger('plugin_api')
diff --git a/openedx/core/djangoapps/profile_images/tests/test_views.py b/openedx/core/djangoapps/profile_images/tests/test_views.py
index 99a4a67db7..04d3a58e9b 100644
--- a/openedx/core/djangoapps/profile_images/tests/test_views.py
+++ b/openedx/core/djangoapps/profile_images/tests/test_views.py
@@ -15,8 +15,8 @@ from mock import patch
from PIL import Image
from rest_framework.test import APITestCase, APIClient
-from student.tests.factories import UserFactory
-from student.tests.tests import UserSettingsEventTestMixin
+from common.djangoapps.student.tests.factories import UserFactory
+from common.djangoapps.student.tests.tests import UserSettingsEventTestMixin
from openedx.core.djangoapps.user_api.accounts.image_helpers import (
set_has_profile_image,
get_profile_image_names,
@@ -440,7 +440,7 @@ class ProfileImageViewDeleteTestCase(ProfileImageEndpointMixin, APITestCase):
)
self.check_remove_event_emitted()
- @patch('student.models.UserProfile.save')
+ @patch('common.djangoapps.student.models.UserProfile.save')
def test_remove_failure(self, user_profile_save, mock_log):
"""
Test that when remove validation fails, the proper HTTP response and
diff --git a/openedx/core/djangoapps/programs/management/commands/backpopulate_program_credentials.py b/openedx/core/djangoapps/programs/management/commands/backpopulate_program_credentials.py
index e375fcff9a..8169dd4c53 100644
--- a/openedx/core/djangoapps/programs/management/commands/backpopulate_program_credentials.py
+++ b/openedx/core/djangoapps/programs/management/commands/backpopulate_program_credentials.py
@@ -9,7 +9,7 @@ from django.core.management.base import BaseCommand, CommandError
from django.db.models import Q
from opaque_keys.edx.keys import CourseKey
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from lms.djangoapps.certificates.models import CertificateStatuses, GeneratedCertificate
from openedx.core.djangoapps.catalog.utils import get_programs
from openedx.core.djangoapps.programs.tasks import award_program_certificates
diff --git a/openedx/core/djangoapps/programs/tasks.py b/openedx/core/djangoapps/programs/tasks.py
index 913c5d41a8..fb3c68ba2b 100644
--- a/openedx/core/djangoapps/programs/tasks.py
+++ b/openedx/core/djangoapps/programs/tasks.py
@@ -12,7 +12,7 @@ from django.contrib.sites.models import Site
from edx_rest_api_client import exceptions
from opaque_keys.edx.keys import CourseKey
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from lms.djangoapps.certificates.models import GeneratedCertificate
from openedx.core.djangoapps.certificates.api import available_date_for_certificate
from openedx.core.djangoapps.content.course_overviews.models import CourseOverview
diff --git a/openedx/core/djangoapps/programs/tests/test_backpopulate_program_credentials.py b/openedx/core/djangoapps/programs/tests/test_backpopulate_program_credentials.py
index 69173cf9f0..f12bd0a2e7 100644
--- a/openedx/core/djangoapps/programs/tests/test_backpopulate_program_credentials.py
+++ b/openedx/core/djangoapps/programs/tests/test_backpopulate_program_credentials.py
@@ -8,7 +8,7 @@ from django.test import TestCase
from opaque_keys.edx.keys import CourseKey
from six.moves import range
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from lms.djangoapps.certificates.api import MODES
from lms.djangoapps.certificates.models import CertificateStatuses
from lms.djangoapps.certificates.tests.factories import GeneratedCertificateFactory
@@ -22,7 +22,7 @@ from openedx.core.djangoapps.catalog.tests.mixins import CatalogIntegrationMixin
from openedx.core.djangoapps.content.course_overviews.tests.factories import CourseOverviewFactory
from openedx.core.djangoapps.credentials.tests.mixins import CredentialsApiConfigMixin
from openedx.core.djangolib.testing.utils import skip_unless_lms
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
COMMAND_MODULE = 'openedx.core.djangoapps.programs.management.commands.backpopulate_program_credentials'
diff --git a/openedx/core/djangoapps/programs/tests/test_signals.py b/openedx/core/djangoapps/programs/tests/test_signals.py
index 4b4bca8c06..e33c6c20cd 100644
--- a/openedx/core/djangoapps/programs/tests/test_signals.py
+++ b/openedx/core/djangoapps/programs/tests/test_signals.py
@@ -20,7 +20,7 @@ from openedx.core.djangoapps.signals.signals import (
)
from openedx.core.djangoapps.site_configuration.tests.factories import SiteConfigurationFactory
from openedx.core.djangolib.testing.utils import skip_unless_lms
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
TEST_USERNAME = 'test-user'
TEST_COURSE_KEY = CourseKey.from_string('course-v1:edX+test_course+1')
diff --git a/openedx/core/djangoapps/programs/tests/test_tasks.py b/openedx/core/djangoapps/programs/tests/test_tasks.py
index 5576dada75..70965a08b4 100644
--- a/openedx/core/djangoapps/programs/tests/test_tasks.py
+++ b/openedx/core/djangoapps/programs/tests/test_tasks.py
@@ -27,7 +27,7 @@ from openedx.core.djangoapps.oauth_dispatch.tests.factories import ApplicationFa
from openedx.core.djangoapps.programs import tasks
from openedx.core.djangoapps.site_configuration.tests.factories import SiteConfigurationFactory, SiteFactory
from openedx.core.djangolib.testing.utils import skip_unless_lms
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
log = logging.getLogger(__name__)
diff --git a/openedx/core/djangoapps/programs/tests/test_utils.py b/openedx/core/djangoapps/programs/tests/test_utils.py
index 0a2b0fc2d6..bc75946421 100644
--- a/openedx/core/djangoapps/programs/tests/test_utils.py
+++ b/openedx/core/djangoapps/programs/tests/test_utils.py
@@ -20,9 +20,9 @@ from pytz import utc
from testfixtures import LogCapture
from waffle.testutils import override_switch
-from course_modes.models import CourseMode
-from course_modes.tests.factories import CourseModeFactory
-from entitlements.tests.factories import CourseEntitlementFactory
+from common.djangoapps.course_modes.models import CourseMode
+from common.djangoapps.course_modes.tests.factories import CourseModeFactory
+from common.djangoapps.entitlements.tests.factories import CourseEntitlementFactory
from lms.djangoapps.certificates.api import MODES
from lms.djangoapps.certificates.tests.factories import GeneratedCertificateFactory
from lms.djangoapps.commerce.tests.test_utils import update_commerce_config
@@ -49,8 +49,8 @@ from openedx.core.djangoapps.programs.utils import (
)
from openedx.core.djangoapps.site_configuration.tests.factories import SiteFactory
from openedx.core.djangolib.testing.utils import skip_unless_lms
-from student.tests.factories import AnonymousUserFactory, CourseEnrollmentFactory, UserFactory
-from util.date_utils import strftime_localized
+from common.djangoapps.student.tests.factories import AnonymousUserFactory, CourseEnrollmentFactory, UserFactory
+from common.djangoapps.util.date_utils import strftime_localized
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.django_utils import (
ModuleStoreTestCase, SharedModuleStoreTestCase, TEST_DATA_SPLIT_MODULESTORE
diff --git a/openedx/core/djangoapps/programs/utils.py b/openedx/core/djangoapps/programs/utils.py
index 0926927da3..1f3aabbd6e 100644
--- a/openedx/core/djangoapps/programs/utils.py
+++ b/openedx/core/djangoapps/programs/utils.py
@@ -22,10 +22,10 @@ from pytz import utc
from requests.exceptions import ConnectionError, Timeout
from six.moves.urllib.parse import urljoin, urlparse, urlunparse # pylint: disable=import-error
-from course_modes.api import get_paid_modes_for_course
-from course_modes.models import CourseMode
-from entitlements.api import get_active_entitlement_list_for_user
-from entitlements.models import CourseEntitlement
+from common.djangoapps.course_modes.api import get_paid_modes_for_course
+from common.djangoapps.course_modes.models import CourseMode
+from common.djangoapps.entitlements.api import get_active_entitlement_list_for_user
+from common.djangoapps.entitlements.models import CourseEntitlement
from lms.djangoapps.certificates import api as certificate_api
from lms.djangoapps.certificates.models import GeneratedCertificate
from lms.djangoapps.commerce.utils import EcommerceService
@@ -42,8 +42,8 @@ from openedx.core.djangoapps.enrollments.api import get_enrollments
from openedx.core.djangoapps.enrollments.permissions import ENROLL_IN_COURSE
from openedx.core.djangoapps.programs import ALWAYS_CALCULATE_PROGRAM_PRICE_AS_ANONYMOUS_USER
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
-from student.models import CourseEnrollment
-from util.date_utils import strftime_localized
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.util.date_utils import strftime_localized
from xmodule.modulestore.django import modulestore
# The datetime module's strftime() methods require a year >= 1900.
diff --git a/openedx/core/djangoapps/safe_sessions/tests/test_middleware.py b/openedx/core/djangoapps/safe_sessions/tests/test_middleware.py
index 1dce15546d..8b1d249838 100644
--- a/openedx/core/djangoapps/safe_sessions/tests/test_middleware.py
+++ b/openedx/core/djangoapps/safe_sessions/tests/test_middleware.py
@@ -15,7 +15,7 @@ from django.test.utils import override_settings
from mock import patch
from openedx.core.djangolib.testing.utils import get_mock_request
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from ..middleware import SafeCookieData, SafeSessionMiddleware
from .test_utils import TestSafeSessionsLogMixin
diff --git a/openedx/core/djangoapps/schedules/management/commands/tests/send_email_base.py b/openedx/core/djangoapps/schedules/management/commands/tests/send_email_base.py
index 4474d5feb6..cc2b6ff481 100644
--- a/openedx/core/djangoapps/schedules/management/commands/tests/send_email_base.py
+++ b/openedx/core/djangoapps/schedules/management/commands/tests/send_email_base.py
@@ -22,8 +22,8 @@ from mock import Mock, patch
from opaque_keys.edx.keys import CourseKey
from six.moves import range
-from course_modes.models import CourseMode
-from course_modes.tests.factories import CourseModeFactory
+from common.djangoapps.course_modes.models import CourseMode
+from common.djangoapps.course_modes.tests.factories import CourseModeFactory
from lms.djangoapps.courseware.models import DynamicUpgradeDeadlineConfiguration
from lms.djangoapps.commerce.models import CommerceConfiguration
from openedx.core.djangoapps.schedules import resolvers, tasks
@@ -33,8 +33,8 @@ from openedx.core.djangoapps.site_configuration.tests.factories import SiteConfi
from openedx.core.djangoapps.theming.tests.test_util import with_comprehensive_theme
from openedx.core.djangoapps.waffle_utils.testutils import WAFFLE_TABLES
from openedx.core.djangolib.testing.utils import FilteredQueryCountMixin
-from student.models import CourseEnrollment
-from student.tests.factories import UserFactory
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.student.tests.factories import UserFactory
SITE_QUERY = 1 # django_site
SITE_CONFIG_QUERY = 1 # site_configuration_siteconfiguration
diff --git a/openedx/core/djangoapps/schedules/management/commands/tests/test_send_course_update.py b/openedx/core/djangoapps/schedules/management/commands/tests/test_send_course_update.py
index a7ce38f88d..52dd962ee0 100644
--- a/openedx/core/djangoapps/schedules/management/commands/tests/test_send_course_update.py
+++ b/openedx/core/djangoapps/schedules/management/commands/tests/test_send_course_update.py
@@ -23,7 +23,7 @@ from openedx.core.djangoapps.schedules.management.commands.tests.send_email_base
from openedx.core.djangoapps.schedules.management.commands.tests.upsell_base import ScheduleUpsellTestMixin
from openedx.core.djangoapps.schedules.models import ScheduleExperience
from openedx.core.djangolib.testing.utils import skip_unless_lms
-from student.tests.factories import CourseEnrollmentFactory
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
diff --git a/openedx/core/djangoapps/schedules/management/commands/tests/test_send_upgrade_reminder.py b/openedx/core/djangoapps/schedules/management/commands/tests/test_send_upgrade_reminder.py
index f49293f6a5..e3a0445172 100644
--- a/openedx/core/djangoapps/schedules/management/commands/tests/test_send_upgrade_reminder.py
+++ b/openedx/core/djangoapps/schedules/management/commands/tests/test_send_upgrade_reminder.py
@@ -15,7 +15,7 @@ from mock import patch
from opaque_keys.edx.locator import CourseLocator
from six.moves import range
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from openedx.core.djangoapps.schedules import resolvers, tasks
from openedx.core.djangoapps.schedules.management.commands import send_upgrade_reminder as reminder
from openedx.core.djangoapps.schedules.management.commands.tests.send_email_base import (
@@ -24,7 +24,7 @@ from openedx.core.djangoapps.schedules.management.commands.tests.send_email_base
)
from openedx.core.djangoapps.schedules.models import ScheduleExperience
from openedx.core.djangolib.testing.utils import CacheIsolationTestCase, skip_unless_lms
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
LOG = logging.getLogger(__name__)
diff --git a/openedx/core/djangoapps/schedules/signals.py b/openedx/core/djangoapps/schedules/signals.py
index dae8082184..09ef4cc9fd 100644
--- a/openedx/core/djangoapps/schedules/signals.py
+++ b/openedx/core/djangoapps/schedules/signals.py
@@ -11,7 +11,7 @@ from django.db.models.signals import post_save
from django.dispatch import receiver
from edx_ace.utils import date
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from lms.djangoapps.courseware.models import (
CourseDynamicUpgradeDeadlineConfiguration,
DynamicUpgradeDeadlineConfiguration,
@@ -22,9 +22,9 @@ from openedx.core.djangoapps.schedules.content_highlights import course_has_high
from openedx.core.djangoapps.schedules.models import ScheduleExperience
from openedx.core.djangoapps.schedules.utils import reset_self_paced_schedule
from openedx.core.djangoapps.theming.helpers import get_current_site
-from student.models import CourseEnrollment
-from student.signals import ENROLLMENT_TRACK_UPDATED
-from track import segment
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.student.signals import ENROLLMENT_TRACK_UPDATED
+from common.djangoapps.track import segment
from .config import CREATE_SCHEDULE_WAFFLE_FLAG
from .models import Schedule, ScheduleConfig
diff --git a/openedx/core/djangoapps/schedules/tasks.py b/openedx/core/djangoapps/schedules/tasks.py
index fb30694b53..4aa119cc3d 100644
--- a/openedx/core/djangoapps/schedules/tasks.py
+++ b/openedx/core/djangoapps/schedules/tasks.py
@@ -24,7 +24,7 @@ from openedx.core.djangoapps.content.course_overviews.models import CourseOvervi
from openedx.core.djangoapps.schedules import message_types, resolvers
from openedx.core.djangoapps.schedules.models import Schedule, ScheduleConfig
from openedx.core.lib.celery.task_utils import emulate_http_request
-from track import segment
+from common.djangoapps.track import segment
LOG = logging.getLogger(__name__)
diff --git a/openedx/core/djangoapps/schedules/tests/factories.py b/openedx/core/djangoapps/schedules/tests/factories.py
index f7d13ab8a3..d7f060a567 100644
--- a/openedx/core/djangoapps/schedules/tests/factories.py
+++ b/openedx/core/djangoapps/schedules/tests/factories.py
@@ -8,7 +8,7 @@ import pytz
from openedx.core.djangoapps.schedules import models
from openedx.core.djangoapps.site_configuration.tests.factories import SiteFactory
-from student.tests.factories import CourseEnrollmentFactory
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory
class ScheduleExperienceFactory(factory.DjangoModelFactory):
diff --git a/openedx/core/djangoapps/schedules/tests/test_content_highlights.py b/openedx/core/djangoapps/schedules/tests/test_content_highlights.py
index 1538342ded..c9b361cd07 100644
--- a/openedx/core/djangoapps/schedules/tests/test_content_highlights.py
+++ b/openedx/core/djangoapps/schedules/tests/test_content_highlights.py
@@ -12,8 +12,8 @@ from openedx.core.djangoapps.schedules.content_highlights import (
)
from openedx.core.djangoapps.schedules.exceptions import CourseUpdateDoesNotExist
from openedx.core.djangolib.testing.utils import skip_unless_lms
-from student.models import CourseEnrollment
-from student.tests.factories import UserFactory
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore.tests.django_utils import TEST_DATA_SPLIT_MODULESTORE, ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
diff --git a/openedx/core/djangoapps/schedules/tests/test_resolvers.py b/openedx/core/djangoapps/schedules/tests/test_resolvers.py
index 94ae1bcc3f..520aca2770 100644
--- a/openedx/core/djangoapps/schedules/tests/test_resolvers.py
+++ b/openedx/core/djangoapps/schedules/tests/test_resolvers.py
@@ -24,7 +24,7 @@ from openedx.core.djangoapps.schedules.resolvers import (
from openedx.core.djangoapps.schedules.tests.factories import ScheduleConfigFactory
from openedx.core.djangoapps.site_configuration.tests.factories import SiteConfigurationFactory, SiteFactory
from openedx.core.djangolib.testing.utils import CacheIsolationMixin, skip_unless_lms
-from student.tests.factories import CourseEnrollmentFactory
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
diff --git a/openedx/core/djangoapps/schedules/tests/test_signals.py b/openedx/core/djangoapps/schedules/tests/test_signals.py
index 77cfe2d16d..3ff9c3b3a1 100644
--- a/openedx/core/djangoapps/schedules/tests/test_signals.py
+++ b/openedx/core/djangoapps/schedules/tests/test_signals.py
@@ -12,15 +12,15 @@ from mock import patch
from pytz import utc
from testfixtures import LogCapture
-from course_modes.models import CourseMode
-from course_modes.tests.factories import CourseModeFactory
+from common.djangoapps.course_modes.models import CourseMode
+from common.djangoapps.course_modes.tests.factories import CourseModeFactory
from lms.djangoapps.courseware.models import DynamicUpgradeDeadlineConfiguration
from openedx.core.djangoapps.schedules.models import ScheduleExperience
from openedx.core.djangoapps.schedules.signals import CREATE_SCHEDULE_WAFFLE_FLAG, log
from openedx.core.djangoapps.site_configuration.tests.factories import SiteFactory
from openedx.core.djangolib.testing.utils import skip_unless_lms
-from student.models import CourseEnrollment
-from student.tests.factories import CourseEnrollmentFactory
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/openedx/core/djangoapps/schedules/tests/test_utils.py b/openedx/core/djangoapps/schedules/tests/test_utils.py
index 3d2711c0a3..f3c96d6535 100644
--- a/openedx/core/djangoapps/schedules/tests/test_utils.py
+++ b/openedx/core/djangoapps/schedules/tests/test_utils.py
@@ -5,7 +5,7 @@ Tests for schedules utils
import datetime
import ddt
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from mock import patch
from pytz import utc
@@ -13,7 +13,7 @@ from openedx.core.djangoapps.schedules.models import Schedule
from openedx.core.djangoapps.schedules.tests.factories import ScheduleConfigFactory
from openedx.core.djangoapps.schedules.utils import reset_self_paced_schedule
from openedx.core.djangolib.testing.utils import skip_unless_lms
-from student.tests.factories import CourseEnrollmentFactory
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/openedx/core/djangoapps/schedules/utils.py b/openedx/core/djangoapps/schedules/utils.py
index 282e91b84c..26e8f18245 100644
--- a/openedx/core/djangoapps/schedules/utils.py
+++ b/openedx/core/djangoapps/schedules/utils.py
@@ -9,7 +9,6 @@ from django.db.models.functions import Greatest
from django.db import transaction
from openedx.core.djangoapps.schedules.models import Schedule
-from student.models import CourseEnrollment
LOG = logging.getLogger(__name__)
diff --git a/openedx/core/djangoapps/site_configuration/tests/test_middleware.py b/openedx/core/djangoapps/site_configuration/tests/test_middleware.py
index 124ba1f4a0..ff8ca7c34b 100644
--- a/openedx/core/djangoapps/site_configuration/tests/test_middleware.py
+++ b/openedx/core/djangoapps/site_configuration/tests/test_middleware.py
@@ -8,7 +8,7 @@ from django.test import TestCase
from django.test.client import Client
from django.test.utils import override_settings
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from openedx.core.djangoapps.site_configuration.tests.factories import SiteConfigurationFactory, SiteFactory
from openedx.core.djangolib.testing.utils import skip_unless_lms
diff --git a/openedx/core/djangoapps/system_wide_roles/tests/test_models.py b/openedx/core/djangoapps/system_wide_roles/tests/test_models.py
index 1c4168dbe8..1349605023 100644
--- a/openedx/core/djangoapps/system_wide_roles/tests/test_models.py
+++ b/openedx/core/djangoapps/system_wide_roles/tests/test_models.py
@@ -4,7 +4,7 @@ Tests for system wide roles' django models.
from django.test import TestCase
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from openedx.core.djangoapps.system_wide_roles.models import SystemWideRole, SystemWideRoleAssignment
diff --git a/openedx/core/djangoapps/theming/management/commands/create_sites_and_configurations.py b/openedx/core/djangoapps/theming/management/commands/create_sites_and_configurations.py
index e83a2b38b8..edbc54297f 100644
--- a/openedx/core/djangoapps/theming/management/commands/create_sites_and_configurations.py
+++ b/openedx/core/djangoapps/theming/management/commands/create_sites_and_configurations.py
@@ -18,7 +18,7 @@ from lms.djangoapps.commerce.models import CommerceConfiguration
from openedx.core.djangoapps.oauth_dispatch.models import ApplicationAccess
from openedx.core.djangoapps.site_configuration.models import SiteConfiguration
from openedx.core.djangoapps.theming.models import SiteTheme
-from student.models import UserProfile
+from common.djangoapps.student.models import UserProfile
LOG = logging.getLogger(__name__)
diff --git a/openedx/core/djangoapps/theming/management/commands/tests/test_create_sites_and_configurations.py b/openedx/core/djangoapps/theming/management/commands/tests/test_create_sites_and_configurations.py
index 52f3e47384..aec1e4451e 100644
--- a/openedx/core/djangoapps/theming/management/commands/tests/test_create_sites_and_configurations.py
+++ b/openedx/core/djangoapps/theming/management/commands/tests/test_create_sites_and_configurations.py
@@ -12,7 +12,7 @@ from django.test import TestCase
from oauth2_provider.models import Application
from openedx.core.djangoapps.oauth_dispatch.models import ApplicationAccess
from openedx.core.djangoapps.theming.models import SiteTheme
-from student.models import UserProfile
+from common.djangoapps.student.models import UserProfile
SITES = ["site_a", "site_b"]
MANAGEMENT_COMMAND_PATH = "openedx.core.djangoapps.theming.management.commands.create_sites_and_configurations."
diff --git a/openedx/core/djangoapps/theming/template_loaders.py b/openedx/core/djangoapps/theming/template_loaders.py
index 87991682fa..803b2d27d5 100644
--- a/openedx/core/djangoapps/theming/template_loaders.py
+++ b/openedx/core/djangoapps/theming/template_loaders.py
@@ -5,7 +5,7 @@ Theming aware template loaders.
from django.template.loaders.filesystem import Loader as FilesystemLoader
-from edxmako.makoloader import MakoLoader
+from common.djangoapps.edxmako.makoloader import MakoLoader
from openedx.core.djangoapps.theming.helpers import get_all_theme_template_dirs, get_current_request, get_current_theme
diff --git a/openedx/core/djangoapps/theming/tests/test_middleware.py b/openedx/core/djangoapps/theming/tests/test_middleware.py
index 1084ca942c..97eff107b1 100644
--- a/openedx/core/djangoapps/theming/tests/test_middleware.py
+++ b/openedx/core/djangoapps/theming/tests/test_middleware.py
@@ -8,7 +8,7 @@ from django.contrib.sites.models import Site
from django.test import RequestFactory, TestCase, override_settings
from openedx.core.djangoapps.theming.middleware import CurrentSiteThemeMiddleware
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from ..views import set_user_preview_site_theme
diff --git a/openedx/core/djangoapps/theming/tests/test_theme_style_overrides.py b/openedx/core/djangoapps/theming/tests/test_theme_style_overrides.py
index 117fa438e9..eb5a8839c2 100644
--- a/openedx/core/djangoapps/theming/tests/test_theme_style_overrides.py
+++ b/openedx/core/djangoapps/theming/tests/test_theme_style_overrides.py
@@ -10,7 +10,7 @@ from django.urls import reverse
from openedx.core.djangoapps.theming.tests.test_util import with_comprehensive_theme
from openedx.core.djangolib.testing.utils import skip_unless_cms, skip_unless_lms
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
@skip_unless_lms
diff --git a/openedx/core/djangoapps/theming/tests/test_util.py b/openedx/core/djangoapps/theming/tests/test_util.py
index 8c61eab160..001827ecb4 100644
--- a/openedx/core/djangoapps/theming/tests/test_util.py
+++ b/openedx/core/djangoapps/theming/tests/test_util.py
@@ -13,7 +13,7 @@ from django.conf import settings
from django.contrib.sites.models import Site
from mock import patch
-import edxmako
+from common.djangoapps import edxmako
from openedx.core.djangoapps.theming.models import SiteTheme
diff --git a/openedx/core/djangoapps/theming/tests/test_views.py b/openedx/core/djangoapps/theming/tests/test_views.py
index 48f885c405..89af8f2c1b 100644
--- a/openedx/core/djangoapps/theming/tests/test_views.py
+++ b/openedx/core/djangoapps/theming/tests/test_views.py
@@ -10,7 +10,7 @@ from django.test import TestCase
from lms.djangoapps.courseware.tests.factories import GlobalStaffFactory
from openedx.core.djangoapps.theming.middleware import CurrentSiteThemeMiddleware
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
THEMING_ADMIN_URL = '/theming/admin'
TEST_THEME_NAME = 'test-theme'
diff --git a/openedx/core/djangoapps/theming/views.py b/openedx/core/djangoapps/theming/views.py
index f9cd0af0bf..af7c4e6dda 100644
--- a/openedx/core/djangoapps/theming/views.py
+++ b/openedx/core/djangoapps/theming/views.py
@@ -19,7 +19,7 @@ from openedx.core.djangoapps.user_api.preferences.api import (
set_user_preference
)
from openedx.core.djangoapps.util.user_messages import PageLevelMessages
-from student.roles import GlobalStaff
+from common.djangoapps.student.roles import GlobalStaff
from .helpers import theme_exists
from .models import SiteTheme
diff --git a/openedx/core/djangoapps/user_api/accounts/api.py b/openedx/core/djangoapps/user_api/accounts/api.py
index 62d341c8a6..276f16e4f2 100644
--- a/openedx/core/djangoapps/user_api/accounts/api.py
+++ b/openedx/core/djangoapps/user_api/accounts/api.py
@@ -15,16 +15,16 @@ from django.utils.translation import override as override_language
from django.utils.translation import ugettext as _
from pytz import UTC
from six import text_type # pylint: disable=ungrouped-imports
-from student import views as student_views
-from student.models import (
+from common.djangoapps.student import views as student_views
+from common.djangoapps.student.models import (
AccountRecovery,
User,
UserProfile,
email_exists_or_retired,
username_exists_or_retired
)
-from util.model_utils import emit_setting_changed_event
-from util.password_policy_validators import validate_password
+from common.djangoapps.util.model_utils import emit_setting_changed_event
+from common.djangoapps.util.password_policy_validators import validate_password
from openedx.core.djangoapps.user_api import accounts, errors, helpers
from openedx.core.djangoapps.user_api.errors import (
diff --git a/openedx/core/djangoapps/user_api/accounts/image_helpers.py b/openedx/core/djangoapps/user_api/accounts/image_helpers.py
index 40128af60a..a21fa88fd8 100644
--- a/openedx/core/djangoapps/user_api/accounts/image_helpers.py
+++ b/openedx/core/djangoapps/user_api/accounts/image_helpers.py
@@ -11,7 +11,7 @@ from django.core.exceptions import ObjectDoesNotExist
from django.core.files.storage import get_storage_class
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
-from student.models import UserProfile
+from common.djangoapps.student.models import UserProfile
from ..errors import UserNotFound
diff --git a/openedx/core/djangoapps/user_api/accounts/serializers.py b/openedx/core/djangoapps/user_api/accounts/serializers.py
index bdf7cd8aeb..390e16bf8b 100644
--- a/openedx/core/djangoapps/user_api/accounts/serializers.py
+++ b/openedx/core/djangoapps/user_api/accounts/serializers.py
@@ -14,14 +14,14 @@ from django.urls import reverse
from rest_framework import serializers
from six import text_type
-from student.models import UserPasswordToggleHistory
+from common.djangoapps.student.models import UserPasswordToggleHistory
from lms.djangoapps.badges.utils import badges_enabled
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
from openedx.core.djangoapps.user_api import errors
from openedx.core.djangoapps.user_api.accounts.utils import is_secondary_email_feature_enabled
from openedx.core.djangoapps.user_api.models import RetirementState, UserPreference, UserRetirementStatus
from openedx.core.djangoapps.user_api.serializers import ReadOnlyFieldsSerializerMixin
-from student.models import LanguageProficiency, SocialLink, UserProfile
+from common.djangoapps.student.models import LanguageProficiency, SocialLink, UserProfile
from . import (
ACCOUNT_VISIBILITY_PREF_KEY,
diff --git a/openedx/core/djangoapps/user_api/accounts/settings_views.py b/openedx/core/djangoapps/user_api/accounts/settings_views.py
index f40a0da71f..fa1b30d9cf 100644
--- a/openedx/core/djangoapps/user_api/accounts/settings_views.py
+++ b/openedx/core/djangoapps/user_api/accounts/settings_views.py
@@ -14,8 +14,8 @@ from django.utils.translation import ugettext as _
from django.views.decorators.http import require_http_methods
from django_countries import countries
-import third_party_auth
-from edxmako.shortcuts import render_to_response
+from common.djangoapps import third_party_auth
+from common.djangoapps.edxmako.shortcuts import render_to_response
from lms.djangoapps.commerce.models import CommerceConfiguration
from lms.djangoapps.commerce.utils import EcommerceService
from openedx.core.djangoapps.commerce.utils import ecommerce_api_client
@@ -32,9 +32,9 @@ from openedx.core.lib.edx_api_utils import get_edx_api_data
from openedx.core.lib.time_zone_utils import TIME_ZONE_CHOICES
from openedx.features.enterprise_support.api import enterprise_customer_for_request
from openedx.features.enterprise_support.utils import update_account_settings_context_for_enterprise
-from student.models import UserProfile
-from third_party_auth import pipeline
-from util.date_utils import strftime_localized
+from common.djangoapps.student.models import UserProfile
+from common.djangoapps.third_party_auth import pipeline
+from common.djangoapps.util.date_utils import strftime_localized
log = logging.getLogger(__name__)
diff --git a/openedx/core/djangoapps/user_api/accounts/tests/retirement_helpers.py b/openedx/core/djangoapps/user_api/accounts/tests/retirement_helpers.py
index 7d20969953..9dab0717b1 100644
--- a/openedx/core/djangoapps/user_api/accounts/tests/retirement_helpers.py
+++ b/openedx/core/djangoapps/user_api/accounts/tests/retirement_helpers.py
@@ -12,8 +12,8 @@ from social_django.models import UserSocialAuth
from openedx.core.djangoapps.enrollments import api
from openedx.core.djangoapps.user_api.models import RetirementState, UserRetirementStatus
-from student.models import get_retired_email_by_email, get_retired_username_by_username
-from student.tests.factories import UserFactory
+from common.djangoapps.student.models import get_retired_email_by_email, get_retired_username_by_username
+from common.djangoapps.student.tests.factories import UserFactory
from ..views import AccountRetirementView
diff --git a/openedx/core/djangoapps/user_api/accounts/tests/test_api.py b/openedx/core/djangoapps/user_api/accounts/tests/test_api.py
index f0eac87b1c..bc3f1789d5 100644
--- a/openedx/core/djangoapps/user_api/accounts/tests/test_api.py
+++ b/openedx/core/djangoapps/user_api/accounts/tests/test_api.py
@@ -19,15 +19,15 @@ from django.urls import reverse
from mock import Mock, patch
from six import iteritems
from social_django.models import UserSocialAuth
-from student.models import (
+from common.djangoapps.student.models import (
AccountRecovery,
PendingEmailChange,
PendingSecondaryEmailChange,
UserProfile
)
-from student.tests.factories import UserFactory
-from student.tests.tests import UserSettingsEventTestMixin
-from student.views.management import activate_secondary_email
+from common.djangoapps.student.tests.factories import UserFactory
+from common.djangoapps.student.tests.tests import UserSettingsEventTestMixin
+from common.djangoapps.student.views.management import activate_secondary_email
from openedx.core.djangoapps.ace_common.tests.mixins import EmailTemplateTagMixin
from openedx.core.djangoapps.user_api.accounts import PRIVATE_VISIBILITY
@@ -80,7 +80,7 @@ class CreateAccountMixin(object):
@skip_unless_lms
@ddt.ddt
-@patch('student.views.management.render_to_response', Mock(side_effect=mock_render_to_response, autospec=True))
+@patch('common.djangoapps.student.views.management.render_to_response', Mock(side_effect=mock_render_to_response, autospec=True))
class TestAccountApi(UserSettingsEventTestMixin, EmailTemplateTagMixin, CreateAccountMixin, RetirementTestCase):
"""
These tests specifically cover the parts of the API methods that are not covered by test_views.py.
@@ -366,7 +366,7 @@ class TestAccountApi(UserSettingsEventTestMixin, EmailTemplateTagMixin, CreateAc
self.assertIn("Full Name cannot contain the following characters: < >", field_errors["name"]["user_message"])
@patch('django.core.mail.EmailMultiAlternatives.send')
- @patch('student.views.management.render_to_string', Mock(side_effect=mock_render_to_string, autospec=True))
+ @patch('common.djangoapps.student.views.management.render_to_string', Mock(side_effect=mock_render_to_string, autospec=True))
def test_update_sending_email_fails(self, send_mail):
"""Test what happens if all validation checks pass, but sending the email for email change fails."""
send_mail.side_effect = [Exception, None]
diff --git a/openedx/core/djangoapps/user_api/accounts/tests/test_image_helpers.py b/openedx/core/djangoapps/user_api/accounts/tests/test_image_helpers.py
index fb9b6715b0..5d42a89547 100644
--- a/openedx/core/djangoapps/user_api/accounts/tests/test_image_helpers.py
+++ b/openedx/core/djangoapps/user_api/accounts/tests/test_image_helpers.py
@@ -11,7 +11,7 @@ from mock import patch
from pytz import UTC
from openedx.core.djangolib.testing.utils import skip_unless_lms
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from six import text_type
from ..image_helpers import get_profile_image_urls_for_user
diff --git a/openedx/core/djangoapps/user_api/accounts/tests/test_models.py b/openedx/core/djangoapps/user_api/accounts/tests/test_models.py
index b64abff7d5..c216a0ac55 100644
--- a/openedx/core/djangoapps/user_api/accounts/tests/test_models.py
+++ b/openedx/core/djangoapps/user_api/accounts/tests/test_models.py
@@ -11,8 +11,8 @@ from openedx.core.djangoapps.user_api.models import (
UserRetirementRequest,
UserRetirementStatus
)
-from student.models import get_retired_email_by_email, get_retired_username_by_username
-from student.tests.factories import UserFactory
+from common.djangoapps.student.models import get_retired_email_by_email, get_retired_username_by_username
+from common.djangoapps.student.tests.factories import UserFactory
from .retirement_helpers import setup_retirement_states # pylint: disable=unused-import
diff --git a/openedx/core/djangoapps/user_api/accounts/tests/test_permissions.py b/openedx/core/djangoapps/user_api/accounts/tests/test_permissions.py
index 16cc0e8a60..44d6cf2bf7 100644
--- a/openedx/core/djangoapps/user_api/accounts/tests/test_permissions.py
+++ b/openedx/core/djangoapps/user_api/accounts/tests/test_permissions.py
@@ -6,7 +6,7 @@ Tests for User deactivation API permissions
from django.test import RequestFactory, TestCase
from openedx.core.djangoapps.user_api.accounts.permissions import CanDeactivateUser, CanRetireUser
-from student.tests.factories import ContentTypeFactory, PermissionFactory, SuperuserFactory, UserFactory
+from common.djangoapps.student.tests.factories import ContentTypeFactory, PermissionFactory, SuperuserFactory, UserFactory
class CanDeactivateUserTest(TestCase):
diff --git a/openedx/core/djangoapps/user_api/accounts/tests/test_retirement_views.py b/openedx/core/djangoapps/user_api/accounts/tests/test_retirement_views.py
index ab44772a3b..88e557fd5e 100644
--- a/openedx/core/djangoapps/user_api/accounts/tests/test_retirement_views.py
+++ b/openedx/core/djangoapps/user_api/accounts/tests/test_retirement_views.py
@@ -35,8 +35,8 @@ from social_django.models import UserSocialAuth
from wiki.models import Article, ArticleRevision
from wiki.models.pluginbase import RevisionPlugin, RevisionPluginRevision
-from entitlements.models import CourseEntitlementSupportDetail
-from entitlements.tests.factories import CourseEntitlementFactory
+from common.djangoapps.entitlements.models import CourseEntitlementSupportDetail
+from common.djangoapps.entitlements.tests.factories import CourseEntitlementFactory
from openedx.core.djangoapps.api_admin.models import ApiAccessRequest
from openedx.core.djangoapps.course_groups.models import CourseUserGroup, UnregisteredLearnerCohortAssignments
from openedx.core.djangoapps.credit.models import (
@@ -56,7 +56,7 @@ from openedx.core.djangoapps.user_api.models import (
UserRetirementPartnerReportingStatus,
UserRetirementStatus
)
-from student.models import (
+from common.djangoapps.student.models import (
AccountRecovery,
CourseEnrollment,
CourseEnrollmentAllowed,
@@ -69,7 +69,7 @@ from student.models import (
get_retired_email_by_email,
get_retired_username_by_username
)
-from student.tests.factories import (
+from common.djangoapps.student.tests.factories import (
AccountRecoveryFactory,
ContentTypeFactory,
CourseEnrollmentAllowedFactory,
diff --git a/openedx/core/djangoapps/user_api/accounts/tests/test_serializers.py b/openedx/core/djangoapps/user_api/accounts/tests/test_serializers.py
index bdd0913582..72b69b99ed 100644
--- a/openedx/core/djangoapps/user_api/accounts/tests/test_serializers.py
+++ b/openedx/core/djangoapps/user_api/accounts/tests/test_serializers.py
@@ -10,8 +10,8 @@ from django.test.client import RequestFactory
from testfixtures import LogCapture
from openedx.core.djangoapps.user_api.accounts.serializers import UserReadOnlySerializer
-from student.models import UserProfile
-from student.tests.factories import UserFactory
+from common.djangoapps.student.models import UserProfile
+from common.djangoapps.student.tests.factories import UserFactory
LOGGER_NAME = "openedx.core.djangoapps.user_api.accounts.serializers"
diff --git a/openedx/core/djangoapps/user_api/accounts/tests/test_settings_views.py b/openedx/core/djangoapps/user_api/accounts/tests/test_settings_views.py
index f1778123cf..840028988c 100644
--- a/openedx/core/djangoapps/user_api/accounts/tests/test_settings_views.py
+++ b/openedx/core/djangoapps/user_api/accounts/tests/test_settings_views.py
@@ -26,8 +26,8 @@ from openedx.core.djangoapps.user_api.accounts.toggles import REDIRECT_TO_ACCOUN
from openedx.core.djangoapps.user_api.tests.factories import UserPreferenceFactory
from openedx.core.djangolib.testing.utils import skip_unless_lms
from openedx.features.enterprise_support.utils import get_enterprise_readonly_account_fields
-from student.tests.factories import UserFactory
-from third_party_auth.tests.testutil import ThirdPartyAuthTestMixin
+from common.djangoapps.student.tests.factories import UserFactory
+from common.djangoapps.third_party_auth.tests.testutil import ThirdPartyAuthTestMixin
@skip_unless_lms
diff --git a/openedx/core/djangoapps/user_api/accounts/tests/test_utils.py b/openedx/core/djangoapps/user_api/accounts/tests/test_utils.py
index 79432fd45a..b1e7d73a61 100644
--- a/openedx/core/djangoapps/user_api/accounts/tests/test_utils.py
+++ b/openedx/core/djangoapps/user_api/accounts/tests/test_utils.py
@@ -9,8 +9,8 @@ from django.test.utils import override_settings
from openedx.core.djangoapps.user_api.accounts.utils import retrieve_last_sitewide_block_completed
from openedx.core.djangolib.testing.utils import skip_unless_lms
-from student.models import CourseEnrollment
-from student.tests.factories import UserFactory
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
diff --git a/openedx/core/djangoapps/user_api/accounts/tests/test_views.py b/openedx/core/djangoapps/user_api/accounts/tests/test_views.py
index 0d6849d07d..f789f1eea7 100644
--- a/openedx/core/djangoapps/user_api/accounts/tests/test_views.py
+++ b/openedx/core/djangoapps/user_api/accounts/tests/test_views.py
@@ -25,8 +25,8 @@ from openedx.core.djangoapps.user_api.accounts import ACCOUNT_VISIBILITY_PREF_KE
from openedx.core.djangoapps.user_api.models import UserPreference
from openedx.core.djangoapps.user_api.preferences.api import set_user_preference
from openedx.core.djangolib.testing.utils import CacheIsolationTestCase, skip_unless_lms
-from student.models import PendingEmailChange, UserProfile
-from student.tests.factories import TEST_PASSWORD, UserFactory
+from common.djangoapps.student.models import PendingEmailChange, UserProfile
+from common.djangoapps.student.tests.factories import TEST_PASSWORD, UserFactory
from .. import ALL_USERS_VISIBILITY, CUSTOM_VISIBILITY, PRIVATE_VISIBILITY
@@ -792,7 +792,7 @@ class TestAccountsAPI(CacheIsolationTestCase, UserAPITestCase):
)
self.assertEqual("Valid e-mail address required.", field_errors["email"]["user_message"])
- @mock.patch('student.views.management.do_email_change_request')
+ @mock.patch('common.djangoapps.student.views.management.do_email_change_request')
def test_patch_duplicate_email(self, do_email_change_request):
"""
Test that same success response will be sent to user even if the given email already used.
@@ -950,7 +950,7 @@ class TestAccountAPITransactions(TransactionTestCase):
self.user = UserFactory.create(password=TEST_PASSWORD)
self.url = reverse("accounts_api", kwargs={'username': self.user.username})
- @mock.patch('student.views.do_email_change_request')
+ @mock.patch('common.djangoapps.student.views.do_email_change_request')
def test_update_account_settings_rollback(self, mock_email_change):
"""
Verify that updating account settings is transactional when a failure happens.
diff --git a/openedx/core/djangoapps/user_api/accounts/tests/testutils.py b/openedx/core/djangoapps/user_api/accounts/tests/testutils.py
index dad9eb76e1..ad04da509f 100644
--- a/openedx/core/djangoapps/user_api/accounts/tests/testutils.py
+++ b/openedx/core/djangoapps/user_api/accounts/tests/testutils.py
@@ -5,7 +5,7 @@ Utility functions, constants, etc. for testing.
from openedx.core.djangoapps.user_api.accounts import EMAIL_MAX_LENGTH, USERNAME_MAX_LENGTH, USERNAME_MIN_LENGTH
-from util.password_policy_validators import DEFAULT_MAX_PASSWORD_LENGTH
+from common.djangoapps.util.password_policy_validators import DEFAULT_MAX_PASSWORD_LENGTH
INVALID_NAMES = [
None,
diff --git a/openedx/core/djangoapps/user_api/accounts/views.py b/openedx/core/djangoapps/user_api/accounts/views.py
index 0719ebe217..27ea1bdc1f 100644
--- a/openedx/core/djangoapps/user_api/accounts/views.py
+++ b/openedx/core/djangoapps/user_api/accounts/views.py
@@ -39,7 +39,7 @@ from social_django.models import UserSocialAuth
from wiki.models import ArticleRevision
from wiki.models.pluginbase import RevisionPluginRevision
-from entitlements.models import CourseEntitlement
+from common.djangoapps.entitlements.models import CourseEntitlement
from openedx.core.djangoapps.ace_common.template_context import get_base_template_context
from openedx.core.djangoapps.api_admin.models import ApiAccessRequest
from openedx.core.djangoapps.course_groups.models import UnregisteredLearnerCohortAssignments
@@ -52,7 +52,7 @@ from openedx.core.djangoapps.user_authn.exceptions import AuthFailedError
from openedx.core.djangolib.oauth2_retirement_utils import retire_dot_oauth2_models
from openedx.core.lib.api.authentication import BearerAuthenticationAllowInactiveUser
from openedx.core.lib.api.parsers import MergePatchParser
-from student.models import (
+from common.djangoapps.student.models import (
AccountRecovery,
CourseEnrollment,
CourseEnrollmentAllowed,
diff --git a/openedx/core/djangoapps/user_api/course_tag/tests/test_api.py b/openedx/core/djangoapps/user_api/course_tag/tests/test_api.py
index cd115cd8fe..37496fa620 100644
--- a/openedx/core/djangoapps/user_api/course_tag/tests/test_api.py
+++ b/openedx/core/djangoapps/user_api/course_tag/tests/test_api.py
@@ -7,7 +7,7 @@ from django.test import TestCase
from opaque_keys.edx.locator import CourseLocator
from openedx.core.djangoapps.user_api.course_tag import api as course_tag_api
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
class TestCourseTagAPI(TestCase):
diff --git a/openedx/core/djangoapps/user_api/management/commands/create_user_gdpr_testing.py b/openedx/core/djangoapps/user_api/management/commands/create_user_gdpr_testing.py
index a038b1f245..b7529633b9 100644
--- a/openedx/core/djangoapps/user_api/management/commands/create_user_gdpr_testing.py
+++ b/openedx/core/djangoapps/user_api/management/commands/create_user_gdpr_testing.py
@@ -22,12 +22,12 @@ from integrated_channels.sap_success_factors.models import SapSuccessFactorsLear
from opaque_keys.edx.keys import CourseKey
from pytz import UTC
-from entitlements.models import CourseEntitlement, CourseEntitlementSupportDetail
+from common.djangoapps.entitlements.models import CourseEntitlement, CourseEntitlementSupportDetail
from lms.djangoapps.verify_student.models import SoftwareSecurePhotoVerification
from openedx.core.djangoapps.course_groups.models import CourseUserGroup, UnregisteredLearnerCohortAssignments
from openedx.core.djangoapps.profile_images.images import create_profile_images
from openedx.core.djangoapps.profile_images.tests.helpers import make_image_file
-from student.models import CourseEnrollment, CourseEnrollmentAllowed, PendingEmailChange, UserProfile
+from common.djangoapps.student.models import CourseEnrollment, CourseEnrollmentAllowed, PendingEmailChange, UserProfile
from ...models import UserOrgTag
diff --git a/openedx/core/djangoapps/user_api/management/commands/retire_user.py b/openedx/core/djangoapps/user_api/management/commands/retire_user.py
index 7851cf1af6..7fc084e074 100644
--- a/openedx/core/djangoapps/user_api/management/commands/retire_user.py
+++ b/openedx/core/djangoapps/user_api/management/commands/retire_user.py
@@ -6,7 +6,7 @@ from django.core.management.base import BaseCommand, CommandError
from django.db import transaction
from social_django.models import UserSocialAuth
-from student.models import AccountRecovery, Registration, get_retired_email_by_email
+from common.djangoapps.student.models import AccountRecovery, Registration, get_retired_email_by_email
from openedx.core.djangolib.oauth2_retirement_utils import retire_dot_oauth2_models
from ...models import UserRetirementStatus
diff --git a/openedx/core/djangoapps/user_api/management/commands/sync_hubspot_contacts.py b/openedx/core/djangoapps/user_api/management/commands/sync_hubspot_contacts.py
index 7dcb7bd47b..6cf8802893 100644
--- a/openedx/core/djangoapps/user_api/management/commands/sync_hubspot_contacts.py
+++ b/openedx/core/djangoapps/user_api/management/commands/sync_hubspot_contacts.py
@@ -18,8 +18,8 @@ from edx_rest_api_client.client import EdxRestApiClient
from slumber.exceptions import HttpClientError, HttpServerError
from openedx.core.djangoapps.site_configuration.models import SiteConfiguration
-from student.models import UserAttribute
-from util.query import use_read_replica_if_available
+from common.djangoapps.student.models import UserAttribute
+from common.djangoapps.util.query import use_read_replica_if_available
HUBSPOT_API_BASE_URL = 'https://api.hubapi.com'
diff --git a/openedx/core/djangoapps/user_api/management/tests/test_cancel_retirement.py b/openedx/core/djangoapps/user_api/management/tests/test_cancel_retirement.py
index b55da7368e..61fe608b00 100644
--- a/openedx/core/djangoapps/user_api/management/tests/test_cancel_retirement.py
+++ b/openedx/core/djangoapps/user_api/management/tests/test_cancel_retirement.py
@@ -13,7 +13,7 @@ from openedx.core.djangoapps.user_api.accounts.tests.retirement_helpers import (
setup_retirement_states
)
from openedx.core.djangoapps.user_api.models import RetirementState, UserRetirementRequest, UserRetirementStatus
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
pytestmark = pytest.mark.django_db
diff --git a/openedx/core/djangoapps/user_api/management/tests/test_email_opt_in_list.py b/openedx/core/djangoapps/user_api/management/tests/test_email_opt_in_list.py
index 98597af576..6fae0b2f90 100644
--- a/openedx/core/djangoapps/user_api/management/tests/test_email_opt_in_list.py
+++ b/openedx/core/djangoapps/user_api/management/tests/test_email_opt_in_list.py
@@ -20,8 +20,8 @@ from openedx.core.djangoapps.user_api.management.commands import email_opt_in_li
from openedx.core.djangoapps.user_api.models import UserOrgTag
from openedx.core.djangoapps.user_api.preferences.api import update_email_opt_in
from openedx.core.djangolib.testing.utils import skip_unless_lms
-from student.models import CourseEnrollment
-from student.tests.factories import CourseEnrollmentFactory, UserFactory
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory, UserFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/openedx/core/djangoapps/user_api/management/tests/test_populate_retirement_states.py b/openedx/core/djangoapps/user_api/management/tests/test_populate_retirement_states.py
index 94d3eba39a..0944ec8234 100644
--- a/openedx/core/djangoapps/user_api/management/tests/test_populate_retirement_states.py
+++ b/openedx/core/djangoapps/user_api/management/tests/test_populate_retirement_states.py
@@ -10,7 +10,7 @@ from django.core.management import CommandError, call_command
from openedx.core.djangoapps.user_api.management.commands.populate_retirement_states import START_STATE
from openedx.core.djangoapps.user_api.models import RetirementState, UserRetirementStatus
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
pytestmark = pytest.mark.django_db
diff --git a/openedx/core/djangoapps/user_api/management/tests/test_retire_user.py b/openedx/core/djangoapps/user_api/management/tests/test_retire_user.py
index 46e5dcfc39..4c0a37108a 100644
--- a/openedx/core/djangoapps/user_api/management/tests/test_retire_user.py
+++ b/openedx/core/djangoapps/user_api/management/tests/test_retire_user.py
@@ -12,7 +12,7 @@ from openedx.core.djangoapps.user_api.accounts.tests.retirement_helpers import (
setup_retirement_states
)
from openedx.core.djangolib.testing.utils import skip_unless_lms
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
pytestmark = pytest.mark.django_db
diff --git a/openedx/core/djangoapps/user_api/management/tests/test_sync_hubspot_contacts.py b/openedx/core/djangoapps/user_api/management/tests/test_sync_hubspot_contacts.py
index 2a966f48c9..01359e6630 100644
--- a/openedx/core/djangoapps/user_api/management/tests/test_sync_hubspot_contacts.py
+++ b/openedx/core/djangoapps/user_api/management/tests/test_sync_hubspot_contacts.py
@@ -16,8 +16,8 @@ from six.moves import range
from openedx.core.djangoapps.site_configuration.tests.factories import SiteConfigurationFactory
from openedx.core.djangoapps.user_api.management.commands.sync_hubspot_contacts import Command as sync_command
from openedx.core.djangolib.testing.utils import skip_unless_lms
-from student.models import UserAttribute, UserProfile
-from student.tests.factories import UserFactory
+from common.djangoapps.student.models import UserAttribute, UserProfile
+from common.djangoapps.student.tests.factories import UserFactory
@skip_unless_lms
diff --git a/openedx/core/djangoapps/user_api/middleware.py b/openedx/core/djangoapps/user_api/middleware.py
index 927ee7dc7d..95bb3d568d 100644
--- a/openedx/core/djangoapps/user_api/middleware.py
+++ b/openedx/core/djangoapps/user_api/middleware.py
@@ -9,7 +9,7 @@ from eventtracking import tracker
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
-from track.contexts import COURSE_REGEX
+from common.djangoapps.track.contexts import COURSE_REGEX
from .models import UserCourseTag
diff --git a/openedx/core/djangoapps/user_api/models.py b/openedx/core/djangoapps/user_api/models.py
index 673a6e7db0..ca2e28f7c8 100644
--- a/openedx/core/djangoapps/user_api/models.py
+++ b/openedx/core/djangoapps/user_api/models.py
@@ -22,14 +22,14 @@ from opaque_keys.edx.django.models import CourseKeyField
from openedx.core.djangolib.model_mixins import DeletableByUserValue
from openedx.core.lib.cache_utils import request_cached
# pylint: disable=unused-import
-from student.models import (
+from common.djangoapps.student.models import (
PendingEmailChange,
Registration,
UserProfile,
get_retired_email_by_email,
get_retired_username_by_username
)
-from util.model_utils import emit_setting_changed_event, get_changed_fields_dict
+from common.djangoapps.util.model_utils import emit_setting_changed_event, get_changed_fields_dict
class RetirementStateError(Exception):
diff --git a/openedx/core/djangoapps/user_api/preferences/api.py b/openedx/core/djangoapps/user_api/preferences/api.py
index 3b3915a0f4..c52b198b31 100644
--- a/openedx/core/djangoapps/user_api/preferences/api.py
+++ b/openedx/core/djangoapps/user_api/preferences/api.py
@@ -15,8 +15,8 @@ from django_countries import countries
from pytz import common_timezones, common_timezones_set, country_timezones
from openedx.core.lib.time_zone_utils import get_display_time_zone
-from student.models import User, UserProfile
-from track import segment
+from common.djangoapps.student.models import User, UserProfile
+from common.djangoapps.track import segment
from ..errors import (
CountryCodeError,
diff --git a/openedx/core/djangoapps/user_api/preferences/tests/test_api.py b/openedx/core/djangoapps/user_api/preferences/tests/test_api.py
index 2ed1de98b5..942d5eb486 100644
--- a/openedx/core/djangoapps/user_api/preferences/tests/test_api.py
+++ b/openedx/core/djangoapps/user_api/preferences/tests/test_api.py
@@ -16,8 +16,8 @@ from pytz import common_timezones, utc
from openedx.core.djangolib.testing.utils import CacheIsolationTestCase, skip_unless_lms
from openedx.core.lib.time_zone_utils import get_display_time_zone
-from student.models import UserProfile
-from student.tests.factories import UserFactory
+from common.djangoapps.student.models import UserProfile
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/openedx/core/djangoapps/user_api/preferences/tests/test_views.py b/openedx/core/djangoapps/user_api/preferences/tests/test_views.py
index 33b6ceb750..19bd64665b 100644
--- a/openedx/core/djangoapps/user_api/preferences/tests/test_views.py
+++ b/openedx/core/djangoapps/user_api/preferences/tests/test_views.py
@@ -14,7 +14,7 @@ from mock import patch
from rest_framework.test import APIClient
from openedx.core.djangolib.testing.utils import skip_unless_lms
-from student.tests.factories import TEST_PASSWORD, UserFactory
+from common.djangoapps.student.tests.factories import TEST_PASSWORD, UserFactory
from ...accounts.tests.test_views import UserAPITestCase
from ..api import set_user_preference
diff --git a/openedx/core/djangoapps/user_api/tests/factories.py b/openedx/core/djangoapps/user_api/tests/factories.py
index b1413bd215..ff8a18fa13 100644
--- a/openedx/core/djangoapps/user_api/tests/factories.py
+++ b/openedx/core/djangoapps/user_api/tests/factories.py
@@ -5,7 +5,7 @@ from factory import SubFactory
from factory.django import DjangoModelFactory
from opaque_keys.edx.locator import CourseLocator
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from ..models import UserCourseTag, UserOrgTag, UserPreference
diff --git a/openedx/core/djangoapps/user_api/tests/test_middleware.py b/openedx/core/djangoapps/user_api/tests/test_middleware.py
index 55c578e260..70fe3bb069 100644
--- a/openedx/core/djangoapps/user_api/tests/test_middleware.py
+++ b/openedx/core/djangoapps/user_api/tests/test_middleware.py
@@ -6,7 +6,7 @@ from django.test import TestCase
from django.test.client import RequestFactory
from mock import Mock, patch
-from student.tests.factories import AnonymousUserFactory, UserFactory
+from common.djangoapps.student.tests.factories import AnonymousUserFactory, UserFactory
from ..middleware import UserTagsEventContextMiddleware
from ..tests.factories import UserCourseTagFactory
diff --git a/openedx/core/djangoapps/user_api/tests/test_models.py b/openedx/core/djangoapps/user_api/tests/test_models.py
index 361ce05700..4206647d6d 100644
--- a/openedx/core/djangoapps/user_api/tests/test_models.py
+++ b/openedx/core/djangoapps/user_api/tests/test_models.py
@@ -6,8 +6,8 @@ Test UserPreferenceModel and UserPreference events
from django.db import IntegrityError
from django.test import TestCase
-from student.tests.factories import UserFactory
-from student.tests.tests import UserSettingsEventTestMixin
+from common.djangoapps.student.tests.factories import UserFactory
+from common.djangoapps.student.tests.tests import UserSettingsEventTestMixin
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/openedx/core/djangoapps/user_api/tests/test_partition_schemes.py b/openedx/core/djangoapps/user_api/tests/test_partition_schemes.py
index 8098f92a53..1b45831687 100644
--- a/openedx/core/djangoapps/user_api/tests/test_partition_schemes.py
+++ b/openedx/core/djangoapps/user_api/tests/test_partition_schemes.py
@@ -11,7 +11,7 @@ from mock import patch
from six.moves import range
from openedx.core.djangoapps.user_api.partition_schemes import RandomUserPartitionScheme, UserPartitionError
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.partitions.partitions import Group, UserPartition
from xmodule.partitions.tests.test_partitions import PartitionTestCase
diff --git a/openedx/core/djangoapps/user_api/tests/test_views.py b/openedx/core/djangoapps/user_api/tests/test_views.py
index 7e95cf803b..b1eee633f4 100644
--- a/openedx/core/djangoapps/user_api/tests/test_views.py
+++ b/openedx/core/djangoapps/user_api/tests/test_views.py
@@ -27,14 +27,14 @@ from openedx.core.djangoapps.site_configuration.tests.test_util import with_site
from openedx.core.djangolib.testing.utils import CacheIsolationTestCase, skip_unless_lms
from openedx.core.lib.api.test_utils import TEST_API_KEY, ApiTestCase
from openedx.core.lib.time_zone_utils import get_display_time_zone
-from student.tests.factories import UserFactory
-from third_party_auth.tests.testutil import ThirdPartyAuthTestMixin, simulate_running_pipeline
-from third_party_auth.tests.utils import (
+from common.djangoapps.student.tests.factories import UserFactory
+from common.djangoapps.third_party_auth.tests.testutil import ThirdPartyAuthTestMixin, simulate_running_pipeline
+from common.djangoapps.third_party_auth.tests.utils import (
ThirdPartyOAuthTestMixin,
ThirdPartyOAuthTestMixinFacebook,
ThirdPartyOAuthTestMixinGoogle
)
-from util.password_policy_validators import (
+from common.djangoapps.util.password_policy_validators import (
create_validator_config,
password_validators_instruction_texts,
password_validators_restrictions
diff --git a/openedx/core/djangoapps/user_api/verification_api/tests/test_views.py b/openedx/core/djangoapps/user_api/verification_api/tests/test_views.py
index 309d588a1d..93678ddea4 100644
--- a/openedx/core/djangoapps/user_api/verification_api/tests/test_views.py
+++ b/openedx/core/djangoapps/user_api/verification_api/tests/test_views.py
@@ -12,7 +12,7 @@ from django.urls import reverse
from lms.djangoapps.verify_student.models import ManualVerification, SoftwareSecurePhotoVerification, SSOVerification
from lms.djangoapps.verify_student.tests.factories import SSOVerificationFactory
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
FROZEN_TIME = '2015-01-01'
VERIFY_STUDENT = {'DAYS_GOOD_FOR': 365}
diff --git a/openedx/core/djangoapps/user_api/views.py b/openedx/core/djangoapps/user_api/views.py
index 37400f42f9..d00cd76917 100644
--- a/openedx/core/djangoapps/user_api/views.py
+++ b/openedx/core/djangoapps/user_api/views.py
@@ -30,8 +30,8 @@ from openedx.core.djangoapps.user_api.serializers import (
UserSerializer
)
from openedx.core.lib.api.permissions import ApiKeyHeaderPermission
-from student.helpers import AccountValidationError
-from util.json_request import JsonResponse
+from common.djangoapps.student.helpers import AccountValidationError
+from common.djangoapps.util.json_request import JsonResponse
class UserViewSet(viewsets.ReadOnlyModelViewSet):
diff --git a/openedx/core/djangoapps/user_authn/api/tests/test_views.py b/openedx/core/djangoapps/user_authn/api/tests/test_views.py
index 3634c1f063..12d18e3e63 100644
--- a/openedx/core/djangoapps/user_authn/api/tests/test_views.py
+++ b/openedx/core/djangoapps/user_authn/api/tests/test_views.py
@@ -9,8 +9,8 @@ from rest_framework.test import APITestCase
from six.moves.urllib.parse import urlencode
from openedx.core.djangolib.testing.utils import skip_unless_lms
-from third_party_auth import pipeline
-from third_party_auth.tests.testutil import ThirdPartyAuthTestMixin, simulate_running_pipeline
+from common.djangoapps.third_party_auth import pipeline
+from common.djangoapps.third_party_auth.tests.testutil import ThirdPartyAuthTestMixin, simulate_running_pipeline
@skip_unless_lms
diff --git a/openedx/core/djangoapps/user_authn/cookies.py b/openedx/core/djangoapps/user_authn/cookies.py
index 159084b7ee..8afb219042 100644
--- a/openedx/core/djangoapps/user_authn/cookies.py
+++ b/openedx/core/djangoapps/user_authn/cookies.py
@@ -22,7 +22,6 @@ from openedx.core.djangoapps.oauth_dispatch.api import create_dot_access_token
from openedx.core.djangoapps.oauth_dispatch.jwt import create_jwt_from_token
from openedx.core.djangoapps.user_api.accounts.utils import retrieve_last_sitewide_block_completed
from openedx.core.djangoapps.user_authn.exceptions import AuthFailedError
-from student.models import CourseEnrollment
log = logging.getLogger(__name__)
diff --git a/openedx/core/djangoapps/user_authn/tests/test_cookies.py b/openedx/core/djangoapps/user_authn/tests/test_cookies.py
index ed34799ed3..95f11d1241 100644
--- a/openedx/core/djangoapps/user_authn/tests/test_cookies.py
+++ b/openedx/core/djangoapps/user_authn/tests/test_cookies.py
@@ -14,8 +14,7 @@ from openedx.core.djangoapps.user_api.accounts.utils import retrieve_last_sitewi
from openedx.core.djangoapps.user_authn import cookies as cookies_api
from openedx.core.djangoapps.user_authn.tests.utils import setup_login_oauth_client
from openedx.core.djangolib.testing.utils import skip_unless_lms
-from student.models import CourseEnrollment
-from student.tests.factories import AnonymousUserFactory, UserFactory
+from common.djangoapps.student.tests.factories import AnonymousUserFactory, UserFactory
class CookieTests(TestCase):
diff --git a/openedx/core/djangoapps/user_authn/tests/utils.py b/openedx/core/djangoapps/user_authn/tests/utils.py
index d2f767e920..74aae437d9 100644
--- a/openedx/core/djangoapps/user_authn/tests/utils.py
+++ b/openedx/core/djangoapps/user_authn/tests/utils.py
@@ -13,7 +13,7 @@ from rest_framework import status
from openedx.core.djangoapps.oauth_dispatch.adapters.dot import DOTAdapter
from openedx.core.djangoapps.oauth_dispatch.jwt import _create_jwt
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
class AuthType(Enum):
diff --git a/openedx/core/djangoapps/user_authn/utils.py b/openedx/core/djangoapps/user_authn/utils.py
index cfc2f5846d..5a0e83062d 100644
--- a/openedx/core/djangoapps/user_authn/utils.py
+++ b/openedx/core/djangoapps/user_authn/utils.py
@@ -13,9 +13,9 @@ from django.utils.translation import ugettext as _
from oauth2_provider.models import Application
from six.moves.urllib.parse import urlparse # pylint: disable=import-error
-import third_party_auth
+from common.djangoapps import third_party_auth
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
-from third_party_auth import pipeline
+from common.djangoapps.third_party_auth import pipeline
def third_party_auth_context(request, redirect_to, tpa_hint=None):
diff --git a/openedx/core/djangoapps/user_authn/views/auto_auth.py b/openedx/core/djangoapps/user_authn/views/auto_auth.py
index 6e4a9a8bc3..11c7d258a2 100644
--- a/openedx/core/djangoapps/user_authn/views/auto_auth.py
+++ b/openedx/core/djangoapps/user_authn/views/auto_auth.py
@@ -21,13 +21,13 @@ from openedx.core.djangoapps.django_comment_common.models import assign_role
from openedx.core.djangoapps.user_authn.utils import generate_password
from openedx.core.djangoapps.user_authn.views.registration_form import AccountCreationForm
from openedx.features.course_experience import course_home_url_name
-from student.helpers import (
+from common.djangoapps.student.helpers import (
AccountValidationError,
authenticate_new_user,
create_or_set_user_attribute_created_on_site,
do_create_account
)
-from student.models import (
+from common.djangoapps.student.models import (
CourseAccessRole,
CourseEnrollment,
Registration,
@@ -35,7 +35,7 @@ from student.models import (
anonymous_id_for_user,
create_comments_service_user
)
-from util.json_request import JsonResponse
+from common.djangoapps.util.json_request import JsonResponse
def auto_auth(request): # pylint: disable=too-many-statements
diff --git a/openedx/core/djangoapps/user_authn/views/login.py b/openedx/core/djangoapps/user_authn/views/login.py
index 3c8ad24219..255265f763 100644
--- a/openedx/core/djangoapps/user_authn/views/login.py
+++ b/openedx/core/djangoapps/user_authn/views/login.py
@@ -28,7 +28,7 @@ from ratelimit.decorators import ratelimit
from ratelimitbackend.exceptions import RateLimitException
from rest_framework.views import APIView
-from edxmako.shortcuts import render_to_response
+from common.djangoapps.edxmako.shortcuts import render_to_response
from openedx.core.djangoapps.password_policy import compliance as password_policy_compliance
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
from openedx.core.djangoapps.user_authn.views.login_form import get_login_session_form
@@ -40,14 +40,14 @@ from openedx.core.djangoapps.user_authn.views.password_reset import send_passwor
from openedx.core.djangoapps.user_authn.config.waffle import ENABLE_LOGIN_USING_THIRDPARTY_AUTH_ONLY
from openedx.core.djangolib.markup import HTML, Text
from openedx.core.lib.api.view_utils import require_post_params
-from student.helpers import get_next_url_for_login_page
-from student.models import LoginFailures, AllowedAuthUser, UserProfile
-from student.views import compose_and_send_activation_email
-from third_party_auth import pipeline, provider
-import third_party_auth
-from track import segment
-from util.json_request import JsonResponse
-from util.password_policy_validators import normalize_password
+from common.djangoapps.student.helpers import get_next_url_for_login_page
+from common.djangoapps.student.models import LoginFailures, AllowedAuthUser, UserProfile
+from common.djangoapps.student.views import compose_and_send_activation_email
+from common.djangoapps.third_party_auth import pipeline, provider
+from common.djangoapps import third_party_auth
+from common.djangoapps.track import segment
+from common.djangoapps.util.json_request import JsonResponse
+from common.djangoapps.util.password_policy_validators import normalize_password
log = logging.getLogger("edx.student")
AUDIT_LOG = logging.getLogger("audit")
diff --git a/openedx/core/djangoapps/user_authn/views/login_form.py b/openedx/core/djangoapps/user_authn/views/login_form.py
index 25a9002e21..b9dd29b175 100644
--- a/openedx/core/djangoapps/user_authn/views/login_form.py
+++ b/openedx/core/djangoapps/user_authn/views/login_form.py
@@ -14,8 +14,8 @@ from django.views.decorators.csrf import ensure_csrf_cookie
from django.views.decorators.http import require_http_methods
from ratelimit.decorators import ratelimit
-import third_party_auth
-from edxmako.shortcuts import render_to_response
+from common.djangoapps import third_party_auth
+from common.djangoapps.edxmako.shortcuts import render_to_response
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
from openedx.core.djangoapps.user_api import accounts
from openedx.core.djangoapps.user_api.accounts.utils import (
@@ -36,10 +36,10 @@ from openedx.features.enterprise_support.utils import (
handle_enterprise_cookies_for_logistration,
update_logistration_context_for_enterprise
)
-from student.helpers import get_next_url_for_login_page
-from third_party_auth import pipeline
-from third_party_auth.decorators import xframe_allow_whitelisted
-from util.password_policy_validators import DEFAULT_MAX_PASSWORD_LENGTH
+from common.djangoapps.student.helpers import get_next_url_for_login_page
+from common.djangoapps.third_party_auth import pipeline
+from common.djangoapps.third_party_auth.decorators import xframe_allow_whitelisted
+from common.djangoapps.util.password_policy_validators import DEFAULT_MAX_PASSWORD_LENGTH
log = logging.getLogger(__name__)
diff --git a/openedx/core/djangoapps/user_authn/views/logout.py b/openedx/core/djangoapps/user_authn/views/logout.py
index 47f0b89e17..06363fa7fc 100644
--- a/openedx/core/djangoapps/user_authn/views/logout.py
+++ b/openedx/core/djangoapps/user_authn/views/logout.py
@@ -13,7 +13,7 @@ from six.moves.urllib.parse import parse_qs, urlsplit, urlunsplit # pylint: dis
from openedx.core.djangoapps.user_authn.cookies import delete_logged_in_cookies
from openedx.core.djangoapps.user_authn.utils import is_safe_login_or_logout_redirect
-from third_party_auth import pipeline as tpa_pipeline
+from common.djangoapps.third_party_auth import pipeline as tpa_pipeline
class LogoutView(TemplateView):
diff --git a/openedx/core/djangoapps/user_authn/views/password_reset.py b/openedx/core/djangoapps/user_authn/views/password_reset.py
index 76990c3b8d..cf6f8548ed 100644
--- a/openedx/core/djangoapps/user_authn/views/password_reset.py
+++ b/openedx/core/djangoapps/user_authn/views/password_reset.py
@@ -27,7 +27,7 @@ from eventtracking import tracker
from ratelimit.decorators import ratelimit
from rest_framework.views import APIView
-from edxmako.shortcuts import render_to_string
+from common.djangoapps.edxmako.shortcuts import render_to_string
from openedx.core.djangoapps.ace_common.template_context import get_base_template_context
from openedx.core.djangoapps.lang_pref import LANGUAGE_KEY
from openedx.core.djangoapps.oauth_dispatch.api import destroy_oauth_tokens
@@ -41,10 +41,10 @@ from openedx.core.djangoapps.user_api.models import UserRetirementRequest
from openedx.core.djangoapps.user_api.preferences.api import get_user_preference
from openedx.core.djangoapps.user_authn.message_types import PasswordReset, PasswordResetSuccess
from openedx.core.djangolib.markup import HTML
-from student.forms import send_account_recovery_email_for_user
-from student.models import AccountRecovery
-from util.json_request import JsonResponse
-from util.password_policy_validators import normalize_password, validate_password
+from common.djangoapps.student.forms import send_account_recovery_email_for_user
+from common.djangoapps.student.models import AccountRecovery
+from common.djangoapps.util.json_request import JsonResponse
+from common.djangoapps.util.password_policy_validators import normalize_password, validate_password
POST_EMAIL_KEY = 'post:email'
REAL_IP_KEY = 'openedx.core.djangoapps.util.ratelimit.real_ip'
diff --git a/openedx/core/djangoapps/user_authn/views/register.py b/openedx/core/djangoapps/user_authn/views/register.py
index 18674b186d..db72b48542 100644
--- a/openedx/core/djangoapps/user_authn/views/register.py
+++ b/openedx/core/djangoapps/user_authn/views/register.py
@@ -31,7 +31,7 @@ from six import text_type
from social_core.exceptions import AuthAlreadyAssociated, AuthException
from social_django import utils as social_utils
-import third_party_auth
+from common.djangoapps import third_party_auth
# Note that this lives in LMS, so this dependency should be refactored.
# TODO Have the discussions code subscribe to the REGISTER_USER signal instead.
from common.djangoapps.student.helpers import get_next_url_for_login_page
@@ -57,25 +57,25 @@ from openedx.core.djangoapps.user_authn.views.registration_form import (
RegistrationFormFactory,
get_registration_extension_form
)
-from student.helpers import (
+from common.djangoapps.student.helpers import (
AccountValidationError,
authenticate_new_user,
create_or_set_user_attribute_created_on_site,
do_create_account
)
-from student.models import (
+from common.djangoapps.student.models import (
RegistrationCookieConfiguration,
UserAttribute,
create_comments_service_user,
email_exists_or_retired,
username_exists_or_retired
)
-from student.views import compose_and_send_activation_email
-from third_party_auth import pipeline, provider
-from third_party_auth.saml import SAP_SUCCESSFACTORS_SAML_KEY
-from track import segment
-from util.db import outer_atomic
-from util.json_request import JsonResponse
+from common.djangoapps.student.views import compose_and_send_activation_email
+from common.djangoapps.third_party_auth import pipeline, provider
+from common.djangoapps.third_party_auth.saml import SAP_SUCCESSFACTORS_SAML_KEY
+from common.djangoapps.track import segment
+from common.djangoapps.util.db import outer_atomic
+from common.djangoapps.util.json_request import JsonResponse
log = logging.getLogger("edx.student")
AUDIT_LOG = logging.getLogger("audit")
diff --git a/openedx/core/djangoapps/user_authn/views/registration_form.py b/openedx/core/djangoapps/user_authn/views/registration_form.py
index fbc7ce5344..01e2e302a3 100644
--- a/openedx/core/djangoapps/user_authn/views/registration_form.py
+++ b/openedx/core/djangoapps/user_authn/views/registration_form.py
@@ -18,20 +18,20 @@ from django.urls import reverse
from django.utils.translation import ugettext as _
from django_countries import countries
-import third_party_auth
-from edxmako.shortcuts import marketing_link
+from common.djangoapps import third_party_auth
+from common.djangoapps.edxmako.shortcuts import marketing_link
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
from openedx.core.djangoapps.user_api import accounts
from openedx.core.djangoapps.user_api.helpers import FormDescription
from openedx.core.djangoapps.user_authn.utils import is_registration_api_v1 as is_api_v1
from openedx.core.djangolib.markup import HTML, Text
from openedx.features.enterprise_support.api import enterprise_customer_for_request
-from student.models import (
+from common.djangoapps.student.models import (
CourseEnrollmentAllowed,
UserProfile,
email_exists_or_retired,
)
-from util.password_policy_validators import (
+from common.djangoapps.util.password_policy_validators import (
password_validators_instruction_texts,
password_validators_restrictions,
validate_password,
diff --git a/openedx/core/djangoapps/user_authn/views/tests/test_auto_auth.py b/openedx/core/djangoapps/user_authn/views/tests/test_auto_auth.py
index d7020e55dc..84304665ae 100644
--- a/openedx/core/djangoapps/user_authn/views/tests/test_auto_auth.py
+++ b/openedx/core/djangoapps/user_authn/views/tests/test_auto_auth.py
@@ -19,8 +19,8 @@ from openedx.core.djangoapps.django_comment_common.models import (
Role
)
from openedx.core.djangoapps.django_comment_common.utils import seed_permissions_roles
-from student.models import CourseAccessRole, CourseEnrollment, UserProfile, anonymous_id_for_user
-from util.testing import UrlResetMixin
+from common.djangoapps.student.models import CourseAccessRole, CourseEnrollment, UserProfile, anonymous_id_for_user
+from common.djangoapps.util.testing import UrlResetMixin
class AutoAuthTestCase(UrlResetMixin, TestCase):
diff --git a/openedx/core/djangoapps/user_authn/views/tests/test_login.py b/openedx/core/djangoapps/user_authn/views/tests/test_login.py
index 99886392a5..91233681ac 100644
--- a/openedx/core/djangoapps/user_authn/views/tests/test_login.py
+++ b/openedx/core/djangoapps/user_authn/views/tests/test_login.py
@@ -20,8 +20,7 @@ from django.test.utils import override_settings
from django.urls import NoReverseMatch, reverse
from edx_toggles.toggles.testutils import override_waffle_switch
from mock import patch
-from student.tests.factories import RegistrationFactory, UserFactory, UserProfileFactory
-from util.password_policy_validators import DEFAULT_MAX_PASSWORD_LENGTH
+from common.djangoapps.student.tests.factories import RegistrationFactory, UserFactory, UserProfileFactory
from openedx.core.djangoapps.password_policy.compliance import (
NonCompliantPasswordException,
@@ -38,6 +37,7 @@ from openedx.core.djangoapps.user_authn.views.login import (
from openedx.core.djangolib.testing.utils import CacheIsolationTestCase, skip_unless_lms
from openedx.core.djangoapps.site_configuration.tests.mixins import SiteMixin
from openedx.core.lib.api.test_utils import ApiTestCase
+from common.djangoapps.util.password_policy_validators import DEFAULT_MAX_PASSWORD_LENGTH
@ddt.ddt
@@ -74,7 +74,7 @@ class LoginTest(SiteMixin, CacheIsolationTestCase):
def test_login_success(self):
response, mock_audit_log = self._login_response(
- self.user_email, self.password, patched_audit_log='student.models.AUDIT_LOG'
+ self.user_email, self.password, patched_audit_log='common.djangoapps.student.models.AUDIT_LOG'
)
self._assert_response(response, success=True)
self._assert_audit_log(mock_audit_log, 'info', [u'Login success', self.user_email])
@@ -160,7 +160,7 @@ class LoginTest(SiteMixin, CacheIsolationTestCase):
@patch.dict("django.conf.settings.FEATURES", {'SQUELCH_PII_IN_LOGS': True})
def test_login_success_no_pii(self):
response, mock_audit_log = self._login_response(
- self.user_email, self.password, patched_audit_log='student.models.AUDIT_LOG'
+ self.user_email, self.password, patched_audit_log='common.djangoapps.student.models.AUDIT_LOG'
)
self._assert_response(response, success=True)
self._assert_audit_log(mock_audit_log, 'info', [u'Login success'])
@@ -172,7 +172,7 @@ class LoginTest(SiteMixin, CacheIsolationTestCase):
self.user.save()
response, mock_audit_log = self._login_response(
- unicode_email, self.password, patched_audit_log='student.models.AUDIT_LOG'
+ unicode_email, self.password, patched_audit_log='common.djangoapps.student.models.AUDIT_LOG'
)
self._assert_response(response, success=True)
self._assert_audit_log(mock_audit_log, 'info', [u'Login success', unicode_email])
@@ -283,7 +283,7 @@ class LoginTest(SiteMixin, CacheIsolationTestCase):
response, _ = self._login_response(self.user_email, self.password)
self._assert_response(response, success=True)
logout_url = reverse('logout')
- with patch('student.models.AUDIT_LOG') as mock_audit_log:
+ with patch('common.djangoapps.student.models.AUDIT_LOG') as mock_audit_log:
response = self.client.post(logout_url)
self.assertEqual(response.status_code, 200)
self._assert_audit_log(mock_audit_log, 'info', [u'Logout', u'test'])
@@ -343,7 +343,7 @@ class LoginTest(SiteMixin, CacheIsolationTestCase):
response, _ = self._login_response(self.user_email, self.password)
self._assert_response(response, success=True)
logout_url = reverse('logout')
- with patch('student.models.AUDIT_LOG') as mock_audit_log:
+ with patch('common.djangoapps.student.models.AUDIT_LOG') as mock_audit_log:
response = self.client.post(logout_url)
self.assertEqual(response.status_code, 200)
self._assert_audit_log(mock_audit_log, 'info', [u'Logout'])
diff --git a/openedx/core/djangoapps/user_authn/views/tests/test_logistration.py b/openedx/core/djangoapps/user_authn/views/tests/test_logistration.py
index 8a5cc6d78f..a59da6d128 100644
--- a/openedx/core/djangoapps/user_authn/views/tests/test_logistration.py
+++ b/openedx/core/djangoapps/user_authn/views/tests/test_logistration.py
@@ -22,7 +22,7 @@ from django.utils.translation import ugettext as _
from freezegun import freeze_time
from pytz import UTC
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from lms.djangoapps.branding.api import get_privacy_url
from openedx.core.djangoapps.site_configuration.tests.mixins import SiteMixin
from openedx.core.djangoapps.theming.tests.test_util import with_comprehensive_theme_context
@@ -30,8 +30,8 @@ from openedx.core.djangoapps.user_authn.views.login_form import login_and_regist
from openedx.core.djangolib.js_utils import dump_js_escaped_json
from openedx.core.djangolib.markup import HTML, Text
from openedx.core.djangolib.testing.utils import skip_unless_lms
-from third_party_auth.tests.testutil import ThirdPartyAuthTestMixin, simulate_running_pipeline
-from util.testing import UrlResetMixin
+from common.djangoapps.third_party_auth.tests.testutil import ThirdPartyAuthTestMixin, simulate_running_pipeline
+from common.djangoapps.util.testing import UrlResetMixin
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
@@ -367,7 +367,7 @@ class LoginAndRegistrationTest(ThirdPartyAuthTestMixin, UrlResetMixin, ModuleSto
}
pipeline_target = 'openedx.core.djangoapps.user_authn.views.login_form.third_party_auth.pipeline'
with simulate_running_pipeline(pipeline_target, current_backend, **pipeline_response):
- with mock.patch('edxmako.request_context.get_current_request', return_value=request):
+ with mock.patch('common.djangoapps.edxmako.request_context.get_current_request', return_value=request):
response = login_and_registration_form(request)
expected_error_message = Text(_(
diff --git a/openedx/core/djangoapps/user_authn/views/tests/test_logout.py b/openedx/core/djangoapps/user_authn/views/tests/test_logout.py
index 2ba360ab89..651ff7bb6d 100644
--- a/openedx/core/djangoapps/user_authn/views/tests/test_logout.py
+++ b/openedx/core/djangoapps/user_authn/views/tests/test_logout.py
@@ -14,7 +14,7 @@ from django.test.utils import override_settings
from django.urls import reverse
from openedx.core.djangoapps.oauth_dispatch.tests.factories import ApplicationFactory
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
@unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms')
diff --git a/openedx/core/djangoapps/user_authn/views/tests/test_register.py b/openedx/core/djangoapps/user_authn/views/tests/test_register.py
index 593a83a15f..2ca881337c 100644
--- a/openedx/core/djangoapps/user_authn/views/tests/test_register.py
+++ b/openedx/core/djangoapps/user_authn/views/tests/test_register.py
@@ -52,15 +52,15 @@ from openedx.core.djangoapps.user_api.tests.test_views import UserAPITestCase
from openedx.core.djangoapps.user_authn.views.register import REGISTRATION_FAILURE_LOGGING_FLAG
from openedx.core.djangolib.testing.utils import CacheIsolationTestCase, skip_unless_lms
from openedx.core.lib.api import test_utils
-from student.helpers import authenticate_new_user
-from student.tests.factories import UserFactory
-from third_party_auth.tests.testutil import ThirdPartyAuthTestMixin, simulate_running_pipeline
-from third_party_auth.tests.utils import (
+from common.djangoapps.student.helpers import authenticate_new_user
+from common.djangoapps.student.tests.factories import UserFactory
+from common.djangoapps.third_party_auth.tests.testutil import ThirdPartyAuthTestMixin, simulate_running_pipeline
+from common.djangoapps.third_party_auth.tests.utils import (
ThirdPartyOAuthTestMixin,
ThirdPartyOAuthTestMixinFacebook,
ThirdPartyOAuthTestMixinGoogle
)
-from util.password_policy_validators import (
+from common.djangoapps.util.password_policy_validators import (
DEFAULT_MAX_PASSWORD_LENGTH,
create_validator_config,
password_validators_instruction_texts,
@@ -473,9 +473,15 @@ class RegistrationViewTestV1(ThirdPartyAuthTestMixin, UserAPITestCase):
)
@override_settings(AUTH_PASSWORD_VALIDATORS=[
- create_validator_config('util.password_policy_validators.MinimumLengthValidator', {'min_length': 2}),
- create_validator_config('util.password_policy_validators.UppercaseValidator', {'min_upper': 3}),
- create_validator_config('util.password_policy_validators.SymbolValidator', {'min_symbol': 1}),
+ create_validator_config(
+ 'common.djangoapps.util.password_policy_validators.MinimumLengthValidator', {'min_length': 2}
+ ),
+ create_validator_config(
+ 'common.djangoapps.util.password_policy_validators.UppercaseValidator', {'min_upper': 3}
+ ),
+ create_validator_config(
+ 'common.djangoapps.util.password_policy_validators.SymbolValidator', {'min_symbol': 1}
+ ),
])
def test_register_form_password_complexity(self):
no_extra_fields_setting = {}
diff --git a/openedx/core/djangoapps/user_authn/views/tests/test_reset_password.py b/openedx/core/djangoapps/user_authn/views/tests/test_reset_password.py
index 494a604568..947a98c3da 100644
--- a/openedx/core/djangoapps/user_authn/views/tests/test_reset_password.py
+++ b/openedx/core/djangoapps/user_authn/views/tests/test_reset_password.py
@@ -37,13 +37,13 @@ from openedx.core.djangoapps.user_authn.views.password_reset import (
SETTING_CHANGE_INITIATED, password_reset, password_reset_logistration,
PasswordResetConfirmWrapper)
from openedx.core.djangolib.testing.utils import CacheIsolationTestCase
-from student.tests.factories import TEST_PASSWORD, UserFactory
-from student.tests.test_configuration_overrides import fake_get_value
-from student.tests.test_email import mock_render_to_string
-from student.models import AccountRecovery
+from common.djangoapps.student.tests.factories import TEST_PASSWORD, UserFactory
+from common.djangoapps.student.tests.test_configuration_overrides import fake_get_value
+from common.djangoapps.student.tests.test_email import mock_render_to_string
+from common.djangoapps.student.models import AccountRecovery
-from util.password_policy_validators import create_validator_config
-from util.testing import EventTestMixin
+from common.djangoapps.util.password_policy_validators import create_validator_config
+from common.djangoapps.util.testing import EventTestMixin
ENABLE_LOGISTRATION_MICROFRONTEND = settings.FEATURES.copy()
@@ -541,8 +541,12 @@ class ResetPasswordTests(EventTestMixin, CacheIsolationTestCase):
})
@override_settings(AUTH_PASSWORD_VALIDATORS=[
- create_validator_config('util.password_policy_validators.MinimumLengthValidator', {'min_length': 2}),
- create_validator_config('util.password_policy_validators.MaximumLengthValidator', {'max_length': 10})
+ create_validator_config(
+ 'common.djangoapps.util.password_policy_validators.MinimumLengthValidator', {'min_length': 2}
+ ),
+ create_validator_config(
+ 'common.djangoapps.util.password_policy_validators.MaximumLengthValidator', {'max_length': 10}
+ ),
])
@ddt.data(
{
diff --git a/openedx/core/djangoapps/util/row_delete.py b/openedx/core/djangoapps/util/row_delete.py
index 7d60e1392b..2cfe51bd75 100644
--- a/openedx/core/djangoapps/util/row_delete.py
+++ b/openedx/core/djangoapps/util/row_delete.py
@@ -8,7 +8,7 @@ Following lines show how to use delete_rows():
import logging
from openedx.core.djangoapps.util.row_delete import BaseDeletionCommand, delete_rows
-from student.models import CourseEnrollment
+from common.djangoapps.student.models import CourseEnrollment
log = logging.getLogger(__name__)
diff --git a/openedx/core/djangoapps/util/testing.py b/openedx/core/djangoapps/util/testing.py
index 24178f4aad..3ab1637c02 100644
--- a/openedx/core/djangoapps/util/testing.py
+++ b/openedx/core/djangoapps/util/testing.py
@@ -11,7 +11,7 @@ from openedx.core.djangoapps.django_comment_common.models import Role
from openedx.core.djangoapps.django_comment_common.utils import seed_permissions_roles
from openedx.core.djangoapps.user_api.tests.factories import UserCourseTagFactory
from openedx.core.lib.teams_config import TeamsConfig
-from student.tests.factories import CourseEnrollmentFactory, UserFactory
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory, UserFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
from xmodule.partitions.partitions import Group, UserPartition
diff --git a/openedx/core/djangoapps/util/tests/test_user_messages.py b/openedx/core/djangoapps/util/tests/test_user_messages.py
index 8bfd6ab2b9..ffb2240fee 100644
--- a/openedx/core/djangoapps/util/tests/test_user_messages.py
+++ b/openedx/core/djangoapps/util/tests/test_user_messages.py
@@ -9,7 +9,7 @@ from django.test import RequestFactory, TestCase
from common.test.utils import normalize_repr
from openedx.core.djangolib.markup import HTML, Text
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from ..user_messages import PageLevelMessages, UserMessageType
diff --git a/openedx/core/djangoapps/verified_track_content/management/commands/swap_from_auto_track_cohort_pilot.py b/openedx/core/djangoapps/verified_track_content/management/commands/swap_from_auto_track_cohort_pilot.py
index ffcf963527..26dfb7cd57 100644
--- a/openedx/core/djangoapps/verified_track_content/management/commands/swap_from_auto_track_cohort_pilot.py
+++ b/openedx/core/djangoapps/verified_track_content/management/commands/swap_from_auto_track_cohort_pilot.py
@@ -7,7 +7,7 @@ from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from cms.djangoapps.contentstore.course_group_config import GroupConfiguration
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from openedx.core.djangoapps.course_groups.cohorts import CourseCohort
from openedx.core.djangoapps.course_groups.models import CourseUserGroup, CourseUserGroupPartitionGroup
from openedx.core.djangoapps.verified_track_content.models import (
diff --git a/openedx/core/djangoapps/verified_track_content/models.py b/openedx/core/djangoapps/verified_track_content/models.py
index 0960106d06..5b54362365 100644
--- a/openedx/core/djangoapps/verified_track_content/models.py
+++ b/openedx/core/djangoapps/verified_track_content/models.py
@@ -24,7 +24,7 @@ from openedx.core.djangoapps.course_groups.cohorts import (
)
from openedx.core.djangoapps.verified_track_content.tasks import sync_cohort_with_mode
from openedx.core.lib.cache_utils import request_cached
-from student.models import CourseEnrollment
+from common.djangoapps.student.models import CourseEnrollment
log = logging.getLogger(__name__)
diff --git a/openedx/core/djangoapps/verified_track_content/partition_scheme.py b/openedx/core/djangoapps/verified_track_content/partition_scheme.py
index 441921c360..651156ba94 100644
--- a/openedx/core/djangoapps/verified_track_content/partition_scheme.py
+++ b/openedx/core/djangoapps/verified_track_content/partition_scheme.py
@@ -9,14 +9,14 @@ import six
from django.conf import settings
from opaque_keys.edx.keys import CourseKey
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from lms.djangoapps.courseware.masquerade import (
get_course_masquerade,
get_masquerading_user_group,
is_masquerading_as_specific_student
)
from openedx.core.djangoapps.verified_track_content.models import VerifiedTrackCohortedCourse
-from student.models import CourseEnrollment
+from common.djangoapps.student.models import CourseEnrollment
from xmodule.partitions.partitions import Group, UserPartition
LOGGER = logging.getLogger(__name__)
diff --git a/openedx/core/djangoapps/verified_track_content/tasks.py b/openedx/core/djangoapps/verified_track_content/tasks.py
index 7666494ccf..2335743df2 100644
--- a/openedx/core/djangoapps/verified_track_content/tasks.py
+++ b/openedx/core/djangoapps/verified_track_content/tasks.py
@@ -11,7 +11,7 @@ from django.contrib.auth.models import User
from opaque_keys.edx.keys import CourseKey
from openedx.core.djangoapps.course_groups.cohorts import add_user_to_cohort, get_cohort, get_cohort_by_name
-from student.models import CourseEnrollment, CourseMode
+from common.djangoapps.student.models import CourseEnrollment, CourseMode
LOGGER = get_task_logger(__name__)
diff --git a/openedx/core/djangoapps/verified_track_content/tests/test_models.py b/openedx/core/djangoapps/verified_track_content/tests/test_models.py
index 0b97ea7c17..8a500bb2b6 100644
--- a/openedx/core/djangoapps/verified_track_content/tests/test_models.py
+++ b/openedx/core/djangoapps/verified_track_content/tests/test_models.py
@@ -18,8 +18,8 @@ from openedx.core.djangoapps.course_groups.cohorts import (
set_course_cohorted
)
from openedx.core.djangolib.testing.utils import skip_unless_lms
-from student.models import CourseMode
-from student.tests.factories import CourseEnrollmentFactory, UserFactory
+from common.djangoapps.student.models import CourseMode
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory, UserFactory
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/openedx/core/djangoapps/verified_track_content/tests/test_partition_scheme.py b/openedx/core/djangoapps/verified_track_content/tests/test_partition_scheme.py
index 882ec05df5..9f364ef0a6 100644
--- a/openedx/core/djangoapps/verified_track_content/tests/test_partition_scheme.py
+++ b/openedx/core/djangoapps/verified_track_content/tests/test_partition_scheme.py
@@ -8,9 +8,9 @@ from datetime import datetime, timedelta
import pytz
import six
-from course_modes.models import CourseMode
-from student.models import CourseEnrollment
-from student.tests.factories import UserFactory
+from common.djangoapps.course_modes.models import CourseMode
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.partitions.partitions import MINIMUM_STATIC_PARTITION_ID, UserPartition, ReadOnlyUserPartitionError
diff --git a/openedx/core/djangoapps/verified_track_content/tests/test_views.py b/openedx/core/djangoapps/verified_track_content/tests/test_views.py
index 5ff6492000..5ceb73504b 100644
--- a/openedx/core/djangoapps/verified_track_content/tests/test_views.py
+++ b/openedx/core/djangoapps/verified_track_content/tests/test_views.py
@@ -10,7 +10,7 @@ from django.http import Http404
from django.test.client import RequestFactory
from openedx.core.djangolib.testing.utils import skip_unless_lms
-from student.tests.factories import UserFactory, AdminFactory
+from common.djangoapps.student.tests.factories import UserFactory, AdminFactory
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/openedx/core/djangoapps/verified_track_content/views.py b/openedx/core/djangoapps/verified_track_content/views.py
index 3c362b470d..20d7196d87 100644
--- a/openedx/core/djangoapps/verified_track_content/views.py
+++ b/openedx/core/djangoapps/verified_track_content/views.py
@@ -8,7 +8,7 @@ from opaque_keys.edx.keys import CourseKey
from lms.djangoapps.courseware.courses import get_course_with_access
from openedx.core.djangoapps.verified_track_content.models import VerifiedTrackCohortedCourse
-from util.json_request import JsonResponse, expect_json
+from common.djangoapps.util.json_request import JsonResponse, expect_json
@expect_json
diff --git a/openedx/core/djangoapps/video_pipeline/tests/test_api.py b/openedx/core/djangoapps/video_pipeline/tests/test_api.py
index 38b5f34074..2f025f7816 100644
--- a/openedx/core/djangoapps/video_pipeline/tests/test_api.py
+++ b/openedx/core/djangoapps/video_pipeline/tests/test_api.py
@@ -8,7 +8,7 @@ import ddt
from django.test.testcases import TestCase
from mock import Mock, patch
from slumber.exceptions import HttpClientError
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from openedx.core.djangoapps.video_pipeline.api import update_3rd_party_transcription_service_credentials
from openedx.core.djangoapps.video_pipeline.tests.mixins import VideoPipelineMixin
diff --git a/openedx/core/djangoapps/waffle_utils/tests/test_views.py b/openedx/core/djangoapps/waffle_utils/tests/test_views.py
index 49cd95f31b..3e35247e2b 100644
--- a/openedx/core/djangoapps/waffle_utils/tests/test_views.py
+++ b/openedx/core/djangoapps/waffle_utils/tests/test_views.py
@@ -9,7 +9,7 @@ from edx_toggles.toggles.testutils import override_waffle_flag
from rest_framework.test import APIRequestFactory
from waffle.testutils import override_switch
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from .. import WaffleFlag, WaffleFlagNamespace
from ..views import ToggleStateView
@@ -69,7 +69,7 @@ class ToggleStateViewTests(TestCase):
{
"name": "FEATURES['MILESTONES_APP']",
"is_active": True,
- "module": "util.milestones_helpers",
+ "module": "common.djangoapps.util.milestones_helpers",
"class": "SettingDictToggle",
},
response.data["django_settings"],
diff --git a/openedx/core/djangoapps/xblock/runtime/runtime.py b/openedx/core/djangoapps/xblock/runtime/runtime.py
index c92a6a0b9b..17d6204735 100644
--- a/openedx/core/djangoapps/xblock/runtime/runtime.py
+++ b/openedx/core/djangoapps/xblock/runtime/runtime.py
@@ -19,8 +19,8 @@ from xblock.field_data import SplitFieldData
from xblock.fields import Scope
from xblock.runtime import KvsFieldData, MemoryIdManager, Runtime
-import track.contexts
-import track.views
+from common.djangoapps.track import contexts as track_contexts
+from common.djangoapps.track import views as track_views
from lms.djangoapps.courseware.model_data import DjangoKeyValueStore, FieldDataCache
from lms.djangoapps.grades.api import signals as grades_signals
from openedx.core.djangoapps.xblock.apps import get_xblock_app_config
@@ -29,7 +29,7 @@ from openedx.core.djangoapps.xblock.runtime.ephemeral_field_data import Ephemera
from openedx.core.djangoapps.xblock.runtime.mixin import LmsBlockMixin
from openedx.core.djangoapps.xblock.utils import get_xblock_id_for_anonymous_user
from openedx.core.lib.xblock_utils import wrap_fragment, xblock_local_resource_url
-from static_replace import process_static_urls
+from common.djangoapps.static_replace import process_static_urls
from xmodule.errortracker import make_error_tracker
from xmodule.modulestore.django import ModuleI18nService
@@ -47,7 +47,7 @@ def make_track_function():
current_request = crum.get_current_request()
def function(event_type, event):
- return track.views.server_track(current_request, event_type, event, page='x_module')
+ return track_views.server_track(current_request, event_type, event, page='x_module')
return function
@@ -155,7 +155,7 @@ class XBlockRuntime(RuntimeShim, Runtime):
"""
Log this XBlock event to the tracking log
"""
- log_context = track.contexts.context_dict_for_learning_context(block.scope_ids.usage_id.context_key)
+ log_context = track_contexts.context_dict_for_learning_context(block.scope_ids.usage_id.context_key)
if self.user_id:
log_context['user_id'] = self.user_id
log_context['asides'] = {}
diff --git a/openedx/core/djangoapps/xblock/runtime/shims.py b/openedx/core/djangoapps/xblock/runtime/shims.py
index edf1d56951..a5afd95357 100644
--- a/openedx/core/djangoapps/xblock/runtime/shims.py
+++ b/openedx/core/djangoapps/xblock/runtime/shims.py
@@ -14,7 +14,7 @@ from fs.memoryfs import MemoryFS
from openedx.core.djangoapps.xblock.apps import get_xblock_app_config
import six
-from edxmako.shortcuts import render_to_string
+from common.djangoapps.edxmako.shortcuts import render_to_string
class RuntimeShim(object):
diff --git a/openedx/core/djangolib/testing/utils.py b/openedx/core/djangolib/testing/utils.py
index b2cb8fb155..031ca12ab1 100644
--- a/openedx/core/djangolib/testing/utils.py
+++ b/openedx/core/djangolib/testing/utils.py
@@ -89,7 +89,7 @@ class CacheIsolationMixin(object):
cache_name: {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
'LOCATION': cache_name,
- 'KEY_FUNCTION': 'util.memcache.safe_key',
+ 'KEY_FUNCTION': 'common.djangoapps.util.memcache.safe_key',
'OPTIONS': {
'MAX_ENTRIES': 1000,
},
diff --git a/openedx/core/djangolib/tests/test_oauth2_retirement_utils.py b/openedx/core/djangolib/tests/test_oauth2_retirement_utils.py
index be69cb31b4..21d706a9df 100644
--- a/openedx/core/djangolib/tests/test_oauth2_retirement_utils.py
+++ b/openedx/core/djangolib/tests/test_oauth2_retirement_utils.py
@@ -12,7 +12,7 @@ from oauth2_provider.models import Grant as DOTGrant
from oauth2_provider.models import RefreshToken as DOTRefreshToken
from openedx.core.djangoapps.oauth_dispatch.tests import factories
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from ..oauth2_retirement_utils import retire_dot_oauth2_models
diff --git a/openedx/core/lib/api/permissions.py b/openedx/core/lib/api/permissions.py
index df889079bc..b15b651a64 100644
--- a/openedx/core/lib/api/permissions.py
+++ b/openedx/core/lib/api/permissions.py
@@ -13,7 +13,7 @@ from rest_framework import permissions
from edx_rest_framework_extensions.permissions import IsStaff, IsUserInUrl
from openedx.core.lib.log_utils import audit_log
-from student.roles import CourseInstructorRole, CourseStaffRole
+from common.djangoapps.student.roles import CourseInstructorRole, CourseStaffRole
class ApiKeyHeaderPermission(permissions.BasePermission):
diff --git a/openedx/core/lib/api/tests/test_permissions.py b/openedx/core/lib/api/tests/test_permissions.py
index 95633d643a..8cc9f6ca2a 100644
--- a/openedx/core/lib/api/tests/test_permissions.py
+++ b/openedx/core/lib/api/tests/test_permissions.py
@@ -9,8 +9,8 @@ from opaque_keys.edx.keys import CourseKey
from rest_framework.generics import GenericAPIView
from openedx.core.lib.api.permissions import IsCourseStaffInstructor, IsMasterCourseStaffInstructor, IsStaffOrOwner
-from student.roles import CourseInstructorRole, CourseStaffRole
-from student.tests.factories import UserFactory
+from common.djangoapps.student.roles import CourseInstructorRole, CourseStaffRole
+from common.djangoapps.student.tests.factories import UserFactory
class TestObject(object):
diff --git a/openedx/core/lib/gating/api.py b/openedx/core/lib/gating/api.py
index 39c913b1c2..003e4e5ac3 100644
--- a/openedx/core/lib/gating/api.py
+++ b/openedx/core/lib/gating/api.py
@@ -17,7 +17,7 @@ from lms.djangoapps.course_blocks.api import get_course_blocks
from lms.djangoapps.courseware.access import _has_access_to_course
from lms.djangoapps.grades.api import SubsectionGradeFactory
from openedx.core.lib.gating.exceptions import GatingValidationError
-from util import milestones_helpers
+from common.djangoapps.util import milestones_helpers
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.exceptions import ItemNotFoundError
diff --git a/openedx/core/lib/gating/tests/test_api.py b/openedx/core/lib/gating/tests/test_api.py
index e9074ad58c..19783a3908 100644
--- a/openedx/core/lib/gating/tests/test_api.py
+++ b/openedx/core/lib/gating/tests/test_api.py
@@ -20,7 +20,7 @@ from lms.djangoapps.grades.tests.base import GradeTestBase
from lms.djangoapps.grades.tests.utils import mock_get_score
from openedx.core.lib.gating import api as gating_api
from openedx.core.lib.gating.exceptions import GatingValidationError
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore.tests.django_utils import TEST_DATA_SPLIT_MODULESTORE, ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
diff --git a/openedx/core/lib/tests/test_edx_api_utils.py b/openedx/core/lib/tests/test_edx_api_utils.py
index dfd54b1dd3..4c66d633ae 100644
--- a/openedx/core/lib/tests/test_edx_api_utils.py
+++ b/openedx/core/lib/tests/test_edx_api_utils.py
@@ -13,7 +13,7 @@ from openedx.core.djangoapps.catalog.utils import create_catalog_api_client
from openedx.core.djangoapps.credentials.tests.mixins import CredentialsApiConfigMixin
from openedx.core.djangolib.testing.utils import CacheIsolationTestCase, skip_unless_lms
from openedx.core.lib.edx_api_utils import get_edx_api_data
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
UTILITY_MODULE = 'openedx.core.lib.edx_api_utils'
TEST_API_URL = 'http://www-internal.example.com/api'
diff --git a/openedx/core/lib/tests/test_time_zone_utils.py b/openedx/core/lib/tests/test_time_zone_utils.py
index 796a237bf9..0a46337aef 100644
--- a/openedx/core/lib/tests/test_time_zone_utils.py
+++ b/openedx/core/lib/tests/test_time_zone_utils.py
@@ -6,7 +6,7 @@ from freezegun import freeze_time
from pytz import timezone
from openedx.core.lib.time_zone_utils import get_display_time_zone, get_time_zone_abbr, get_time_zone_offset
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
class TestTimeZoneUtils(TestCase):
diff --git a/openedx/core/lib/xblock_utils/__init__.py b/openedx/core/lib/xblock_utils/__init__.py
index c8c205f2e2..32b121dce9 100644
--- a/openedx/core/lib/xblock_utils/__init__.py
+++ b/openedx/core/lib/xblock_utils/__init__.py
@@ -28,8 +28,8 @@ from xblock.core import XBlock
from xblock.exceptions import InvalidScopeError
from xblock.scorable import ScorableXBlockMixin
-import static_replace
-from edxmako.shortcuts import render_to_string
+from common.djangoapps import static_replace
+from common.djangoapps.edxmako.shortcuts import render_to_string
from xmodule.seq_module import SequenceModule
from xmodule.util.xmodule_django import add_webpack_to_fragment
from xmodule.vertical_block import VerticalBlock
diff --git a/openedx/core/tests/test_admin_view.py b/openedx/core/tests/test_admin_view.py
index 4f02167bf5..095e7c40ce 100644
--- a/openedx/core/tests/test_admin_view.py
+++ b/openedx/core/tests/test_admin_view.py
@@ -7,7 +7,7 @@ This is not inside a django app because it is a global property of the system.
from django.test import Client, TestCase
from django.urls import reverse
from edx_toggles.toggles.testutils import override_waffle_switch
-from student.tests.factories import TEST_PASSWORD, UserFactory
+from common.djangoapps.student.tests.factories import UserFactory, TEST_PASSWORD
from openedx.core.djangoapps.user_authn.views.login import ENABLE_LOGIN_USING_THIRDPARTY_AUTH_ONLY
diff --git a/openedx/features/announcements/tests/test_announcements.py b/openedx/features/announcements/tests/test_announcements.py
index dc1bd336d3..d280aa100b 100644
--- a/openedx/features/announcements/tests/test_announcements.py
+++ b/openedx/features/announcements/tests/test_announcements.py
@@ -12,7 +12,7 @@ from django.test import TestCase
from django.test.client import Client
from django.urls import reverse
-from student.tests.factories import AdminFactory
+from common.djangoapps.student.tests.factories import AdminFactory
from openedx.features.announcements.models import Announcement
diff --git a/openedx/features/calendar_sync/plugins.py b/openedx/features/calendar_sync/plugins.py
index 0e07f52649..0c0c801857 100644
--- a/openedx/features/calendar_sync/plugins.py
+++ b/openedx/features/calendar_sync/plugins.py
@@ -10,7 +10,7 @@ from openedx.features.calendar_sync.api import SUBSCRIBE, UNSUBSCRIBE
from openedx.features.calendar_sync.models import UserCalendarSyncConfig
from openedx.features.course_experience import CALENDAR_SYNC_FLAG, RELATIVE_DATES_FLAG
from openedx.features.course_experience.course_tools import CourseTool, HttpMethod
-from student.models import CourseEnrollment
+from common.djangoapps.student.models import CourseEnrollment
class CalendarSyncToggleTool(CourseTool):
diff --git a/openedx/features/calendar_sync/tests/test_api.py b/openedx/features/calendar_sync/tests/test_api.py
index d238374b8c..f38a85be47 100644
--- a/openedx/features/calendar_sync/tests/test_api.py
+++ b/openedx/features/calendar_sync/tests/test_api.py
@@ -3,7 +3,7 @@
from openedx.features.calendar_sync.api import subscribe_user_to_calendar, unsubscribe_user_to_calendar
from openedx.features.calendar_sync.models import UserCalendarSyncConfig
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/openedx/features/calendar_sync/tests/test_ics.py b/openedx/features/calendar_sync/tests/test_ics.py
index fd4ff6c1e2..c2a5679496 100644
--- a/openedx/features/calendar_sync/tests/test_ics.py
+++ b/openedx/features/calendar_sync/tests/test_ics.py
@@ -13,7 +13,7 @@ from openedx.core.djangoapps.site_configuration.tests.factories import SiteConfi
from openedx.features.calendar_sync import get_calendar_event_id
from openedx.features.calendar_sync.ics import generate_ics_files_for_user_course
from openedx.features.calendar_sync.tests.factories import UserCalendarSyncConfigFactory
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
class TestIcsGeneration(TestCase):
diff --git a/openedx/features/calendar_sync/tests/test_init.py b/openedx/features/calendar_sync/tests/test_init.py
index 6722abfb9e..527f9cf8d9 100644
--- a/openedx/features/calendar_sync/tests/test_init.py
+++ b/openedx/features/calendar_sync/tests/test_init.py
@@ -4,7 +4,7 @@
from django.test import TestCase
from openedx.features.calendar_sync import get_calendar_event_id
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
TEST_PASSWORD = 'test'
diff --git a/openedx/features/calendar_sync/tests/test_models.py b/openedx/features/calendar_sync/tests/test_models.py
index fe1f51a6fb..6c4a5385c5 100644
--- a/openedx/features/calendar_sync/tests/test_models.py
+++ b/openedx/features/calendar_sync/tests/test_models.py
@@ -2,7 +2,7 @@
from openedx.features.calendar_sync.models import UserCalendarSyncConfig
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/openedx/features/calendar_sync/views/calendar_sync.py b/openedx/features/calendar_sync/views/calendar_sync.py
index 930d3d80ab..a35b9d7464 100644
--- a/openedx/features/calendar_sync/views/calendar_sync.py
+++ b/openedx/features/calendar_sync/views/calendar_sync.py
@@ -18,7 +18,7 @@ from rest_framework import status
from openedx.features.calendar_sync.api import (
SUBSCRIBE, UNSUBSCRIBE, subscribe_user_to_calendar, unsubscribe_user_to_calendar
)
-from util.views import ensure_valid_course_key
+from common.djangoapps.util.views import ensure_valid_course_key
class CalendarSyncView(View):
diff --git a/openedx/features/content_type_gating/helpers.py b/openedx/features/content_type_gating/helpers.py
index 2326e209af..b0c0bb4fec 100644
--- a/openedx/features/content_type_gating/helpers.py
+++ b/openedx/features/content_type_gating/helpers.py
@@ -6,10 +6,10 @@ import logging
from django.utils import timezone
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from openedx.core.djangoapps.config_model_utils.utils import is_in_holdback
-from student.models import CourseEnrollment
-from student.role_helpers import has_staff_roles
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.student.role_helpers import has_staff_roles
from xmodule.partitions.partitions import Group
# Studio generates partition IDs starting at 100. There is already a manually generated
diff --git a/openedx/features/content_type_gating/partitions.py b/openedx/features/content_type_gating/partitions.py
index 77369ddee0..0394ac677c 100644
--- a/openedx/features/content_type_gating/partitions.py
+++ b/openedx/features/content_type_gating/partitions.py
@@ -16,7 +16,7 @@ from django.template.loader import render_to_string
from django.utils.translation import ugettext_lazy as _
from web_fragments.fragment import Fragment
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from lms.djangoapps.commerce.utils import EcommerceService
from openedx.core.djangoapps.content.course_overviews.models import CourseOverview
from openedx.core.lib.mobile_utils import is_request_from_mobile_app
diff --git a/openedx/features/content_type_gating/tests/test_access.py b/openedx/features/content_type_gating/tests/test_access.py
index 3daf966a28..faa0baae42 100644
--- a/openedx/features/content_type_gating/tests/test_access.py
+++ b/openedx/features/content_type_gating/tests/test_access.py
@@ -19,7 +19,7 @@ from mock import patch, Mock
from pyquery import PyQuery as pq
from lms.djangoapps.course_api.blocks.api import get_blocks
-from course_modes.tests.factories import CourseModeFactory
+from common.djangoapps.course_modes.tests.factories import CourseModeFactory
from lms.djangoapps.courseware.module_render import load_single_xblock
from lms.djangoapps.courseware.tests.factories import (
BetaTesterFactory,
@@ -46,9 +46,9 @@ from openedx.features.content_type_gating.helpers import CONTENT_GATING_PARTITIO
from openedx.features.content_type_gating.models import ContentTypeGatingConfig
from openedx.features.content_type_gating.partitions import ContentTypeGatingPartition
from openedx.features.content_type_gating.services import ContentTypeGatingService
-from student.models import CourseEnrollment, FBEEnrollmentExclusion
-from student.roles import CourseInstructorRole
-from student.tests.factories import TEST_PASSWORD, CourseEnrollmentFactory, UserFactory
+from common.djangoapps.student.models import CourseEnrollment, FBEEnrollmentExclusion
+from common.djangoapps.student.roles import CourseInstructorRole
+from common.djangoapps.student.tests.factories import TEST_PASSWORD, CourseEnrollmentFactory, UserFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
from xmodule.partitions.partitions import ENROLLMENT_TRACK_PARTITION_ID
diff --git a/openedx/features/content_type_gating/tests/test_models.py b/openedx/features/content_type_gating/tests/test_models.py
index e58aa32ac4..c60b6ad8a3 100644
--- a/openedx/features/content_type_gating/tests/test_models.py
+++ b/openedx/features/content_type_gating/tests/test_models.py
@@ -10,14 +10,14 @@ from edx_django_utils.cache import RequestCache
from mock import Mock
from opaque_keys.edx.locator import CourseLocator
-from course_modes.tests.factories import CourseModeFactory
+from common.djangoapps.course_modes.tests.factories import CourseModeFactory
from edx_toggles.toggles.testutils import override_waffle_flag
from openedx.core.djangoapps.config_model_utils.models import Provenance
from openedx.core.djangoapps.content.course_overviews.tests.factories import CourseOverviewFactory
from openedx.core.djangoapps.site_configuration.tests.factories import SiteConfigurationFactory
from openedx.core.djangolib.testing.utils import CacheIsolationTestCase
from openedx.features.content_type_gating.models import ContentTypeGatingConfig
-from student.tests.factories import CourseEnrollmentFactory, UserFactory
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory, UserFactory
@ddt.ddt
diff --git a/openedx/features/content_type_gating/tests/test_partitions.py b/openedx/features/content_type_gating/tests/test_partitions.py
index 658f050b98..3de4d02183 100644
--- a/openedx/features/content_type_gating/tests/test_partitions.py
+++ b/openedx/features/content_type_gating/tests/test_partitions.py
@@ -7,14 +7,14 @@ from django.test import RequestFactory
from mock import Mock, patch
from opaque_keys.edx.keys import CourseKey
-from course_modes.tests.factories import CourseModeFactory
+from common.djangoapps.course_modes.tests.factories import CourseModeFactory
from lms.djangoapps.courseware.tests.factories import GlobalStaffFactory
from openedx.core.djangolib.testing.utils import CacheIsolationTestCase
from openedx.features.content_type_gating.helpers import CONTENT_GATING_PARTITION_ID, FULL_ACCESS, LIMITED_ACCESS
from openedx.features.content_type_gating.models import ContentTypeGatingConfig
from openedx.features.content_type_gating.partitions import ContentTypeGatingPartition, create_content_gating_partition
from openedx.core.djangoapps.content.course_overviews.tests.factories import CourseOverviewFactory
-from student.tests.factories import GroupFactory
+from common.djangoapps.student.tests.factories import GroupFactory
from xmodule.partitions.partitions import ENROLLMENT_TRACK_PARTITION_ID, UserPartitionError
diff --git a/openedx/features/course_bookmarks/plugins.py b/openedx/features/course_bookmarks/plugins.py
index 88a6988b8d..7acf0e5e5d 100644
--- a/openedx/features/course_bookmarks/plugins.py
+++ b/openedx/features/course_bookmarks/plugins.py
@@ -8,7 +8,7 @@ from django.utils.translation import ugettext as _
from lms.djangoapps.courseware.permissions import EDIT_BOOKMARK
from openedx.features.course_experience.course_tools import CourseTool
-from student.models import CourseEnrollment
+from common.djangoapps.student.models import CourseEnrollment
class CourseBookmarksTool(CourseTool):
diff --git a/openedx/features/course_bookmarks/views/course_bookmarks.py b/openedx/features/course_bookmarks/views/course_bookmarks.py
index 585b047ba3..3a3c740e5b 100644
--- a/openedx/features/course_bookmarks/views/course_bookmarks.py
+++ b/openedx/features/course_bookmarks/views/course_bookmarks.py
@@ -21,7 +21,7 @@ from lms.djangoapps.courseware.courses import get_course_with_access
from openedx.core.djangoapps.plugin_api.views import EdxFragmentView
from openedx.core.djangoapps.user_api.models import UserPreference
from openedx.features.course_experience import default_course_url_name
-from util.views import ensure_valid_course_key
+from common.djangoapps.util.views import ensure_valid_course_key
class CourseBookmarksView(View):
diff --git a/openedx/features/course_duration_limits/access.py b/openedx/features/course_duration_limits/access.py
index a6f6781b5f..fb8455b66d 100644
--- a/openedx/features/course_duration_limits/access.py
+++ b/openedx/features/course_duration_limits/access.py
@@ -14,7 +14,7 @@ from django.utils.translation import ugettext as _
from edx_django_utils.cache import RequestCache
from web_fragments.fragment import Fragment
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from lms.djangoapps.courseware.access_response import AccessError
from lms.djangoapps.courseware.access_utils import ACCESS_GRANTED
from lms.djangoapps.courseware.utils import verified_upgrade_deadline_link
@@ -24,8 +24,8 @@ from openedx.core.djangoapps.content.course_overviews.models import CourseOvervi
from openedx.core.djangoapps.course_date_signals.utils import get_expected_duration
from openedx.core.djangolib.markup import HTML
from openedx.features.course_duration_limits.models import CourseDurationLimitConfig
-from student.models import CourseEnrollment
-from util.date_utils import strftime_localized
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.util.date_utils import strftime_localized
EXPIRATION_DATE_FORMAT_STR = u'%b %-d, %Y'
diff --git a/openedx/features/course_duration_limits/tests/test_access.py b/openedx/features/course_duration_limits/tests/test_access.py
index 8f621b5856..b872f18f40 100644
--- a/openedx/features/course_duration_limits/tests/test_access.py
+++ b/openedx/features/course_duration_limits/tests/test_access.py
@@ -8,8 +8,8 @@ import ddt
from django.utils import timezone
from pytz import UTC
-from course_modes.models import CourseMode
-from course_modes.tests.factories import CourseModeFactory
+from common.djangoapps.course_modes.models import CourseMode
+from common.djangoapps.course_modes.tests.factories import CourseModeFactory
from lms.djangoapps.courseware.models import DynamicUpgradeDeadlineConfiguration
from openedx.core.djangoapps.schedules.tests.factories import ScheduleFactory
from openedx.core.djangolib.testing.utils import CacheIsolationTestCase
@@ -19,8 +19,8 @@ from openedx.features.course_duration_limits.access import (
get_user_course_expiration_date
)
from openedx.features.course_duration_limits.models import CourseDurationLimitConfig
-from student.tests.factories import CourseEnrollmentFactory
-from util.date_utils import strftime_localized
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory
+from common.djangoapps.util.date_utils import strftime_localized
@ddt.ddt
diff --git a/openedx/features/course_duration_limits/tests/test_course_expiration.py b/openedx/features/course_duration_limits/tests/test_course_expiration.py
index d05d46f0e5..00cc1724c1 100644
--- a/openedx/features/course_duration_limits/tests/test_course_expiration.py
+++ b/openedx/features/course_duration_limits/tests/test_course_expiration.py
@@ -11,7 +11,7 @@ from django.conf import settings
from django.urls import reverse
from django.utils.timezone import now
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from lms.djangoapps.courseware.tests.factories import (
BetaTesterFactory,
GlobalStaffFactory,
@@ -35,9 +35,9 @@ from openedx.features.content_type_gating.helpers import CONTENT_GATING_PARTITIO
from openedx.features.course_duration_limits.access import get_user_course_expiration_date
from openedx.features.course_duration_limits.models import CourseDurationLimitConfig
from openedx.features.course_experience.tests.views.helpers import add_course_mode
-from student.models import CourseEnrollment, FBEEnrollmentExclusion
-from student.roles import CourseInstructorRole
-from student.tests.factories import TEST_PASSWORD, CourseEnrollmentFactory, UserFactory
+from common.djangoapps.student.models import CourseEnrollment, FBEEnrollmentExclusion
+from common.djangoapps.student.roles import CourseInstructorRole
+from common.djangoapps.student.tests.factories import TEST_PASSWORD, CourseEnrollmentFactory, UserFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.partitions.partitions import ENROLLMENT_TRACK_PARTITION_ID
diff --git a/openedx/features/course_duration_limits/tests/test_models.py b/openedx/features/course_duration_limits/tests/test_models.py
index 2da1d5128f..98c042b636 100644
--- a/openedx/features/course_duration_limits/tests/test_models.py
+++ b/openedx/features/course_duration_limits/tests/test_models.py
@@ -13,13 +13,13 @@ from edx_django_utils.cache import RequestCache
from mock import Mock
from opaque_keys.edx.locator import CourseLocator
-from course_modes.tests.factories import CourseModeFactory
+from common.djangoapps.course_modes.tests.factories import CourseModeFactory
from openedx.core.djangoapps.config_model_utils.models import Provenance
from openedx.core.djangoapps.content.course_overviews.tests.factories import CourseOverviewFactory
from openedx.core.djangoapps.site_configuration.tests.factories import SiteConfigurationFactory
from openedx.core.djangolib.testing.utils import CacheIsolationTestCase
from openedx.features.course_duration_limits.models import CourseDurationLimitConfig
-from student.tests.factories import CourseEnrollmentFactory, UserFactory
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory, UserFactory
@ddt.ddt
diff --git a/openedx/features/course_experience/api/v1/tests/test_views.py b/openedx/features/course_experience/api/v1/tests/test_views.py
index fdd208ee76..795e61d74f 100644
--- a/openedx/features/course_experience/api/v1/tests/test_views.py
+++ b/openedx/features/course_experience/api/v1/tests/test_views.py
@@ -5,9 +5,9 @@ import ddt
from django.urls import reverse
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from lms.djangoapps.course_home_api.tests.utils import BaseCourseHomeTests
-from student.models import CourseEnrollment
+from common.djangoapps.student.models import CourseEnrollment
@ddt.ddt
diff --git a/openedx/features/course_experience/plugins.py b/openedx/features/course_experience/plugins.py
index 65ec4b3bca..7e801fa267 100644
--- a/openedx/features/course_experience/plugins.py
+++ b/openedx/features/course_experience/plugins.py
@@ -9,7 +9,7 @@ from django.urls import reverse
from django.utils.translation import ugettext as _
from lms.djangoapps.courseware.courses import get_course_by_id
-from student.models import CourseEnrollment
+from common.djangoapps.student.models import CourseEnrollment
from . import DISABLE_UNIFIED_COURSE_TAB_FLAG, SHOW_REVIEWS_TOOL_FLAG
from .course_tools import CourseTool
diff --git a/openedx/features/course_experience/tests/views/helpers.py b/openedx/features/course_experience/tests/views/helpers.py
index 5c02e87cca..e38700c7ee 100644
--- a/openedx/features/course_experience/tests/views/helpers.py
+++ b/openedx/features/course_experience/tests/views/helpers.py
@@ -8,7 +8,7 @@ from datetime import timedelta
from django.core.exceptions import ObjectDoesNotExist
from django.utils.timezone import now
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
TEST_COURSE_PRICE = 50
diff --git a/openedx/features/course_experience/tests/views/test_course_dates.py b/openedx/features/course_experience/tests/views/test_course_dates.py
index db81ed41b6..5bd34bb872 100644
--- a/openedx/features/course_experience/tests/views/test_course_dates.py
+++ b/openedx/features/course_experience/tests/views/test_course_dates.py
@@ -8,7 +8,7 @@ from datetime import datetime, timedelta
import six
from django.urls import reverse
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/openedx/features/course_experience/tests/views/test_course_home.py b/openedx/features/course_experience/tests/views/test_course_home.py
index 1a71adcd66..5c727ac54a 100644
--- a/openedx/features/course_experience/tests/views/test_course_home.py
+++ b/openedx/features/course_experience/tests/views/test_course_home.py
@@ -19,8 +19,8 @@ from pytz import UTC
from waffle.models import Flag
from waffle.testutils import override_flag
-from course_modes.models import CourseMode
-from course_modes.tests.factories import CourseModeFactory
+from common.djangoapps.course_modes.models import CourseMode
+from common.djangoapps.course_modes.tests.factories import CourseModeFactory
from lms.djangoapps.experiments.models import ExperimentData
from lms.djangoapps.commerce.models import CommerceConfiguration
from lms.djangoapps.commerce.utils import EcommerceService
@@ -56,9 +56,9 @@ from openedx.features.course_experience import (
)
from openedx.features.discounts.applicability import get_discount_expiration_date
from openedx.features.discounts.utils import REV1008_EXPERIMENT_ID, format_strikeout_price
-from student.models import CourseEnrollment, FBEEnrollmentExclusion
-from student.tests.factories import UserFactory
-from util.date_utils import strftime_localized
+from common.djangoapps.student.models import CourseEnrollment, FBEEnrollmentExclusion
+from common.djangoapps.student.tests.factories import UserFactory
+from common.djangoapps.util.date_utils import strftime_localized
from xmodule.course_module import COURSE_VISIBILITY_PRIVATE, COURSE_VISIBILITY_PUBLIC, COURSE_VISIBILITY_PUBLIC_OUTLINE
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.tests.django_utils import CourseUserType, ModuleStoreTestCase, SharedModuleStoreTestCase
@@ -671,7 +671,7 @@ class TestCourseHomePageAccess(CourseHomePageTestCase):
self.assertEqual(response.status_code, 200)
@mock.patch.dict(settings.FEATURES, {'DISABLE_START_DATES': False})
- @mock.patch("util.date_utils.strftime_localized")
+ @mock.patch("common.djangoapps.util.date_utils.strftime_localized")
def test_non_live_course_other_language(self, mock_strftime_localized):
"""
Ensure that a user accessing a non-live course sees a redirect to
@@ -817,7 +817,7 @@ class TestCourseHomePageAccess(CourseHomePageTestCase):
bannerText = get_expiration_banner_text(self.staff_user, self.course)
self.assertNotContains(response, bannerText, html=True)
- @mock.patch("util.date_utils.strftime_localized")
+ @mock.patch("common.djangoapps.util.date_utils.strftime_localized")
@mock.patch("openedx.features.course_duration_limits.access.get_date_string")
def test_course_expiration_banner_with_unicode(self, mock_strftime_localized, mock_get_date_string):
"""
diff --git a/openedx/features/course_experience/tests/views/test_course_outline.py b/openedx/features/course_experience/tests/views/test_course_outline.py
index a865d8a620..ab5e6b13ee 100644
--- a/openedx/features/course_experience/tests/views/test_course_outline.py
+++ b/openedx/features/course_experience/tests/views/test_course_outline.py
@@ -24,8 +24,8 @@ from six import text_type
from waffle.models import Switch
from waffle.testutils import override_switch
-from course_modes.models import CourseMode
-from course_modes.tests.factories import CourseModeFactory
+from common.djangoapps.course_modes.models import CourseMode
+from common.djangoapps.course_modes.tests.factories import CourseModeFactory
from lms.djangoapps.course_api.blocks.transformers.milestones import MilestonesAndSpecialExamsTransformer
from lms.djangoapps.gating import api as lms_gating_api
from lms.djangoapps.courseware.tests.factories import StaffFactory
@@ -42,8 +42,8 @@ from openedx.features.course_experience.views.course_outline import (
DEFAULT_COMPLETION_TRACKING_START,
CourseOutlineFragmentView
)
-from student.models import CourseEnrollment
-from student.tests.factories import UserFactory
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
diff --git a/openedx/features/course_experience/tests/views/test_course_sock.py b/openedx/features/course_experience/tests/views/test_course_sock.py
index 8dd8b012a2..6c11abb92a 100644
--- a/openedx/features/course_experience/tests/views/test_course_sock.py
+++ b/openedx/features/course_experience/tests/views/test_course_sock.py
@@ -7,11 +7,11 @@ import ddt
import mock
from edx_toggles.toggles.testutils import override_waffle_flag
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from lms.djangoapps.commerce.models import CommerceConfiguration
from openedx.core.djangolib.markup import HTML
from openedx.features.course_experience import DISPLAY_COURSE_SOCK_FLAG
-from student.tests.factories import CourseEnrollmentFactory, UserFactory
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory, UserFactory
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/openedx/features/course_experience/tests/views/test_course_updates.py b/openedx/features/course_experience/tests/views/test_course_updates.py
index 0adf7a1e89..b9113290c1 100644
--- a/openedx/features/course_experience/tests/views/test_course_updates.py
+++ b/openedx/features/course_experience/tests/views/test_course_updates.py
@@ -12,8 +12,8 @@ from lms.djangoapps.courseware.courses import get_course_info_usage_key
from openedx.core.djangoapps.waffle_utils.testutils import WAFFLE_TABLES
from openedx.features.content_type_gating.models import ContentTypeGatingConfig
from openedx.features.course_experience.views.course_updates import STATUS_VISIBLE
-from student.models import CourseEnrollment
-from student.tests.factories import UserFactory
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.exceptions import ItemNotFoundError
diff --git a/openedx/features/course_experience/tests/views/test_masquerade.py b/openedx/features/course_experience/tests/views/test_masquerade.py
index 0072a69612..20f9470c15 100644
--- a/openedx/features/course_experience/tests/views/test_masquerade.py
+++ b/openedx/features/course_experience/tests/views/test_masquerade.py
@@ -5,8 +5,8 @@ Tests for masquerading functionality on course_experience
from edx_toggles.toggles.testutils import override_waffle_flag
from lms.djangoapps.courseware.tests.helpers import MasqueradeMixin
from openedx.features.course_experience import DISPLAY_COURSE_SOCK_FLAG, SHOW_UPGRADE_MSG_ON_COURSE_HOME
-from student.roles import CourseStaffRole
-from student.tests.factories import CourseEnrollmentFactory, UserFactory
+from common.djangoapps.student.roles import CourseStaffRole
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory, UserFactory
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.partitions.partitions import ENROLLMENT_TRACK_PARTITION_ID
diff --git a/openedx/features/course_experience/tests/views/test_welcome_message.py b/openedx/features/course_experience/tests/views/test_welcome_message.py
index a3e4d4389d..c75b93b947 100644
--- a/openedx/features/course_experience/tests/views/test_welcome_message.py
+++ b/openedx/features/course_experience/tests/views/test_welcome_message.py
@@ -7,8 +7,8 @@ import ddt
import six
from django.urls import reverse
-from student.models import CourseEnrollment
-from student.tests.factories import UserFactory
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
diff --git a/openedx/features/course_experience/utils.py b/openedx/features/course_experience/utils.py
index 5acb6dc4e4..f5af09d5e4 100644
--- a/openedx/features/course_experience/utils.py
+++ b/openedx/features/course_experience/utils.py
@@ -11,7 +11,6 @@ from django.utils import timezone
from opaque_keys.edx.keys import CourseKey
from six.moves import range
-from course_modes.models import CourseMode
from lms.djangoapps.course_api.blocks.api import get_blocks
from lms.djangoapps.course_blocks.api import get_course_blocks
from lms.djangoapps.course_blocks.utils import get_student_module_as_dict
@@ -19,7 +18,7 @@ from lms.djangoapps.courseware.access import has_access
from openedx.core.djangoapps.content.course_overviews.models import CourseOverview
from openedx.core.lib.cache_utils import request_cached
from openedx.features.course_experience import RELATIVE_DATES_FLAG
-from student.models import CourseEnrollment
+from common.djangoapps.student.models import CourseEnrollment
from xmodule.modulestore.django import modulestore
diff --git a/openedx/features/course_experience/views/course_dates.py b/openedx/features/course_experience/views/course_dates.py
index bebdb7079d..78e439742b 100644
--- a/openedx/features/course_experience/views/course_dates.py
+++ b/openedx/features/course_experience/views/course_dates.py
@@ -18,7 +18,6 @@ from lms.djangoapps.courseware.tabs import DatesTab
from lms.djangoapps.course_home_api.toggles import course_home_mfe_dates_tab_is_active
from lms.djangoapps.course_home_api.utils import get_microfrontend_url
from openedx.core.djangoapps.plugin_api.views import EdxFragmentView
-from student.models import CourseEnrollment
class CourseDatesFragmentView(EdxFragmentView):
diff --git a/openedx/features/course_experience/views/course_home.py b/openedx/features/course_experience/views/course_home.py
index edbf2dd07e..f495eb3ea3 100644
--- a/openedx/features/course_experience/views/course_home.py
+++ b/openedx/features/course_experience/views/course_home.py
@@ -33,8 +33,8 @@ from openedx.features.course_duration_limits.access import generate_course_expir
from openedx.features.course_experience.course_tools import CourseToolsPluginManager
from openedx.features.discounts.utils import get_first_purchase_offer_banner_fragment
from openedx.features.discounts.utils import format_strikeout_price
-from student.models import CourseEnrollment
-from util.views import ensure_valid_course_key
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.util.views import ensure_valid_course_key
from xmodule.course_module import COURSE_VISIBILITY_PUBLIC, COURSE_VISIBILITY_PUBLIC_OUTLINE
from .. import (
diff --git a/openedx/features/course_experience/views/course_home_messages.py b/openedx/features/course_experience/views/course_home_messages.py
index d1c32b761d..5e2671ea93 100644
--- a/openedx/features/course_experience/views/course_home_messages.py
+++ b/openedx/features/course_experience/views/course_home_messages.py
@@ -15,7 +15,7 @@ from opaque_keys.edx.keys import CourseKey
from pytz import UTC
from web_fragments.fragment import Fragment
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from lms.djangoapps.courseware.courses import get_course_date_blocks, get_course_with_access
from lms.djangoapps.course_goals.api import (
get_course_goal,
@@ -29,7 +29,7 @@ from lms.djangoapps.courseware.access_utils import check_public_access
from openedx.core.djangoapps.plugin_api.views import EdxFragmentView
from openedx.core.djangolib.markup import HTML, Text
from openedx.features.course_experience import CourseHomeMessages
-from student.models import CourseEnrollment
+from common.djangoapps.student.models import CourseEnrollment
from xmodule.course_module import COURSE_VISIBILITY_PUBLIC
diff --git a/openedx/features/course_experience/views/course_outline.py b/openedx/features/course_experience/views/course_outline.py
index dfb2477d84..a7fb935642 100644
--- a/openedx/features/course_experience/views/course_outline.py
+++ b/openedx/features/course_experience/views/course_outline.py
@@ -22,7 +22,6 @@ from pytz import UTC
from waffle.models import Switch
from web_fragments.fragment import Fragment
-from course_modes.models import CourseMode
from lms.djangoapps.courseware.access import has_access
from lms.djangoapps.courseware.courses import get_course_overview_with_access
from lms.djangoapps.courseware.date_summary import verified_upgrade_deadline_link
@@ -33,8 +32,8 @@ from openedx.core.djangoapps.schedules.utils import reset_self_paced_schedule
from openedx.features.course_experience import RELATIVE_DATES_FLAG
from openedx.features.course_experience.utils import dates_banner_should_display
from openedx.features.content_type_gating.models import ContentTypeGatingConfig
-from student.models import CourseEnrollment
-from util.milestones_helpers import get_course_content_milestones
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.util.milestones_helpers import get_course_content_milestones
from xmodule.course_module import COURSE_VISIBILITY_PUBLIC
from xmodule.modulestore.django import modulestore
diff --git a/openedx/features/course_experience/views/course_reviews.py b/openedx/features/course_experience/views/course_reviews.py
index c139015b94..bf29aa650a 100644
--- a/openedx/features/course_experience/views/course_reviews.py
+++ b/openedx/features/course_experience/views/course_reviews.py
@@ -17,7 +17,7 @@ from lms.djangoapps.courseware.courses import get_course_with_access
from lms.djangoapps.courseware.views.views import CourseTabView
from openedx.core.djangoapps.plugin_api.views import EdxFragmentView
from openedx.features.course_experience import default_course_url_name
-from student.models import CourseEnrollment
+from common.djangoapps.student.models import CourseEnrollment
class CourseReviewsView(CourseTabView):
diff --git a/openedx/features/course_experience/views/course_sock.py b/openedx/features/course_experience/views/course_sock.py
index ae06fd2995..a095ad0481 100644
--- a/openedx/features/course_experience/views/course_sock.py
+++ b/openedx/features/course_experience/views/course_sock.py
@@ -11,7 +11,7 @@ from lms.djangoapps.courseware.utils import (
)
from openedx.core.djangoapps.plugin_api.views import EdxFragmentView
from openedx.features.discounts.utils import format_strikeout_price
-from student.models import CourseEnrollment
+from common.djangoapps.student.models import CourseEnrollment
class CourseSockFragmentView(EdxFragmentView):
diff --git a/openedx/features/course_search/views/course_search.py b/openedx/features/course_search/views/course_search.py
index 036029ec95..5d7fe587ed 100644
--- a/openedx/features/course_search/views/course_search.py
+++ b/openedx/features/course_search/views/course_search.py
@@ -18,7 +18,7 @@ from lms.djangoapps.courseware.courses import get_course_overview_with_access
from lms.djangoapps.courseware.views.views import CourseTabView
from openedx.core.djangoapps.plugin_api.views import EdxFragmentView
from openedx.features.course_experience import default_course_url_name
-from util.views import ensure_valid_course_key
+from common.djangoapps.util.views import ensure_valid_course_key
class CourseSearchView(CourseTabView):
diff --git a/openedx/features/discounts/applicability.py b/openedx/features/discounts/applicability.py
index 9ca8331779..e1487f6ac0 100644
--- a/openedx/features/discounts/applicability.py
+++ b/openedx/features/discounts/applicability.py
@@ -18,13 +18,13 @@ from django.utils import timezone
from django.utils.dateparse import parse_datetime
from edx_toggles.toggles import WaffleFlag, WaffleFlagNamespace
-from course_modes.models import CourseMode
-from entitlements.models import CourseEntitlement
+from common.djangoapps.course_modes.models import CourseMode
+from common.djangoapps.entitlements.models import CourseEntitlement
from lms.djangoapps.experiments.models import ExperimentData
from lms.djangoapps.experiments.stable_bucketing import stable_bucketing_hash_group
from openedx.features.discounts.models import DiscountPercentageConfig, DiscountRestrictionConfig
-from student.models import CourseEnrollment
-from track import segment
+from common.djangoapps.student.models import CourseEnrollment
+from common.djangoapps.track import segment
# .. toggle_name: discounts.enable_discounting
# .. toggle_implementation: WaffleFlag
diff --git a/openedx/features/discounts/tests/test_applicability.py b/openedx/features/discounts/tests/test_applicability.py
index e79963b0fe..7ba7eaf9ef 100644
--- a/openedx/features/discounts/tests/test_applicability.py
+++ b/openedx/features/discounts/tests/test_applicability.py
@@ -13,14 +13,14 @@ from edx_toggles.toggles.testutils import override_waffle_flag
from enterprise.models import EnterpriseCustomer, EnterpriseCustomerUser
from mock import Mock, patch
-from course_modes.models import CourseMode
-from course_modes.tests.factories import CourseModeFactory
-from entitlements.tests.factories import CourseEntitlementFactory
+from common.djangoapps.course_modes.models import CourseMode
+from common.djangoapps.course_modes.tests.factories import CourseModeFactory
+from common.djangoapps.entitlements.tests.factories import CourseEntitlementFactory
from lms.djangoapps.experiments.models import ExperimentData
from openedx.core.djangoapps.content.course_overviews.models import CourseOverview
from openedx.features.discounts.models import DiscountRestrictionConfig
from openedx.features.discounts.utils import REV1008_EXPERIMENT_ID
-from student.tests.factories import CourseEnrollmentFactory, UserFactory
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory, UserFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/openedx/features/discounts/tests/test_discount_restriction_models.py b/openedx/features/discounts/tests/test_discount_restriction_models.py
index 1288d202e3..8e7efcb093 100644
--- a/openedx/features/discounts/tests/test_discount_restriction_models.py
+++ b/openedx/features/discounts/tests/test_discount_restriction_models.py
@@ -11,7 +11,7 @@ from openedx.core.djangoapps.content.course_overviews.tests.factories import Cou
from openedx.core.djangoapps.site_configuration.tests.factories import SiteConfigurationFactory
from openedx.core.djangolib.testing.utils import CacheIsolationTestCase
from openedx.features.discounts.models import DiscountRestrictionConfig
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
@ddt.ddt
diff --git a/openedx/features/discounts/tests/test_views.py b/openedx/features/discounts/tests/test_views.py
index da29f4200e..9bf92678a6 100644
--- a/openedx/features/discounts/tests/test_views.py
+++ b/openedx/features/discounts/tests/test_views.py
@@ -7,7 +7,7 @@ import six
from django.test.client import Client
from django.urls import reverse
-from student.tests.factories import TEST_PASSWORD, UserFactory
+from common.djangoapps.student.tests.factories import TEST_PASSWORD, UserFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/openedx/features/discounts/utils.py b/openedx/features/discounts/utils.py
index 22e188a903..0352a91725 100644
--- a/openedx/features/discounts/utils.py
+++ b/openedx/features/discounts/utils.py
@@ -11,7 +11,7 @@ from django.utils.translation import ugettext as _
from edx_django_utils.cache import RequestCache
from web_fragments.fragment import Fragment
-from course_modes.models import format_course_price, get_course_prices
+from common.djangoapps.course_modes.models import format_course_price, get_course_prices
from lms.djangoapps.experiments.models import ExperimentData
from lms.djangoapps.courseware.utils import verified_upgrade_deadline_link
from openedx.core.djangoapps.content.course_overviews.models import CourseOverview
diff --git a/openedx/features/enterprise_support/admin/views.py b/openedx/features/enterprise_support/admin/views.py
index 838d22fbc3..9238caaea3 100644
--- a/openedx/features/enterprise_support/admin/views.py
+++ b/openedx/features/enterprise_support/admin/views.py
@@ -9,7 +9,7 @@ from django.views.generic.edit import FormView
from enterprise.models import EnterpriseCourseEnrollment
from openedx.features.enterprise_support.admin.forms import CSVImportForm
-from student.models import CourseEnrollment, CourseEnrollmentAttribute
+from common.djangoapps.student.models import CourseEnrollment, CourseEnrollmentAttribute
class EnrollmentAttributeOverrideView(FormView):
diff --git a/openedx/features/enterprise_support/api.py b/openedx/features/enterprise_support/api.py
index febe4a6d96..ceaff8ffb8 100644
--- a/openedx/features/enterprise_support/api.py
+++ b/openedx/features/enterprise_support/api.py
@@ -25,8 +25,8 @@ from openedx.core.djangoapps.oauth_dispatch.jwt import create_jwt_for_user
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
from openedx.core.djangolib.markup import HTML, Text
from openedx.features.enterprise_support.utils import get_data_consent_share_cache_key
-from third_party_auth.pipeline import get as get_partial_pipeline
-from third_party_auth.provider import Registry
+from common.djangoapps.third_party_auth.pipeline import get as get_partial_pipeline
+from common.djangoapps.third_party_auth.provider import Registry
try:
from enterprise.models import (
diff --git a/openedx/features/enterprise_support/signals.py b/openedx/features/enterprise_support/signals.py
index d41203c170..7d7f472aea 100644
--- a/openedx/features/enterprise_support/signals.py
+++ b/openedx/features/enterprise_support/signals.py
@@ -20,7 +20,7 @@ from openedx.core.djangoapps.signals.signals import COURSE_GRADE_NOW_PASSED
from openedx.features.enterprise_support.api import enterprise_enabled
from openedx.features.enterprise_support.tasks import clear_enterprise_customer_data_consent_share_cache
from openedx.features.enterprise_support.utils import clear_data_consent_share_cache, is_enterprise_learner
-from student.signals import UNENROLL_DONE
+from common.djangoapps.student.signals import UNENROLL_DONE
log = logging.getLogger(__name__)
diff --git a/openedx/features/enterprise_support/tests/test_admin.py b/openedx/features/enterprise_support/tests/test_admin.py
index d47dd29fc6..5519961c0d 100644
--- a/openedx/features/enterprise_support/tests/test_admin.py
+++ b/openedx/features/enterprise_support/tests/test_admin.py
@@ -12,8 +12,8 @@ from django.urls import reverse
from openedx.core.djangoapps.catalog.tests.factories import CourseRunFactory
from openedx.features.enterprise_support.admin.forms import CSVImportForm
-from student.models import CourseEnrollment, CourseEnrollmentAttribute
-from student.tests.factories import TEST_PASSWORD, AdminFactory, CourseEnrollmentFactory, UserFactory
+from common.djangoapps.student.models import CourseEnrollment, CourseEnrollmentAttribute
+from common.djangoapps.student.tests.factories import TEST_PASSWORD, AdminFactory, CourseEnrollmentFactory, UserFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
diff --git a/openedx/features/enterprise_support/tests/test_api.py b/openedx/features/enterprise_support/tests/test_api.py
index 9916adc7bf..453ff00613 100644
--- a/openedx/features/enterprise_support/tests/test_api.py
+++ b/openedx/features/enterprise_support/tests/test_api.py
@@ -45,7 +45,7 @@ from openedx.features.enterprise_support.tests.factories import (
)
from openedx.features.enterprise_support.tests.mixins.enterprise import EnterpriseServiceMockMixin
from openedx.features.enterprise_support.utils import clear_data_consent_share_cache
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
class MockEnrollment(mock.MagicMock):
diff --git a/openedx/features/enterprise_support/tests/test_logout.py b/openedx/features/enterprise_support/tests/test_logout.py
index ddd82ec5be..ec1c9792aa 100644
--- a/openedx/features/enterprise_support/tests/test_logout.py
+++ b/openedx/features/enterprise_support/tests/test_logout.py
@@ -17,8 +17,8 @@ from openedx.features.enterprise_support.tests import (
factories
)
from openedx.features.enterprise_support.tests.mixins.enterprise import EnterpriseServiceMockMixin
-from student.tests.factories import UserFactory
-from util.testing import UrlResetMixin
+from common.djangoapps.student.tests.factories import UserFactory
+from common.djangoapps.util.testing import UrlResetMixin
@ddt.ddt
diff --git a/openedx/features/enterprise_support/tests/test_signals.py b/openedx/features/enterprise_support/tests/test_signals.py
index ae4bdf53c1..b45f4d5c68 100644
--- a/openedx/features/enterprise_support/tests/test_signals.py
+++ b/openedx/features/enterprise_support/tests/test_signals.py
@@ -13,7 +13,7 @@ from opaque_keys.edx.keys import CourseKey
from slumber.exceptions import HttpClientError, HttpServerError
from testfixtures import LogCapture
-from course_modes.tests.factories import CourseModeFactory
+from common.djangoapps.course_modes.tests.factories import CourseModeFactory
from lms.djangoapps.certificates.signals import listen_for_passing_grade
from openedx.core.djangoapps.commerce.utils import ECOMMERCE_DATE_FORMAT
from openedx.core.djangoapps.credit.tests.test_api import TEST_ECOMMERCE_WORKER
@@ -25,8 +25,8 @@ from openedx.features.enterprise_support.tests.factories import (
EnterpriseCustomerUserFactory
)
from openedx.features.enterprise_support.utils import get_data_consent_share_cache_key
-from student.models import CourseEnrollmentAttribute
-from student.tests.factories import CourseEnrollmentFactory, UserFactory
+from common.djangoapps.student.models import CourseEnrollmentAttribute
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory, UserFactory
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/openedx/features/enterprise_support/tests/test_utils.py b/openedx/features/enterprise_support/tests/test_utils.py
index 3c8b106f82..27a38eb5a6 100644
--- a/openedx/features/enterprise_support/tests/test_utils.py
+++ b/openedx/features/enterprise_support/tests/test_utils.py
@@ -17,7 +17,7 @@ from openedx.features.enterprise_support.tests.factories import (
EnterpriseCustomerUserFactory
)
from openedx.features.enterprise_support.utils import ENTERPRISE_HEADER_LINKS, get_enterprise_learner_portal
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
@ddt.ddt
diff --git a/openedx/features/enterprise_support/utils.py b/openedx/features/enterprise_support/utils.py
index 4acbc4d299..ca7dcaa460 100644
--- a/openedx/features/enterprise_support/utils.py
+++ b/openedx/features/enterprise_support/utils.py
@@ -15,12 +15,12 @@ from enterprise.api.v1.serializers import EnterpriseCustomerBrandingConfiguratio
from enterprise.models import EnterpriseCustomer, EnterpriseCustomerUser
from social_django.models import UserSocialAuth
-import third_party_auth
+from common.djangoapps import third_party_auth
from lms.djangoapps.branding.api import get_privacy_url
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
from openedx.core.djangoapps.user_authn.cookies import standard_cookie_settings
from openedx.core.djangolib.markup import HTML, Text
-from student.helpers import get_next_url_for_login_page
+from common.djangoapps.student.helpers import get_next_url_for_login_page
ENTERPRISE_HEADER_LINKS = WaffleFlag('enterprise', 'enterprise_header_links', __name__)
diff --git a/openedx/features/learner_profile/static/learner_profile/templates/third_party_auth.html b/openedx/features/learner_profile/static/learner_profile/templates/third_party_auth.html
index 170bde10a9..e8ed1b1230 100644
--- a/openedx/features/learner_profile/static/learner_profile/templates/third_party_auth.html
+++ b/openedx/features/learner_profile/static/learner_profile/templates/third_party_auth.html
@@ -1,7 +1,7 @@
<%page expression_filter="h"/>
<%!
from django.utils.translation import ugettext as _
-from third_party_auth import pipeline
+from common.djangoapps.third_party_auth import pipeline
%>
diff --git a/openedx/features/learner_profile/tests/views/test_learner_profile.py b/openedx/features/learner_profile/tests/views/test_learner_profile.py
index 64e841e282..1863e56f35 100644
--- a/openedx/features/learner_profile/tests/views/test_learner_profile.py
+++ b/openedx/features/learner_profile/tests/views/test_learner_profile.py
@@ -13,7 +13,7 @@ from django.urls import reverse
from edx_toggles.toggles.testutils import override_waffle_flag
from opaque_keys.edx.locator import CourseLocator
-from course_modes.models import CourseMode
+from common.djangoapps.course_modes.models import CourseMode
from lms.djangoapps.certificates.api import is_passing_status
from lms.djangoapps.certificates.tests.factories import GeneratedCertificateFactory
from lms.envs.test import CREDENTIALS_PUBLIC_SERVICE_URL
@@ -21,8 +21,8 @@ from openedx.core.djangoapps.content.course_overviews.models import CourseOvervi
from openedx.core.djangoapps.site_configuration.tests.mixins import SiteMixin
from openedx.features.learner_profile.toggles import REDIRECT_TO_PROFILE_MICROFRONTEND
from openedx.features.learner_profile.views.learner_profile import learner_profile_context
-from student.tests.factories import CourseEnrollmentFactory, UserFactory
-from util.testing import UrlResetMixin
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory, UserFactory
+from common.djangoapps.util.testing import UrlResetMixin
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
diff --git a/openedx/features/learner_profile/views/learner_profile.py b/openedx/features/learner_profile/views/learner_profile.py
index 6be0cf68b5..807ad82c80 100644
--- a/openedx/features/learner_profile/views/learner_profile.py
+++ b/openedx/features/learner_profile/views/learner_profile.py
@@ -13,7 +13,7 @@ from django.views.decorators.http import require_http_methods
from django_countries import countries
from lms.djangoapps.badges.utils import badges_enabled
-from edxmako.shortcuts import marketing_link
+from common.djangoapps.edxmako.shortcuts import marketing_link
from openedx.core.djangoapps.credentials.utils import get_credentials_records_url
from openedx.core.djangoapps.programs.models import ProgramsApiConfig
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
@@ -23,7 +23,7 @@ from openedx.core.djangoapps.user_api.preferences.api import get_user_preference
from openedx.core.djangolib.markup import HTML, Text
from openedx.features.learner_profile.toggles import should_redirect_to_profile_microfrontend
from openedx.features.learner_profile.views.learner_achievements import LearnerAchievementsFragmentView
-from student.models import User
+from common.djangoapps.student.models import User
@login_required
diff --git a/openedx/tests/completion_integration/test_models.py b/openedx/tests/completion_integration/test_models.py
index 8bf85f8564..6de84230c2 100644
--- a/openedx/tests/completion_integration/test_models.py
+++ b/openedx/tests/completion_integration/test_models.py
@@ -14,7 +14,7 @@ from opaque_keys.edx.keys import CourseKey, UsageKey
from six.moves import range, zip
from openedx.core.djangolib.testing.utils import skip_unless_lms
-from student.tests.factories import CourseEnrollmentFactory, UserFactory
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory, UserFactory
SELECT = 1
UPDATE = 1
diff --git a/openedx/tests/completion_integration/test_services.py b/openedx/tests/completion_integration/test_services.py
index 6dfa658afb..dcdc07e37c 100644
--- a/openedx/tests/completion_integration/test_services.py
+++ b/openedx/tests/completion_integration/test_services.py
@@ -11,7 +11,7 @@ from opaque_keys.edx.keys import CourseKey
from six.moves import range
from openedx.core.djangolib.testing.utils import skip_unless_lms
-from student.tests.factories import UserFactory
+from common.djangoapps.student.tests.factories import UserFactory
from xmodule.library_tools import LibraryToolsService
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase, TEST_DATA_SPLIT_MODULESTORE
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory, LibraryFactory
diff --git a/openedx/tests/completion_integration/test_views.py b/openedx/tests/completion_integration/test_views.py
index fa3fdde5e7..2ffcd87344 100644
--- a/openedx/tests/completion_integration/test_views.py
+++ b/openedx/tests/completion_integration/test_views.py
@@ -13,7 +13,7 @@ from edx_toggles.toggles.testutils import override_waffle_switch
from rest_framework.test import APIClient
from openedx.core.djangolib.testing.utils import skip_unless_lms
-from student.tests.factories import CourseEnrollmentFactory, UserFactory
+from common.djangoapps.student.tests.factories import CourseEnrollmentFactory, UserFactory
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
diff --git a/openedx/tests/settings.py b/openedx/tests/settings.py
index f3531473fc..80534cc629 100644
--- a/openedx/tests/settings.py
+++ b/openedx/tests/settings.py
@@ -10,11 +10,6 @@ import tempfile
from django.utils.translation import ugettext_lazy as _
from path import Path
-# TODO: Remove the rest of the sys.path modification here and in (cms|lms)/envs/common.py
-REPO_ROOT = Path(__file__).abspath().dirname().dirname().dirname() # /edx-platform/
-sys.path.append(REPO_ROOT / 'common' / 'djangoapps')
-sys.path.append(REPO_ROOT / 'import_shims' / 'lms')
-
ALL_LANGUAGES = []
BLOCK_STRUCTURES_SETTINGS = dict(
@@ -72,12 +67,12 @@ INSTALLED_APPS = (
'edxval',
'lms.djangoapps.courseware',
'lms.djangoapps.instructor_task',
- 'student',
+ 'common.djangoapps.student',
'openedx.core.djangoapps.site_configuration',
'lms.djangoapps.grades.apps.GradesConfig',
'lms.djangoapps.certificates.apps.CertificatesConfig',
'openedx.core.djangoapps.user_api',
- 'course_modes.apps.CourseModesConfig',
+ 'common.djangoapps.course_modes.apps.CourseModesConfig',
'lms.djangoapps.verify_student.apps.VerifyStudentConfig',
'openedx.core.djangoapps.content_libraries',
'openedx.core.djangoapps.dark_lang',
@@ -102,7 +97,7 @@ INSTALLED_APPS = (
# Django 1.11 demands to have imported models supported by installed apps.
'completion',
- 'entitlements',
+ 'common.djangoapps.entitlements',
'organizations',
)
diff --git a/pylintrc b/pylintrc
index 8ca77c0a5d..6f914cc425 100644
--- a/pylintrc
+++ b/pylintrc
@@ -71,7 +71,8 @@
ignore = ,.git,.tox,migrations,node_modules,.pycharm_helpers
persistent = yes
load-plugins = edx_lint.pylint,pylint_django,pylint_celery
-init-hook = "import sys; sys.path.extend(['import_shims/lms', 'import_shims/studio', 'common/djangoapps'])"
+init-hook = "import sys; sys.path.extend(['import_shims/lms', 'import_shims/studio'])"
+ignore-patterns = **/import_shims/**/*.py
[MESSAGES CONTROL]
enable =
@@ -464,4 +465,4 @@ int-import-graph =
[EXCEPTIONS]
overgeneral-exceptions = Exception
-# 1c68aee72f4071c31e5303be5610497ef5e64b7c
+# 09e2946a83274f8dccbac8e284d7b1cf381fa31b
diff --git a/pylintrc_tweaks b/pylintrc_tweaks
index b3feedfaa1..eebf6203e7 100644
--- a/pylintrc_tweaks
+++ b/pylintrc_tweaks
@@ -1,7 +1,11 @@
# pylintrc tweaks for use with edx_lint.
[MASTER]
ignore+ = ,.git,.tox,migrations,node_modules,.pycharm_helpers
-init-hook="import sys; sys.path.extend(['import_shims/lms', 'import_shims/studio', 'common/djangoapps'])"
+# TODO: This path modification exists as temporary support for deprecated import patterns.
+# It will be removed in an upcoming Open edX release.
+# See docs/decisions/0007-sys-path-modification-removal.rst
+init-hook="import sys; sys.path.extend(['import_shims/lms', 'import_shims/studio'])"
+ignore-patterns=**/import_shims/**/*.py
[MESSAGES CONTROL]
disable+ =
diff --git a/scripts/xsslint_config.py b/scripts/xsslint_config.py
index beb11e55d6..b45684cb78 100644
--- a/scripts/xsslint_config.py
+++ b/scripts/xsslint_config.py
@@ -29,6 +29,7 @@ SKIP_DIRS = (
'spec',
'test_root',
'vendor',
+ 'import_shims',
)
diff --git a/themes/edx.org/lms/templates/dashboard.html b/themes/edx.org/lms/templates/dashboard.html
index f0f40fd117..ae75ebce28 100644
--- a/themes/edx.org/lms/templates/dashboard.html
+++ b/themes/edx.org/lms/templates/dashboard.html
@@ -11,17 +11,17 @@ from datetime import datetime, timedelta
from django.utils import timezone
from django.utils.translation import ugettext as _
from django.template import RequestContext
-from third_party_auth import pipeline
+from common.djangoapps.third_party_auth import pipeline
from django.urls import reverse
-from util.date_utils import strftime_localized
+from common.djangoapps.date_utils import strftime_localized
from opaque_keys.edx.keys import CourseKey
from openedx.core.djangoapps.content.course_overviews.models import CourseOverview
from openedx.core.djangoapps.theming import helpers as theming_helpers
from openedx.core.djangolib.js_utils import dump_js_escaped_json, js_escaped_string
from openedx.core.djangolib.markup import HTML, Text
-from entitlements.models import CourseEntitlement
-from student.models import CourseEnrollment
+from common.djangoapps.entitlements.models import CourseEntitlement
+from common.djangoapps.student.models import CourseEnrollment
%>
<%
diff --git a/themes/stanford-style/lms/templates/register-form.html b/themes/stanford-style/lms/templates/register-form.html
index 735f48df38..ce3234f5fb 100644
--- a/themes/stanford-style/lms/templates/register-form.html
+++ b/themes/stanford-style/lms/templates/register-form.html
@@ -1,11 +1,11 @@
## xss-lint: disable=mako-missing-default
<%!
-import third_party_auth
+from common.djangoapps import third_party_auth
import six
-from third_party_auth import pipeline, provider
+from common.djangoapps.third_party_auth import pipeline, provider
from django.utils.translation import ugettext as _
from django_countries import countries
-from student.models import UserProfile
+from common.djangoapps.student.models import UserProfile
%>