diff --git a/openedx/features/calendar_sync/tests/test_api.py b/openedx/features/calendar_sync/tests/test_api.py index 2a06762d21..331aa2b9ba 100644 --- a/openedx/features/calendar_sync/tests/test_api.py +++ b/openedx/features/calendar_sync/tests/test_api.py @@ -4,8 +4,8 @@ from common.djangoapps.student.tests.factories import UserFactory from openedx.features.calendar_sync.api import subscribe_user_to_calendar, unsubscribe_user_to_calendar from openedx.features.calendar_sync.models import UserCalendarSyncConfig -from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase -from xmodule.modulestore.tests.factories import CourseFactory +from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.tests.factories import CourseFactory # lint-amnesty, pylint: disable=wrong-import-order TEST_PASSWORD = 'test' diff --git a/openedx/features/calendar_sync/tests/test_models.py b/openedx/features/calendar_sync/tests/test_models.py index 29a8926b86..e64ef5bd37 100644 --- a/openedx/features/calendar_sync/tests/test_models.py +++ b/openedx/features/calendar_sync/tests/test_models.py @@ -3,8 +3,8 @@ from common.djangoapps.student.tests.factories import UserFactory from openedx.features.calendar_sync.models import UserCalendarSyncConfig -from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase -from xmodule.modulestore.tests.factories import CourseFactory +from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.tests.factories import CourseFactory # lint-amnesty, pylint: disable=wrong-import-order TEST_PASSWORD = 'test' diff --git a/openedx/features/calendar_sync/tests/test_plugins.py b/openedx/features/calendar_sync/tests/test_plugins.py index 7705d2c4d1..2f2fba4045 100644 --- a/openedx/features/calendar_sync/tests/test_plugins.py +++ b/openedx/features/calendar_sync/tests/test_plugins.py @@ -10,8 +10,8 @@ from edx_toggles.toggles.testutils import override_waffle_flag from openedx.features.calendar_sync.plugins import CalendarSyncToggleTool from openedx.features.course_experience import CALENDAR_SYNC_FLAG, RELATIVE_DATES_FLAG -from xmodule.modulestore.tests.django_utils import CourseUserType, SharedModuleStoreTestCase -from xmodule.modulestore.tests.factories import CourseFactory +from xmodule.modulestore.tests.django_utils import CourseUserType, SharedModuleStoreTestCase # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.tests.factories import CourseFactory # lint-amnesty, pylint: disable=wrong-import-order @ddt.ddt diff --git a/openedx/features/calendar_sync/tests/test_views.py b/openedx/features/calendar_sync/tests/test_views.py index 175c2947f4..0b566aeb1a 100644 --- a/openedx/features/calendar_sync/tests/test_views.py +++ b/openedx/features/calendar_sync/tests/test_views.py @@ -8,8 +8,8 @@ from django.test import TestCase from django.urls import reverse from openedx.features.calendar_sync.api import SUBSCRIBE, UNSUBSCRIBE -from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase -from xmodule.modulestore.tests.factories import CourseFactory +from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.tests.factories import CourseFactory # lint-amnesty, pylint: disable=wrong-import-order TEST_PASSWORD = 'test' diff --git a/openedx/features/content_type_gating/helpers.py b/openedx/features/content_type_gating/helpers.py index 6a78eae635..05323d7c57 100644 --- a/openedx/features/content_type_gating/helpers.py +++ b/openedx/features/content_type_gating/helpers.py @@ -10,7 +10,7 @@ from common.djangoapps.course_modes.models import CourseMode from openedx.core.djangoapps.config_model_utils.utils import is_in_holdback from common.djangoapps.student.models import CourseEnrollment from common.djangoapps.student.role_helpers import has_staff_roles -from xmodule.partitions.partitions import Group +from xmodule.partitions.partitions import Group # lint-amnesty, pylint: disable=wrong-import-order # Studio generates partition IDs starting at 100. There is already a manually generated # partition for Enrollment Track that uses ID 50, so we'll use 51. diff --git a/openedx/features/content_type_gating/partitions.py b/openedx/features/content_type_gating/partitions.py index fc3eef08b0..5f48ab6091 100644 --- a/openedx/features/content_type_gating/partitions.py +++ b/openedx/features/content_type_gating/partitions.py @@ -22,7 +22,7 @@ from openedx.core.lib.mobile_utils import is_request_from_mobile_app 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.discounts.utils import format_strikeout_price -from xmodule.partitions.partitions import UserPartition, UserPartitionError +from xmodule.partitions.partitions import UserPartition, UserPartitionError # lint-amnesty, pylint: disable=wrong-import-order LOG = logging.getLogger(__name__) diff --git a/openedx/features/content_type_gating/tests/test_access.py b/openedx/features/content_type_gating/tests/test_access.py index d69b0c69b8..4f871f2499 100644 --- a/openedx/features/content_type_gating/tests/test_access.py +++ b/openedx/features/content_type_gating/tests/test_access.py @@ -11,7 +11,7 @@ from django.test.utils import override_settings from django.urls import reverse from django.utils import timezone from django.contrib.auth import get_user_model -from unittest.mock import patch, Mock +from unittest.mock import patch, Mock # lint-amnesty, pylint: disable=wrong-import-order from pyquery import PyQuery as pq from lms.djangoapps.course_api.blocks.api import get_blocks @@ -42,9 +42,9 @@ from openedx.features.content_type_gating.services import ContentTypeGatingServi 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 +from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, SharedModuleStoreTestCase # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.partitions.partitions import ENROLLMENT_TRACK_PARTITION_ID # lint-amnesty, pylint: disable=wrong-import-order METADATA = { 'group_access': { diff --git a/openedx/features/content_type_gating/tests/test_models.py b/openedx/features/content_type_gating/tests/test_models.py index 714af0b791..673ce805a7 100644 --- a/openedx/features/content_type_gating/tests/test_models.py +++ b/openedx/features/content_type_gating/tests/test_models.py @@ -2,14 +2,14 @@ import pytest -import itertools -from datetime import datetime, timedelta +import itertools # lint-amnesty, pylint: disable=wrong-import-order +from datetime import datetime, timedelta # lint-amnesty, pylint: disable=wrong-import-order import ddt import pytz from django.utils import timezone from edx_django_utils.cache import RequestCache -from unittest.mock import Mock +from unittest.mock import Mock # lint-amnesty, pylint: disable=wrong-import-order from opaque_keys.edx.locator import CourseLocator from common.djangoapps.course_modes.tests.factories import CourseModeFactory diff --git a/openedx/features/content_type_gating/tests/test_partitions.py b/openedx/features/content_type_gating/tests/test_partitions.py index 7c4448c1e2..aba6914a56 100644 --- a/openedx/features/content_type_gating/tests/test_partitions.py +++ b/openedx/features/content_type_gating/tests/test_partitions.py @@ -1,7 +1,7 @@ # pylint: disable=missing-module-docstring from datetime import datetime from django.test import RequestFactory -from unittest.mock import Mock, patch +from unittest.mock import Mock, patch # lint-amnesty, pylint: disable=wrong-import-order from opaque_keys.edx.keys import CourseKey from common.djangoapps.course_modes.tests.factories import CourseModeFactory @@ -11,7 +11,7 @@ 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 create_content_gating_partition from openedx.core.djangoapps.content.course_overviews.tests.factories import CourseOverviewFactory -from xmodule.partitions.partitions import UserPartitionError +from xmodule.partitions.partitions import UserPartitionError # lint-amnesty, pylint: disable=wrong-import-order class TestContentTypeGatingPartition(CacheIsolationTestCase): # pylint: disable=missing-class-docstring 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 ad0685e795..73a77006cc 100644 --- a/openedx/features/course_experience/api/v1/tests/test_views.py +++ b/openedx/features/course_experience/api/v1/tests/test_views.py @@ -13,7 +13,7 @@ from common.djangoapps.util.testing import EventTestMixin from lms.djangoapps.courseware.tests.helpers import MasqueradeMixin from lms.djangoapps.course_home_api.tests.utils import BaseCourseHomeTests from openedx.core.djangoapps.schedules.models import Schedule -from xmodule.modulestore.tests.factories import CourseFactory +from xmodule.modulestore.tests.factories import CourseFactory # lint-amnesty, pylint: disable=wrong-import-order @ddt.ddt diff --git a/openedx/features/course_experience/tests/__init__.py b/openedx/features/course_experience/tests/__init__.py index 7eb664cf7a..4b93ba9251 100644 --- a/openedx/features/course_experience/tests/__init__.py +++ b/openedx/features/course_experience/tests/__init__.py @@ -5,11 +5,11 @@ Common test code for course_experience, like shared base classes. from common.djangoapps.student.models import CourseEnrollment from common.djangoapps.student.tests.factories import UserFactory from lms.djangoapps.courseware.courses import get_course_info_usage_key -from xmodule.modulestore import ModuleStoreEnum -from xmodule.modulestore.django import modulestore -from xmodule.modulestore.exceptions import ItemNotFoundError -from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase -from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory +from xmodule.modulestore import ModuleStoreEnum # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.exceptions import ItemNotFoundError # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory # lint-amnesty, pylint: disable=wrong-import-order class BaseCourseUpdatesTestCase(SharedModuleStoreTestCase): 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 3a5b794e33..404ad6bc63 100644 --- a/openedx/features/course_experience/tests/views/test_course_dates.py +++ b/openedx/features/course_experience/tests/views/test_course_dates.py @@ -9,9 +9,9 @@ import six # lint-amnesty, pylint: disable=unused-import from django.urls import reverse 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 +from xmodule.modulestore import ModuleStoreEnum # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.tests.factories import CourseFactory # lint-amnesty, pylint: disable=wrong-import-order TEST_PASSWORD = 'test' 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 ab26574e04..e0d56a221e 100644 --- a/openedx/features/course_experience/tests/views/test_course_home.py +++ b/openedx/features/course_experience/tests/views/test_course_home.py @@ -55,10 +55,10 @@ from openedx.features.course_experience.tests.views.helpers import add_course_mo 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 -from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory, check_mongo_calls +from xmodule.course_module import COURSE_VISIBILITY_PRIVATE, COURSE_VISIBILITY_PUBLIC, COURSE_VISIBILITY_PUBLIC_OUTLINE # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore import ModuleStoreEnum # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.tests.django_utils import CourseUserType, ModuleStoreTestCase # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory, check_mongo_calls # lint-amnesty, pylint: disable=wrong-import-order TEST_PASSWORD = 'test' TEST_CHAPTER_NAME = 'Test Chapter' 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 2f3ae07507..34856dc853 100644 --- a/openedx/features/course_experience/tests/views/test_course_outline.py +++ b/openedx/features/course_experience/tests/views/test_course_outline.py @@ -41,9 +41,9 @@ from openedx.features.course_experience.views.course_outline import ( ) 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 +from xmodule.modulestore import ModuleStoreEnum # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory # lint-amnesty, pylint: disable=wrong-import-order from ...utils import get_course_outline_block_tree from .test_course_home import course_home_url 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 77db02e06f..ca93a073bb 100644 --- a/openedx/features/course_experience/tests/views/test_course_sock.py +++ b/openedx/features/course_experience/tests/views/test_course_sock.py @@ -13,8 +13,8 @@ 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 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.modulestore.tests.django_utils import SharedModuleStoreTestCase # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.tests.factories import CourseFactory # lint-amnesty, pylint: disable=wrong-import-order from .helpers import add_course_mode from .test_course_home import course_home_url 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 5f651937a4..3489cd7695 100644 --- a/openedx/features/course_experience/tests/views/test_course_updates.py +++ b/openedx/features/course_experience/tests/views/test_course_updates.py @@ -10,7 +10,7 @@ from pytz import UTC from openedx.core.djangoapps.waffle_utils.testutils import WAFFLE_TABLES from openedx.features.content_type_gating.models import ContentTypeGatingConfig from openedx.features.course_experience.tests import BaseCourseUpdatesTestCase -from xmodule.modulestore.tests.factories import check_mongo_calls +from xmodule.modulestore.tests.factories import check_mongo_calls # lint-amnesty, pylint: disable=wrong-import-order QUERY_COUNT_TABLE_BLACKLIST = WAFFLE_TABLES diff --git a/openedx/features/course_experience/tests/views/test_masquerade.py b/openedx/features/course_experience/tests/views/test_masquerade.py index b0c6c1c82e..df45128b87 100644 --- a/openedx/features/course_experience/tests/views/test_masquerade.py +++ b/openedx/features/course_experience/tests/views/test_masquerade.py @@ -7,10 +7,10 @@ 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 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 -from xmodule.partitions.partitions_service import PartitionService +from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.tests.factories import CourseFactory # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.partitions.partitions import ENROLLMENT_TRACK_PARTITION_ID # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.partitions.partitions_service import PartitionService # lint-amnesty, pylint: disable=wrong-import-order from .helpers import add_course_mode from .test_course_home import course_home_url diff --git a/openedx/features/course_experience/url_helpers.py b/openedx/features/course_experience/url_helpers.py index ecc5515f89..17cade52ce 100644 --- a/openedx/features/course_experience/url_helpers.py +++ b/openedx/features/course_experience/url_helpers.py @@ -16,8 +16,8 @@ from opaque_keys.edx.keys import CourseKey, UsageKey from six.moves.urllib.parse import urlencode, urlparse from lms.djangoapps.courseware.toggles import courseware_mfe_is_active -from xmodule.modulestore.django import modulestore -from xmodule.modulestore.search import navigation_index, path_to_location +from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.search import navigation_index, path_to_location # lint-amnesty, pylint: disable=wrong-import-order User = get_user_model() diff --git a/openedx/features/course_experience/utils.py b/openedx/features/course_experience/utils.py index b3dbbfae20..031e1d1f05 100644 --- a/openedx/features/course_experience/utils.py +++ b/openedx/features/course_experience/utils.py @@ -11,7 +11,7 @@ from openedx.core.djangoapps.content.course_overviews.models import CourseOvervi from openedx.core.lib.cache_utils import request_cached from openedx.features.course_experience import RELATIVE_DATES_FLAG from common.djangoapps.student.models import CourseEnrollment -from xmodule.modulestore.django import modulestore +from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-order @request_cached() diff --git a/openedx/features/course_experience/views/course_home.py b/openedx/features/course_experience/views/course_home.py index 02d6eb2c31..ef76fccdc9 100644 --- a/openedx/features/course_experience/views/course_home.py +++ b/openedx/features/course_experience/views/course_home.py @@ -46,7 +46,7 @@ from openedx.features.course_experience.views.welcome_message import WelcomeMess from openedx.features.discounts.utils import format_strikeout_price 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 xmodule.course_module import COURSE_VISIBILITY_PUBLIC, COURSE_VISIBILITY_PUBLIC_OUTLINE # lint-amnesty, pylint: disable=wrong-import-order EMPTY_HANDOUTS_HTML = '
    ' diff --git a/openedx/features/course_experience/views/course_home_messages.py b/openedx/features/course_experience/views/course_home_messages.py index 38256d5583..dd8c2e5824 100644 --- a/openedx/features/course_experience/views/course_home_messages.py +++ b/openedx/features/course_experience/views/course_home_messages.py @@ -31,7 +31,7 @@ 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 common.djangoapps.student.models import CourseEnrollment -from xmodule.course_module import COURSE_VISIBILITY_PUBLIC +from xmodule.course_module import COURSE_VISIBILITY_PUBLIC # lint-amnesty, pylint: disable=wrong-import-order class CourseHomeMessageFragmentView(EdxFragmentView): diff --git a/openedx/features/course_experience/views/course_outline.py b/openedx/features/course_experience/views/course_outline.py index 4f5dc03fbc..bb9444d7be 100644 --- a/openedx/features/course_experience/views/course_outline.py +++ b/openedx/features/course_experience/views/course_outline.py @@ -22,8 +22,8 @@ from openedx.core.djangoapps.plugin_api.views import EdxFragmentView from openedx.features.course_experience.utils import dates_banner_should_display 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 +from xmodule.course_module import COURSE_VISIBILITY_PUBLIC # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-order from ..utils import get_course_outline_block_tree, get_resume_block