Merge pull request #29439 from edx/jawayria/bom-2606-39

chore: Applied lint-amnesty on openedx/features
This commit is contained in:
Jawayria
2021-12-06 17:23:30 +05:00
committed by GitHub
22 changed files with 49 additions and 49 deletions

View File

@@ -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'

View File

@@ -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'

View File

@@ -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

View File

@@ -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'

View File

@@ -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.

View File

@@ -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__)

View File

@@ -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': {

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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):

View File

@@ -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'

View File

@@ -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'

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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()

View File

@@ -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()

View File

@@ -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 = '<ol></ol>'

View File

@@ -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):

View File

@@ -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