From 8ccb8b06082a6d3dabc0ef1ca49025e08c99bfe6 Mon Sep 17 00:00:00 2001 From: Jawayria Date: Wed, 24 Nov 2021 18:33:57 +0500 Subject: [PATCH] chore: Applied lint-amnesty on openedx/core/djangoapps --- .../core/djangoapps/courseware_api/tests/test_views.py | 9 +++++---- openedx/core/djangoapps/courseware_api/views.py | 8 ++++---- .../core/djangoapps/credentials/tests/test_signals.py | 4 ++-- openedx/core/djangoapps/credit/email_utils.py | 2 +- openedx/core/djangoapps/credit/tasks.py | 4 ++-- openedx/core/djangoapps/credit/tests/test_api.py | 4 ++-- openedx/core/djangoapps/credit/tests/test_services.py | 4 ++-- openedx/core/djangoapps/credit/tests/test_signals.py | 4 ++-- openedx/core/djangoapps/credit/tests/test_tasks.py | 4 ++-- .../core/djangoapps/demographics/tests/test_status.py | 6 +++--- 10 files changed, 25 insertions(+), 24 deletions(-) diff --git a/openedx/core/djangoapps/courseware_api/tests/test_views.py b/openedx/core/djangoapps/courseware_api/tests/test_views.py index 166878ea23..af03e6ecd6 100644 --- a/openedx/core/djangoapps/courseware_api/tests/test_views.py +++ b/openedx/core/djangoapps/courseware_api/tests/test_views.py @@ -38,10 +38,11 @@ from common.djangoapps.student.roles import CourseInstructorRole from common.djangoapps.student.tests.factories import CourseEnrollmentCelebrationFactory, UserFactory from openedx.core.djangoapps.agreements.api import create_integrity_signature from openedx.core.djangoapps.agreements.toggles import ENABLE_INTEGRITY_SIGNATURE -from xmodule.data import CertificatesDisplayBehaviors -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 + +from xmodule.data import CertificatesDisplayBehaviors # 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 TEST_DATA_SPLIT_MODULESTORE, SharedModuleStoreTestCase # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.tests.factories import ItemFactory, ToyCourseFactory # lint-amnesty, pylint: disable=wrong-import-order from xmodule.partitions.partitions import ENROLLMENT_TRACK_PARTITION_ID diff --git a/openedx/core/djangoapps/courseware_api/views.py b/openedx/core/djangoapps/courseware_api/views.py index b3869f8338..1380c74962 100644 --- a/openedx/core/djangoapps/courseware_api/views.py +++ b/openedx/core/djangoapps/courseware_api/views.py @@ -64,10 +64,10 @@ from common.djangoapps.student.models import ( CourseEnrollmentCelebration, LinkedInAddToProfileConfiguration ) -from xmodule.modulestore.django import modulestore -from xmodule.modulestore.exceptions import ItemNotFoundError, NoPathToItem -from xmodule.modulestore.search import path_to_location -from xmodule.x_module import PUBLIC_VIEW, STUDENT_VIEW +from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.exceptions import ItemNotFoundError, NoPathToItem # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.search import path_to_location # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.x_module import PUBLIC_VIEW, STUDENT_VIEW # lint-amnesty, pylint: disable=wrong-import-order from .serializers import CourseInfoSerializer from .utils import serialize_upgrade_info diff --git a/openedx/core/djangoapps/credentials/tests/test_signals.py b/openedx/core/djangoapps/credentials/tests/test_signals.py index 5ea44fafa0..cd1771fb92 100644 --- a/openedx/core/djangoapps/credentials/tests/test_signals.py +++ b/openedx/core/djangoapps/credentials/tests/test_signals.py @@ -10,8 +10,8 @@ from lms.djangoapps.certificates.tests.factories import GeneratedCertificateFact from lms.djangoapps.grades.course_grade_factory import CourseGradeFactory from openedx.core.djangolib.testing.utils import skip_unless_lms 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 +from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.tests.factories import CourseFactory as XModuleCourseFactory # lint-amnesty, pylint: disable=wrong-import-order SIGNALS_MODULE = 'openedx.core.djangoapps.credentials.signals' diff --git a/openedx/core/djangoapps/credit/email_utils.py b/openedx/core/djangoapps/credit/email_utils.py index 44eba6adc0..f893068319 100644 --- a/openedx/core/djangoapps/credit/email_utils.py +++ b/openedx/core/djangoapps/credit/email_utils.py @@ -26,7 +26,7 @@ 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 from openedx.core.djangolib.markup import HTML -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/openedx/core/djangoapps/credit/tasks.py b/openedx/core/djangoapps/credit/tasks.py index 5d1eab7fad..312e278a98 100644 --- a/openedx/core/djangoapps/credit/tasks.py +++ b/openedx/core/djangoapps/credit/tasks.py @@ -13,8 +13,8 @@ from opaque_keys.edx.keys import CourseKey, UsageKey from openedx.core.djangoapps.credit.api import set_credit_requirements from openedx.core.djangoapps.credit.exceptions import InvalidCreditRequirements from openedx.core.djangoapps.credit.models import CreditCourse -from xmodule.modulestore.django import modulestore -from xmodule.modulestore.exceptions import ItemNotFoundError +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 LOGGER = get_task_logger(__name__) diff --git a/openedx/core/djangoapps/credit/tests/test_api.py b/openedx/core/djangoapps/credit/tests/test_api.py index b84eb19b70..70a042da0e 100644 --- a/openedx/core/djangoapps/credit/tests/test_api.py +++ b/openedx/core/djangoapps/credit/tests/test_api.py @@ -41,8 +41,8 @@ from openedx.core.djangolib.testing.utils import skip_unless_lms 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 +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_CREDIT_PROVIDER_SECRET_KEY = "931433d583c84ca7ba41784bad3232e6" TEST_CREDIT_PROVIDER_SECRET_KEY_TWO = "abcf433d583c8baebae1784bad3232e6" diff --git a/openedx/core/djangoapps/credit/tests/test_services.py b/openedx/core/djangoapps/credit/tests/test_services.py index 70fd22aa8a..edd3d82676 100644 --- a/openedx/core/djangoapps/credit/tests/test_services.py +++ b/openedx/core/djangoapps/credit/tests/test_services.py @@ -10,8 +10,8 @@ from openedx.core.djangoapps.credit.api.eligibility import set_credit_requiremen from openedx.core.djangoapps.credit.models import CreditCourse from openedx.core.djangoapps.credit.services import CreditService from common.djangoapps.student.models import CourseEnrollment, UserProfile -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/openedx/core/djangoapps/credit/tests/test_signals.py b/openedx/core/djangoapps/credit/tests/test_signals.py index bb3e32e0be..198f88e875 100644 --- a/openedx/core/djangoapps/credit/tests/test_signals.py +++ b/openedx/core/djangoapps/credit/tests/test_signals.py @@ -17,8 +17,8 @@ from openedx.core.djangoapps.credit.signals import listen_for_grade_calculation from openedx.core.djangolib.testing.utils import skip_unless_lms 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 +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 @skip_unless_lms diff --git a/openedx/core/djangoapps/credit/tests/test_tasks.py b/openedx/core/djangoapps/credit/tests/test_tasks.py index 72dd7c8092..c283f2f5e9 100644 --- a/openedx/core/djangoapps/credit/tests/test_tasks.py +++ b/openedx/core/djangoapps/credit/tests/test_tasks.py @@ -12,8 +12,8 @@ from openedx.core.djangoapps.credit.api import get_credit_requirements from openedx.core.djangoapps.credit.exceptions import InvalidCreditRequirements from openedx.core.djangoapps.credit.models import CreditCourse from openedx.core.djangoapps.credit.signals import on_course_publish -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 TestTaskExecution(ModuleStoreTestCase): diff --git a/openedx/core/djangoapps/demographics/tests/test_status.py b/openedx/core/djangoapps/demographics/tests/test_status.py index 1007534202..4b8a068eca 100644 --- a/openedx/core/djangoapps/demographics/tests/test_status.py +++ b/openedx/core/djangoapps/demographics/tests/test_status.py @@ -16,9 +16,9 @@ from openedx.core.djangoapps.catalog.tests.factories import ( ) from openedx.core.djangolib.testing.utils import skip_unless_lms from openedx.features.enterprise_support.tests.factories import EnterpriseCustomerUserFactory -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 +from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase, TEST_DATA_SPLIT_MODULESTORE # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.tests.factories import CourseFactory # lint-amnesty, pylint: disable=wrong-import-order if settings.ROOT_URLCONF == 'lms.urls': from openedx.core.djangoapps.demographics.api.status import show_user_demographics, show_call_to_action_for_user