Merge pull request #29383 from edx/jawayria/bom-2606-11
chore: Applied lint-amnesty on lms/djangoapps/{course_home_api, course_wiki}
This commit is contained in:
@@ -13,13 +13,13 @@ from rest_framework.test import APIClient
|
||||
|
||||
from common.djangoapps.student.models import CourseEnrollment
|
||||
from common.djangoapps.student.tests.factories import UserFactory
|
||||
from edx_toggles.toggles.testutils import override_waffle_flag
|
||||
from edx_toggles.toggles.testutils import override_waffle_flag # lint-amnesty, pylint: disable=wrong-import-order
|
||||
from lms.djangoapps.course_goals.models import CourseGoal
|
||||
from lms.djangoapps.course_goals.toggles import COURSE_GOALS_NUMBER_OF_DAYS_GOALS
|
||||
from lms.djangoapps.course_home_api.tests.utils import BaseCourseHomeTests
|
||||
from openedx.features.course_experience import ENABLE_COURSE_GOALS
|
||||
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
|
||||
|
||||
EVENT_NAME_ADDED = 'edx.course.goal.added'
|
||||
EVENT_NAME_UPDATED = 'edx.course.goal.updated'
|
||||
|
||||
@@ -5,13 +5,13 @@ Tests for Outline Tab API in the Course Home API
|
||||
import itertools
|
||||
from datetime import datetime, timezone
|
||||
from lms.djangoapps.grades.course_grade_factory import CourseGradeFactory
|
||||
from unittest.mock import Mock, patch
|
||||
from unittest.mock import Mock, patch # lint-amnesty, pylint: disable=wrong-import-order
|
||||
|
||||
import ddt
|
||||
import json
|
||||
from django.conf import settings
|
||||
from django.urls import reverse
|
||||
from edx_toggles.toggles.testutils import override_waffle_flag
|
||||
import ddt # lint-amnesty, pylint: disable=wrong-import-order
|
||||
import json # lint-amnesty, pylint: disable=wrong-import-order
|
||||
from django.conf import settings # lint-amnesty, pylint: disable=wrong-import-order
|
||||
from django.urls import reverse # lint-amnesty, pylint: disable=wrong-import-order
|
||||
from edx_toggles.toggles.testutils import override_waffle_flag # lint-amnesty, pylint: disable=wrong-import-order
|
||||
|
||||
from common.djangoapps.course_modes.models import CourseMode
|
||||
from common.djangoapps.student.models import CourseEnrollment
|
||||
@@ -33,8 +33,8 @@ from openedx.features.course_experience import (
|
||||
ENABLE_COURSE_GOALS
|
||||
)
|
||||
from openedx.features.discounts.applicability import DISCOUNT_APPLICABILITY_FLAG
|
||||
from xmodule.course_module import COURSE_VISIBILITY_PUBLIC, COURSE_VISIBILITY_PUBLIC_OUTLINE
|
||||
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
|
||||
from xmodule.course_module import COURSE_VISIBILITY_PUBLIC, COURSE_VISIBILITY_PUBLIC_OUTLINE # lint-amnesty, pylint: disable=wrong-import-order
|
||||
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory # lint-amnesty, pylint: disable=wrong-import-order
|
||||
|
||||
|
||||
@ddt.ddt
|
||||
|
||||
@@ -4,22 +4,22 @@ Outline Tab Views
|
||||
from datetime import datetime, timezone
|
||||
from lms.djangoapps.grades.course_grade_factory import CourseGradeFactory
|
||||
|
||||
from completion.exceptions import UnavailableCompletionData
|
||||
from completion.utilities import get_key_to_last_completed_block
|
||||
from django.conf import settings
|
||||
from django.http.response import Http404
|
||||
from django.shortcuts import get_object_or_404
|
||||
from django.urls import reverse
|
||||
from django.utils.translation import gettext as _
|
||||
from edx_django_utils import monitoring as monitoring_utils
|
||||
from edx_rest_framework_extensions.auth.jwt.authentication import JwtAuthentication
|
||||
from edx_rest_framework_extensions.auth.session.authentication import SessionAuthenticationAllowInactiveUser
|
||||
from opaque_keys.edx.keys import CourseKey
|
||||
from rest_framework.decorators import api_view, authentication_classes, permission_classes
|
||||
from rest_framework.exceptions import APIException, ParseError
|
||||
from rest_framework.generics import RetrieveAPIView
|
||||
from rest_framework.permissions import IsAuthenticated
|
||||
from rest_framework.response import Response
|
||||
from completion.exceptions import UnavailableCompletionData # lint-amnesty, pylint: disable=wrong-import-order
|
||||
from completion.utilities import get_key_to_last_completed_block # lint-amnesty, pylint: disable=wrong-import-order
|
||||
from django.conf import settings # lint-amnesty, pylint: disable=wrong-import-order
|
||||
from django.http.response import Http404 # lint-amnesty, pylint: disable=wrong-import-order
|
||||
from django.shortcuts import get_object_or_404 # lint-amnesty, pylint: disable=wrong-import-order
|
||||
from django.urls import reverse # lint-amnesty, pylint: disable=wrong-import-order
|
||||
from django.utils.translation import gettext as _ # lint-amnesty, pylint: disable=wrong-import-order
|
||||
from edx_django_utils import monitoring as monitoring_utils # lint-amnesty, pylint: disable=wrong-import-order
|
||||
from edx_rest_framework_extensions.auth.jwt.authentication import JwtAuthentication # lint-amnesty, pylint: disable=wrong-import-order
|
||||
from edx_rest_framework_extensions.auth.session.authentication import SessionAuthenticationAllowInactiveUser # lint-amnesty, pylint: disable=wrong-import-order
|
||||
from opaque_keys.edx.keys import CourseKey # lint-amnesty, pylint: disable=wrong-import-order
|
||||
from rest_framework.decorators import api_view, authentication_classes, permission_classes # lint-amnesty, pylint: disable=wrong-import-order
|
||||
from rest_framework.exceptions import APIException, ParseError # lint-amnesty, pylint: disable=wrong-import-order
|
||||
from rest_framework.generics import RetrieveAPIView # lint-amnesty, pylint: disable=wrong-import-order
|
||||
from rest_framework.permissions import IsAuthenticated # lint-amnesty, pylint: disable=wrong-import-order
|
||||
from rest_framework.response import Response # lint-amnesty, pylint: disable=wrong-import-order
|
||||
|
||||
from common.djangoapps.course_modes.models import CourseMode
|
||||
from common.djangoapps.student.models import CourseEnrollment
|
||||
@@ -60,8 +60,8 @@ from openedx.features.course_experience.course_updates import (
|
||||
from openedx.features.course_experience.url_helpers import get_learning_mfe_home_url
|
||||
from openedx.features.course_experience.utils import get_course_outline_block_tree, get_start_block
|
||||
from openedx.features.discounts.utils import generate_offer_data
|
||||
from xmodule.course_module import COURSE_VISIBILITY_PUBLIC, COURSE_VISIBILITY_PUBLIC_OUTLINE
|
||||
from xmodule.modulestore.django import modulestore
|
||||
from xmodule.course_module import COURSE_VISIBILITY_PUBLIC, COURSE_VISIBILITY_PUBLIC_OUTLINE # lint-amnesty, pylint: disable=wrong-import-order
|
||||
from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-order
|
||||
|
||||
|
||||
class UnableToDismissWelcomeMessage(APIException):
|
||||
|
||||
@@ -4,9 +4,9 @@ Tests for Progress Tab API in the Course Home API
|
||||
|
||||
import dateutil
|
||||
import ddt
|
||||
from datetime import datetime, timedelta
|
||||
from datetime import datetime, timedelta # lint-amnesty, pylint: disable=wrong-import-order
|
||||
from pytz import UTC
|
||||
from unittest.mock import patch
|
||||
from unittest.mock import patch # lint-amnesty, pylint: disable=wrong-import-order
|
||||
from django.urls import reverse
|
||||
from django.utils.timezone import now
|
||||
from edx_toggles.toggles.testutils import override_waffle_flag
|
||||
@@ -23,7 +23,7 @@ from openedx.core.djangoapps.course_date_signals.utils import MIN_DURATION
|
||||
from openedx.features.content_type_gating.helpers import CONTENT_GATING_PARTITION_ID, CONTENT_TYPE_GATE_GROUP_IDS
|
||||
from openedx.features.content_type_gating.models import ContentTypeGatingConfig
|
||||
from openedx.features.course_duration_limits.models import CourseDurationLimitConfig
|
||||
from xmodule.modulestore.tests.factories import ItemFactory
|
||||
from xmodule.modulestore.tests.factories import ItemFactory # lint-amnesty, pylint: disable=wrong-import-order
|
||||
|
||||
|
||||
@ddt.ddt
|
||||
|
||||
@@ -12,11 +12,11 @@ from common.djangoapps.course_modes.tests.factories import CourseModeFactory
|
||||
from lms.djangoapps.courseware.tests.helpers import MasqueradeMixin
|
||||
from lms.djangoapps.verify_student.models import VerificationDeadline
|
||||
from openedx.core.djangoapps.content.course_overviews.tests.factories import CourseOverviewFactory
|
||||
from xmodule.modulestore.tests.django_utils import ( # lint-amnesty, pylint: disable=unused-import
|
||||
from xmodule.modulestore.tests.django_utils import ( # lint-amnesty, pylint: disable=unused-import # lint-amnesty, pylint: disable=wrong-import-order
|
||||
TEST_DATA_SPLIT_MODULESTORE,
|
||||
ModuleStoreTestCase
|
||||
)
|
||||
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
|
||||
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory # lint-amnesty, pylint: disable=wrong-import-order
|
||||
|
||||
|
||||
@unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms')
|
||||
|
||||
@@ -8,8 +8,8 @@ from opaque_keys.edx.keys import CourseKey
|
||||
from openedx.core.djangoapps.content.course_overviews.models import CourseOverview, CourseOverviewTab
|
||||
from openedx.core.djangoapps.course_apps.plugins import CourseApp
|
||||
from openedx.core.lib.courses import get_course_by_id
|
||||
from xmodule.modulestore.django import modulestore
|
||||
from xmodule.tabs import CourseTab, CourseTabList
|
||||
from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-order
|
||||
from xmodule.tabs import CourseTab, CourseTabList # lint-amnesty, pylint: disable=wrong-import-order
|
||||
|
||||
# Import the User model only for type checking since importing it at runtime
|
||||
# will prevent the app from starting since the model is imported before
|
||||
|
||||
@@ -12,8 +12,8 @@ from lms.djangoapps.course_wiki import settings
|
||||
from lms.djangoapps.course_wiki.utils import course_wiki_slug, user_is_article_course_staff
|
||||
from lms.djangoapps.course_wiki.views import get_or_create_root
|
||||
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
|
||||
|
||||
|
||||
class TestWikiAccessBase(ModuleStoreTestCase):
|
||||
|
||||
@@ -11,8 +11,8 @@ from wiki.models import URLPath
|
||||
from common.djangoapps.student.tests.factories import InstructorFactory
|
||||
from lms.djangoapps.course_wiki.views import get_or_create_root
|
||||
from openedx.core.djangoapps.theming.tests.test_util import with_comprehensive_theme
|
||||
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
|
||||
|
||||
|
||||
class TestComprehensiveTheming(ModuleStoreTestCase):
|
||||
|
||||
@@ -8,8 +8,8 @@ from wiki.models import URLPath
|
||||
|
||||
from common.djangoapps.student.tests.factories import InstructorFactory
|
||||
from lms.djangoapps.course_wiki.views import get_or_create_root
|
||||
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
|
||||
|
||||
|
||||
class TestWikiAccessMiddleware(ModuleStoreTestCase):
|
||||
|
||||
@@ -7,8 +7,8 @@ from django.conf import settings
|
||||
|
||||
from common.djangoapps.student.tests.factories import AdminFactory, UserFactory
|
||||
from lms.djangoapps.courseware.tabs import get_course_tab_list
|
||||
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
|
||||
|
||||
|
||||
class WikiTabTestCase(ModuleStoreTestCase):
|
||||
|
||||
@@ -8,8 +8,8 @@ from django.urls import reverse
|
||||
|
||||
from lms.djangoapps.courseware.tests.tests import LoginEnrollmentTestCase
|
||||
from openedx.features.enterprise_support.tests.mixins.enterprise import EnterpriseTestConsentRequired
|
||||
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
|
||||
|
||||
|
||||
class WikiRedirectTestCase(EnterpriseTestConsentRequired, LoginEnrollmentTestCase, ModuleStoreTestCase):
|
||||
|
||||
@@ -6,7 +6,7 @@ Utility functions for course_wiki.
|
||||
from django.core.exceptions import ObjectDoesNotExist
|
||||
|
||||
import lms.djangoapps.courseware
|
||||
from xmodule import modulestore
|
||||
from xmodule import modulestore # lint-amnesty, pylint: disable=wrong-import-order
|
||||
|
||||
|
||||
def user_is_article_course_staff(user, article):
|
||||
|
||||
Reference in New Issue
Block a user