From 5c9613bafd0304e5cec924704dac7e9d861196df Mon Sep 17 00:00:00 2001 From: Jawayria Date: Mon, 22 Nov 2021 15:29:38 +0500 Subject: [PATCH] chore: Applied lint-amnesty on lms/djangoapps/{ccx, commerce} --- lms/djangoapps/ccx/api/v0/views.py | 2 +- lms/djangoapps/ccx/plugins.py | 2 +- lms/djangoapps/ccx/tasks.py | 2 +- lms/djangoapps/ccx/tests/test_ccx_modulestore.py | 4 ++-- .../ccx/tests/test_field_override_performance.py | 6 +++--- lms/djangoapps/ccx/tests/test_models.py | 4 ++-- lms/djangoapps/ccx/tests/test_overrides.py | 4 ++-- lms/djangoapps/ccx/tests/test_tasks.py | 6 +++--- lms/djangoapps/ccx/tests/test_utils.py | 6 +++--- lms/djangoapps/ccx/tests/test_views.py | 10 +++++----- lms/djangoapps/ccx/tests/utils.py | 6 +++--- lms/djangoapps/ccx/views.py | 2 +- lms/djangoapps/commerce/api/v0/tests/test_views.py | 6 +++--- lms/djangoapps/commerce/api/v1/serializers.py | 2 +- lms/djangoapps/commerce/api/v1/tests/test_views.py | 4 ++-- lms/djangoapps/commerce/tests/test_utils.py | 4 ++-- 16 files changed, 35 insertions(+), 35 deletions(-) diff --git a/lms/djangoapps/ccx/api/v0/views.py b/lms/djangoapps/ccx/api/v0/views.py index 4e9ad681ab..b3e345a770 100644 --- a/lms/djangoapps/ccx/api/v0/views.py +++ b/lms/djangoapps/ccx/api/v0/views.py @@ -29,7 +29,7 @@ from lms.djangoapps.instructor.enrollment import enroll_email, get_email_params from openedx.core.djangoapps.content.course_overviews.models import CourseOverview from openedx.core.lib.api import authentication, permissions from openedx.core.lib.courses import get_course_by_id -from xmodule.modulestore.django import SignalHandler +from xmodule.modulestore.django import SignalHandler # lint-amnesty, pylint: disable=wrong-import-order from .paginators import CCXAPIPagination from .serializers import CCXCourseSerializer diff --git a/lms/djangoapps/ccx/plugins.py b/lms/djangoapps/ccx/plugins.py index 4ddca4e211..1852f5727a 100644 --- a/lms/djangoapps/ccx/plugins.py +++ b/lms/djangoapps/ccx/plugins.py @@ -7,7 +7,7 @@ from django.conf import settings from django.utils.translation import gettext_noop from common.djangoapps.student.roles import CourseCcxCoachRole -from xmodule.tabs import CourseTab +from xmodule.tabs import CourseTab # lint-amnesty, pylint: disable=wrong-import-order from .permissions import VIEW_CCX_COACH_DASHBOARD diff --git a/lms/djangoapps/ccx/tasks.py b/lms/djangoapps/ccx/tasks.py index 8da98c10dd..db53976a33 100644 --- a/lms/djangoapps/ccx/tasks.py +++ b/lms/djangoapps/ccx/tasks.py @@ -12,7 +12,7 @@ from opaque_keys.edx.locator import CourseLocator from lms import CELERY_APP from lms.djangoapps.ccx.models import CustomCourseForEdX -from xmodule.modulestore.django import SignalHandler +from xmodule.modulestore.django import SignalHandler # lint-amnesty, pylint: disable=wrong-import-order log = logging.getLogger("edx.ccx") diff --git a/lms/djangoapps/ccx/tests/test_ccx_modulestore.py b/lms/djangoapps/ccx/tests/test_ccx_modulestore.py index a33146dbd4..6257fca829 100644 --- a/lms/djangoapps/ccx/tests/test_ccx_modulestore.py +++ b/lms/djangoapps/ccx/tests/test_ccx_modulestore.py @@ -13,8 +13,8 @@ from six.moves import zip_longest from common.djangoapps.student.tests.factories import AdminFactory, UserFactory from lms.djangoapps.ccx.models import CustomCourseForEdX -from xmodule.modulestore.tests.django_utils import TEST_DATA_SPLIT_MODULESTORE, SharedModuleStoreTestCase -from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory +from xmodule.modulestore.tests.django_utils import TEST_DATA_SPLIT_MODULESTORE, SharedModuleStoreTestCase # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory # lint-amnesty, pylint: disable=wrong-import-order class TestCCXModulestoreWrapper(SharedModuleStoreTestCase): diff --git a/lms/djangoapps/ccx/tests/test_field_override_performance.py b/lms/djangoapps/ccx/tests/test_field_override_performance.py index 1b7d8170b5..c1a4eaa598 100644 --- a/lms/djangoapps/ccx/tests/test_field_override_performance.py +++ b/lms/djangoapps/ccx/tests/test_field_override_performance.py @@ -30,13 +30,13 @@ from lms.djangoapps.courseware.views.views import progress from openedx.core.djangoapps.content.block_structure.api import get_course_in_cache from openedx.core.djangoapps.waffle_utils.testutils import WAFFLE_TABLES from openedx.features.content_type_gating.models import ContentTypeGatingConfig -from xmodule.modulestore.tests.django_utils import ( +from xmodule.modulestore.tests.django_utils import ( # lint-amnesty, pylint: disable=wrong-import-order TEST_DATA_MONGO_MODULESTORE, TEST_DATA_SPLIT_MODULESTORE, ModuleStoreTestCase ) -from xmodule.modulestore.tests.factories import CourseFactory, check_mongo_calls, check_sum_of_calls -from xmodule.modulestore.tests.utils import ProceduralCourseTestMixin +from xmodule.modulestore.tests.factories import CourseFactory, check_mongo_calls, check_sum_of_calls # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.tests.utils import ProceduralCourseTestMixin # lint-amnesty, pylint: disable=wrong-import-order QUERY_COUNT_TABLE_BLACKLIST = WAFFLE_TABLES diff --git a/lms/djangoapps/ccx/tests/test_models.py b/lms/djangoapps/ccx/tests/test_models.py index 006ba60de5..3d9054896e 100644 --- a/lms/djangoapps/ccx/tests/test_models.py +++ b/lms/djangoapps/ccx/tests/test_models.py @@ -11,8 +11,8 @@ from pytz import utc from common.djangoapps.student.roles import CourseCcxCoachRole from common.djangoapps.student.tests.factories import AdminFactory -from xmodule.modulestore.tests.django_utils import TEST_DATA_SPLIT_MODULESTORE, ModuleStoreTestCase -from xmodule.modulestore.tests.factories import CourseFactory, check_mongo_calls +from xmodule.modulestore.tests.django_utils import TEST_DATA_SPLIT_MODULESTORE, ModuleStoreTestCase # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.tests.factories import CourseFactory, check_mongo_calls # lint-amnesty, pylint: disable=wrong-import-order from ..overrides import override_field_for_ccx from .factories import CcxFactory diff --git a/lms/djangoapps/ccx/tests/test_overrides.py b/lms/djangoapps/ccx/tests/test_overrides.py index be60dc40d4..b5aedad1da 100644 --- a/lms/djangoapps/ccx/tests/test_overrides.py +++ b/lms/djangoapps/ccx/tests/test_overrides.py @@ -19,8 +19,8 @@ from lms.djangoapps.courseware.field_overrides import OverrideFieldData from lms.djangoapps.courseware.tests.test_field_overrides import inject_field_overrides from lms.djangoapps.courseware.testutils import FieldOverrideTestMixin from openedx.core.lib.courses import get_course_by_id -from xmodule.modulestore.tests.django_utils import TEST_DATA_SPLIT_MODULESTORE, SharedModuleStoreTestCase -from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory +from xmodule.modulestore.tests.django_utils import TEST_DATA_SPLIT_MODULESTORE, SharedModuleStoreTestCase # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory # lint-amnesty, pylint: disable=wrong-import-order @override_settings( diff --git a/lms/djangoapps/ccx/tests/test_tasks.py b/lms/djangoapps/ccx/tests/test_tasks.py index 828324ecc0..1448355390 100644 --- a/lms/djangoapps/ccx/tests/test_tasks.py +++ b/lms/djangoapps/ccx/tests/test_tasks.py @@ -13,9 +13,9 @@ from common.djangoapps.student.tests.factories import AdminFactory from lms.djangoapps.ccx.tasks import send_ccx_course_published from lms.djangoapps.ccx.tests.factories import CcxFactory from openedx.core.djangoapps.content.course_overviews.models import CourseOverview -from xmodule.modulestore.django import SignalHandler -from xmodule.modulestore.tests.django_utils import TEST_DATA_SPLIT_MODULESTORE, ModuleStoreTestCase -from xmodule.modulestore.tests.factories import CourseFactory +from xmodule.modulestore.django import SignalHandler # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.tests.django_utils import TEST_DATA_SPLIT_MODULESTORE, ModuleStoreTestCase # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.tests.factories import CourseFactory # lint-amnesty, pylint: disable=wrong-import-order @contextlib.contextmanager diff --git a/lms/djangoapps/ccx/tests/test_utils.py b/lms/djangoapps/ccx/tests/test_utils.py index 1e7a9ad326..3b55bcbabf 100644 --- a/lms/djangoapps/ccx/tests/test_utils.py +++ b/lms/djangoapps/ccx/tests/test_utils.py @@ -16,9 +16,9 @@ from lms.djangoapps.ccx.tests.factories import CcxFactory from lms.djangoapps.ccx.tests.utils import CcxTestCase from lms.djangoapps.ccx.utils import add_master_course_staff_to_ccx, ccx_course, remove_master_course_staff_from_ccx from lms.djangoapps.instructor.access import list_with_level -from xmodule.modulestore.django import modulestore -from xmodule.modulestore.tests.django_utils import TEST_DATA_SPLIT_MODULESTORE, ModuleStoreTestCase -from xmodule.modulestore.tests.factories import CourseFactory +from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.tests.django_utils import TEST_DATA_SPLIT_MODULESTORE, ModuleStoreTestCase # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.tests.factories import CourseFactory # lint-amnesty, pylint: disable=wrong-import-order class TestGetCCXFromCCXLocator(ModuleStoreTestCase): diff --git a/lms/djangoapps/ccx/tests/test_views.py b/lms/djangoapps/ccx/tests/test_views.py index 61edcc233f..e14b5b8a13 100644 --- a/lms/djangoapps/ccx/tests/test_views.py +++ b/lms/djangoapps/ccx/tests/test_views.py @@ -42,15 +42,15 @@ from openedx.core.djangoapps.content.course_overviews.models import CourseOvervi from openedx.core.djangoapps.django_comment_common.models import FORUM_ROLE_ADMINISTRATOR from openedx.core.djangoapps.django_comment_common.utils import are_permissions_roles_seeded from openedx.core.lib.courses import get_course_by_id -from xmodule.modulestore import ModuleStoreEnum -from xmodule.modulestore.django import modulestore -from xmodule.modulestore.tests.django_utils import ( +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.tests.django_utils import ( # lint-amnesty, pylint: disable=wrong-import-order TEST_DATA_SPLIT_MODULESTORE, ModuleStoreTestCase, SharedModuleStoreTestCase ) -from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory, SampleCourseFactory -from xmodule.x_module import XModuleMixin +from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory, SampleCourseFactory # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.x_module import XModuleMixin # lint-amnesty, pylint: disable=wrong-import-order def intercept_renderer(path, context): diff --git a/lms/djangoapps/ccx/tests/utils.py b/lms/djangoapps/ccx/tests/utils.py index 85d9ce0ff2..8245041753 100644 --- a/lms/djangoapps/ccx/tests/utils.py +++ b/lms/djangoapps/ccx/tests/utils.py @@ -13,9 +13,9 @@ from common.djangoapps.student.tests.factories import UserFactory from lms.djangoapps.ccx.overrides import override_field_for_ccx from lms.djangoapps.ccx.tests.factories import CcxFactory from openedx.core.djangoapps.ace_common.tests.mixins import EmailTemplateTagMixin -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 +from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.tests.django_utils import TEST_DATA_SPLIT_MODULESTORE, SharedModuleStoreTestCase # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory # lint-amnesty, pylint: disable=wrong-import-order class CcxTestCase(EmailTemplateTagMixin, SharedModuleStoreTestCase): diff --git a/lms/djangoapps/ccx/views.py b/lms/djangoapps/ccx/views.py index a1f7f1ed82..66e18b2bd0 100644 --- a/lms/djangoapps/ccx/views.py +++ b/lms/djangoapps/ccx/views.py @@ -56,7 +56,7 @@ from lms.djangoapps.instructor.views.gradebook_api import get_grade_book_page from openedx.core.djangoapps.django_comment_common.models import FORUM_ROLE_ADMINISTRATOR, assign_role from openedx.core.djangoapps.django_comment_common.utils import seed_permissions_roles from openedx.core.lib.courses import get_course_by_id -from xmodule.modulestore.django import SignalHandler +from xmodule.modulestore.django import SignalHandler # lint-amnesty, pylint: disable=wrong-import-order log = logging.getLogger(__name__) TODAY = datetime.datetime.today # for patching in tests diff --git a/lms/djangoapps/commerce/api/v0/tests/test_views.py b/lms/djangoapps/commerce/api/v0/tests/test_views.py index 5a1e47cb71..d773598f0a 100644 --- a/lms/djangoapps/commerce/api/v0/tests/test_views.py +++ b/lms/djangoapps/commerce/api/v0/tests/test_views.py @@ -21,9 +21,9 @@ from common.djangoapps.student.tests.tests import EnrollmentEventTestMixin # li from openedx.core.djangoapps.embargo.test_utils import restrict_course from openedx.core.djangoapps.enrollments.api import get_enrollment from openedx.core.lib.django_test_client_utils import get_absolute_url -from xmodule.modulestore.django import modulestore -from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase -from xmodule.modulestore.tests.factories import CourseFactory +from xmodule.modulestore.django import modulestore # 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 from ....constants import Messages from ....tests.mocks import mock_basket_order diff --git a/lms/djangoapps/commerce/api/v1/serializers.py b/lms/djangoapps/commerce/api/v1/serializers.py index 5c8d4a5e48..c3077ba761 100644 --- a/lms/djangoapps/commerce/api/v1/serializers.py +++ b/lms/djangoapps/commerce/api/v1/serializers.py @@ -10,7 +10,7 @@ from opaque_keys.edx.keys import CourseKey from rest_framework import serializers from common.djangoapps.course_modes.models import CourseMode -from xmodule.modulestore.django import modulestore +from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-order from .models import UNDEFINED, Course diff --git a/lms/djangoapps/commerce/api/v1/tests/test_views.py b/lms/djangoapps/commerce/api/v1/tests/test_views.py index cf5e71e0f7..47de5d8ff5 100644 --- a/lms/djangoapps/commerce/api/v1/tests/test_views.py +++ b/lms/djangoapps/commerce/api/v1/tests/test_views.py @@ -17,8 +17,8 @@ from rest_framework.utils.encoders import JSONEncoder from common.djangoapps.course_modes.models import CourseMode from common.djangoapps.student.tests.factories import UserFactory from lms.djangoapps.verify_student.models import VerificationDeadline -from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase -from xmodule.modulestore.tests.factories import CourseFactory +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 from ....tests.mocks import mock_order_endpoint from ....tests.test_views import UserMixin diff --git a/lms/djangoapps/commerce/tests/test_utils.py b/lms/djangoapps/commerce/tests/test_utils.py index 4ca7bf4af3..80d80e3d2c 100644 --- a/lms/djangoapps/commerce/tests/test_utils.py +++ b/lms/djangoapps/commerce/tests/test_utils.py @@ -22,8 +22,8 @@ from lms.djangoapps.commerce.models import CommerceConfiguration from lms.djangoapps.commerce.utils import EcommerceService, refund_entitlement, refund_seat from openedx.core.djangolib.testing.utils import skip_unless_lms from openedx.core.lib.log_utils import audit_log -from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase -from xmodule.modulestore.tests.factories import CourseFactory +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 # Entitlements is not in CMS' INSTALLED_APPS so these imports will error during test collection if settings.ROOT_URLCONF == 'lms.urls':