From d0fbde897327478adc5f39a0e9d3a81c11c97da0 Mon Sep 17 00:00:00 2001 From: Jawayria <39649635+Jawayria@users.noreply.github.com> Date: Tue, 21 Dec 2021 13:36:50 +0500 Subject: [PATCH] chore: Applied lint-amnesty on lms/djangoapps (#29395) --- lms/djangoapps/gating/tasks.py | 2 +- lms/djangoapps/gating/tests/test_api.py | 4 ++-- lms/djangoapps/gating/tests/test_integration.py | 6 +++--- lms/djangoapps/gating/tests/test_signals.py | 6 +++--- .../instructor_analytics/tests/test_basic.py | 4 ++-- lms/djangoapps/instructor_task/api.py | 2 +- lms/djangoapps/instructor_task/api_helper.py | 2 +- lms/djangoapps/instructor_task/tasks_helper/grades.py | 6 +++--- .../instructor_task/tasks_helper/module_state.py | 2 +- lms/djangoapps/instructor_task/tests/test_api.py | 2 +- lms/djangoapps/instructor_task/tests/test_base.py | 8 ++++---- .../instructor_task/tests/test_integration.py | 4 ++-- lms/djangoapps/instructor_task/tests/test_tasks.py | 2 +- .../instructor_task/tests/test_tasks_helper.py | 10 +++++----- 14 files changed, 30 insertions(+), 30 deletions(-) diff --git a/lms/djangoapps/gating/tasks.py b/lms/djangoapps/gating/tasks.py index 0336c4abcf..7507908079 100644 --- a/lms/djangoapps/gating/tasks.py +++ b/lms/djangoapps/gating/tasks.py @@ -12,7 +12,7 @@ from opaque_keys.edx.keys import CourseKey, UsageKey from lms.djangoapps.course_blocks.api import get_course_blocks from lms.djangoapps.gating import api as gating_api -from xmodule.modulestore.django import modulestore +from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-order log = logging.getLogger(__name__) diff --git a/lms/djangoapps/gating/tests/test_api.py b/lms/djangoapps/gating/tests/test_api.py index 3b9ed16e8e..92799c50cb 100644 --- a/lms/djangoapps/gating/tests/test_api.py +++ b/lms/djangoapps/gating/tests/test_api.py @@ -12,8 +12,8 @@ from milestones.tests.utils import MilestonesTestCaseMixin from lms.djangoapps.courseware.tests.helpers import LoginEnrollmentTestCase from lms.djangoapps.gating.api import evaluate_prerequisite from openedx.core.lib.gating import api as gating_api -from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase -from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory +from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory # lint-amnesty, pylint: disable=wrong-import-order class GatingTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase): diff --git a/lms/djangoapps/gating/tests/test_integration.py b/lms/djangoapps/gating/tests/test_integration.py index 1afe5c07c5..89503a35a0 100644 --- a/lms/djangoapps/gating/tests/test_integration.py +++ b/lms/djangoapps/gating/tests/test_integration.py @@ -17,9 +17,9 @@ 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 xmodule.modulestore.django import modulestore -from xmodule.modulestore.tests.django_utils import 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 SharedModuleStoreTestCase # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory # lint-amnesty, pylint: disable=wrong-import-order @ddt.ddt diff --git a/lms/djangoapps/gating/tests/test_signals.py b/lms/djangoapps/gating/tests/test_signals.py index ea4d59440c..e3c308663c 100644 --- a/lms/djangoapps/gating/tests/test_signals.py +++ b/lms/djangoapps/gating/tests/test_signals.py @@ -7,9 +7,9 @@ from unittest.mock import Mock, patch from common.djangoapps.student.tests.factories import UserFactory from lms.djangoapps.gating.signals import evaluate_subsection_gated_milestones -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 class TestHandleScoreChanged(ModuleStoreTestCase): diff --git a/lms/djangoapps/instructor_analytics/tests/test_basic.py b/lms/djangoapps/instructor_analytics/tests/test_basic.py index ae9623dbd8..4d2d330347 100644 --- a/lms/djangoapps/instructor_analytics/tests/test_basic.py +++ b/lms/djangoapps/instructor_analytics/tests/test_basic.py @@ -27,8 +27,8 @@ from openedx.core.djangoapps.course_groups.tests.helpers import CohortFactory from common.djangoapps.student.models import CourseEnrollment, CourseEnrollmentAllowed from common.djangoapps.student.tests.factories import InstructorFactory from common.djangoapps.student.tests.factories import UserFactory -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 @ddt.ddt diff --git a/lms/djangoapps/instructor_task/api.py b/lms/djangoapps/instructor_task/api.py index b849841847..c43ca04931 100644 --- a/lms/djangoapps/instructor_task/api.py +++ b/lms/djangoapps/instructor_task/api.py @@ -45,7 +45,7 @@ from lms.djangoapps.instructor_task.tasks import ( send_bulk_course_email, generate_anonymous_ids_for_course ) -from xmodule.modulestore.django import modulestore +from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-order class SpecificStudentIdMissingError(Exception): diff --git a/lms/djangoapps/instructor_task/api_helper.py b/lms/djangoapps/instructor_task/api_helper.py index dee85ef0f2..59096b91d0 100644 --- a/lms/djangoapps/instructor_task/api_helper.py +++ b/lms/djangoapps/instructor_task/api_helper.py @@ -18,7 +18,7 @@ from opaque_keys.edx.keys import UsageKey from common.djangoapps.util.db import outer_atomic from lms.djangoapps.courseware.courses import get_problems_in_section from lms.djangoapps.instructor_task.models import PROGRESS, InstructorTask -from xmodule.modulestore.django import modulestore +from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-order log = logging.getLogger(__name__) diff --git a/lms/djangoapps/instructor_task/tasks_helper/grades.py b/lms/djangoapps/instructor_task/tasks_helper/grades.py index f4dcf3d49f..166baf249e 100644 --- a/lms/djangoapps/instructor_task/tasks_helper/grades.py +++ b/lms/djangoapps/instructor_task/tasks_helper/grades.py @@ -40,9 +40,9 @@ from openedx.core.djangoapps.course_groups.cohorts import bulk_cache_cohorts, ge from openedx.core.djangoapps.user_api.course_tag.api import BulkCourseTags from openedx.core.lib.cache_utils import get_cache from openedx.core.lib.courses import get_course_by_id -from xmodule.modulestore.django import modulestore -from xmodule.partitions.partitions_service import PartitionService -from xmodule.split_test_module import get_split_user_partitions +from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.partitions.partitions_service import PartitionService # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.split_test_module import get_split_user_partitions # lint-amnesty, pylint: disable=wrong-import-order from .runner import TaskProgress from .utils import upload_csv_to_report_store diff --git a/lms/djangoapps/instructor_task/tasks_helper/module_state.py b/lms/djangoapps/instructor_task/tasks_helper/module_state.py index 5a63836089..36ba0107a4 100644 --- a/lms/djangoapps/instructor_task/tasks_helper/module_state.py +++ b/lms/djangoapps/instructor_task/tasks_helper/module_state.py @@ -23,7 +23,7 @@ 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 openedx.core.lib.courses import get_course_by_id -from xmodule.modulestore.django import modulestore +from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-order from ..exceptions import UpdateProblemModuleStateError from .runner import TaskProgress diff --git a/lms/djangoapps/instructor_task/tests/test_api.py b/lms/djangoapps/instructor_task/tests/test_api.py index 2128aa9da3..678291cc28 100644 --- a/lms/djangoapps/instructor_task/tests/test_api.py +++ b/lms/djangoapps/instructor_task/tests/test_api.py @@ -48,7 +48,7 @@ from lms.djangoapps.instructor_task.tests.test_base import ( InstructorTaskTestCase, TestReportMixin ) -from xmodule.modulestore.exceptions import ItemNotFoundError +from xmodule.modulestore.exceptions import ItemNotFoundError # lint-amnesty, pylint: disable=wrong-import-order class InstructorTaskReportTest(InstructorTaskTestCase): diff --git a/lms/djangoapps/instructor_task/tests/test_base.py b/lms/djangoapps/instructor_task/tests/test_base.py index d34bc63d09..f264ea9419 100644 --- a/lms/djangoapps/instructor_task/tests/test_base.py +++ b/lms/djangoapps/instructor_task/tests/test_base.py @@ -29,10 +29,10 @@ 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 xmodule.modulestore import ModuleStoreEnum -from xmodule.modulestore.django import modulestore -from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase -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.tests.django_utils import ModuleStoreTestCase # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory # lint-amnesty, pylint: disable=wrong-import-order TEST_COURSE_ORG = 'edx' TEST_COURSE_NAME = 'test_course' diff --git a/lms/djangoapps/instructor_task/tests/test_integration.py b/lms/djangoapps/instructor_task/tests/test_integration.py index daf1a93ef9..d10433fa82 100644 --- a/lms/djangoapps/instructor_task/tests/test_integration.py +++ b/lms/djangoapps/instructor_task/tests/test_integration.py @@ -40,8 +40,8 @@ from lms.djangoapps.instructor_task.tests.test_base import ( ) from openedx.core.djangoapps.util.testing import TestConditionalContent from openedx.core.lib.url_utils import quote_slashes -from xmodule.modulestore import ModuleStoreEnum -from xmodule.modulestore.tests.factories import ItemFactory +from xmodule.modulestore import ModuleStoreEnum # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.tests.factories import ItemFactory # lint-amnesty, pylint: disable=wrong-import-order log = logging.getLogger(__name__) diff --git a/lms/djangoapps/instructor_task/tests/test_tasks.py b/lms/djangoapps/instructor_task/tests/test_tasks.py index 589a4d6316..6c514a5964 100644 --- a/lms/djangoapps/instructor_task/tests/test_tasks.py +++ b/lms/djangoapps/instructor_task/tests/test_tasks.py @@ -32,7 +32,7 @@ from lms.djangoapps.instructor_task.tasks import ( ) from lms.djangoapps.instructor_task.tests.factories import InstructorTaskFactory from lms.djangoapps.instructor_task.tests.test_base import InstructorTaskModuleTestCase -from xmodule.modulestore.exceptions import ItemNotFoundError +from xmodule.modulestore.exceptions import ItemNotFoundError # lint-amnesty, pylint: disable=wrong-import-order PROBLEM_URL_NAME = "test_urlname" diff --git a/lms/djangoapps/instructor_task/tests/test_tasks_helper.py b/lms/djangoapps/instructor_task/tests/test_tasks_helper.py index 462bc0d82b..dfe3ed2927 100644 --- a/lms/djangoapps/instructor_task/tests/test_tasks_helper.py +++ b/lms/djangoapps/instructor_task/tests/test_tasks_helper.py @@ -25,7 +25,7 @@ from freezegun import freeze_time from pytz import UTC import openedx.core.djangoapps.user_api.course_tag.api as course_tag_api -from capa.tests.response_xml_factory import MultipleChoiceResponseXMLFactory +from capa.tests.response_xml_factory import MultipleChoiceResponseXMLFactory # lint-amnesty, pylint: disable=wrong-import-order from common.djangoapps.course_modes.models import CourseMode from common.djangoapps.student.models import CourseEnrollment, CourseEnrollmentAllowed from common.djangoapps.student.tests.factories import CourseEnrollmentFactory, UserFactory @@ -68,10 +68,10 @@ 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 xmodule.modulestore import ModuleStoreEnum -from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase -from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory, check_mongo_calls -from xmodule.partitions.partitions import Group, UserPartition +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, check_mongo_calls # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.partitions.partitions import Group, UserPartition # lint-amnesty, pylint: disable=wrong-import-order from ..models import ReportStore from ..tasks_helper.utils import UPDATE_STATUS_FAILED, UPDATE_STATUS_SUCCEEDED