refactor: xmodule/course_module.py -> xmodule/course_block.py

This commit is contained in:
0x29a
2022-10-26 21:02:17 +02:00
committed by Piotr Surowiec
parent 7e33dce1ab
commit 0df1411636
44 changed files with 54 additions and 54 deletions

View File

@@ -12,7 +12,7 @@ from django.core.management.base import BaseCommand, CommandError
from cms.djangoapps.contentstore.management.commands.utils import user_from_str
from cms.djangoapps.contentstore.views.course import create_new_course_in_store
from openedx.core.djangoapps.credit.models import CreditProvider
from xmodule.course_module import CourseFields # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.course_block import CourseFields # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.fields import Date # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.modulestore.exceptions import DuplicateCourseError # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.tabs import CourseTabList # lint-amnesty, pylint: disable=wrong-import-order

View File

@@ -14,7 +14,7 @@ from xblock.fields import (
List,
String,
)
from xmodule.course_module import CourseFields, EmailString
from xmodule.course_block import CourseFields, EmailString
from xmodule.fields import Date
from cms.djangoapps.models.settings.course_metadata import CourseMetadata

View File

@@ -4,7 +4,7 @@ API Serializers for Contentstore
from rest_framework import serializers
from xmodule.course_module import get_available_providers
from xmodule.course_block import get_available_providers
class ProctoredExamSettingsSerializer(serializers.Serializer):

View File

@@ -9,7 +9,7 @@ from rest_framework.views import APIView
from cms.djangoapps.contentstore.views.course import get_course_and_check_access
from cms.djangoapps.models.settings.course_metadata import CourseMetadata
from xmodule.course_module import get_available_providers # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.course_block import get_available_providers # lint-amnesty, pylint: disable=wrong-import-order
from openedx.core.djangoapps.course_apps.toggles import exams_ida_enabled
from openedx.core.lib.api.view_utils import view_auth_classes
from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-order

View File

@@ -56,7 +56,7 @@ from openedx.core.djangoapps.discussions.tasks import update_unit_discussion_sta
from openedx.core.djangoapps.embargo.models import CountryAccessRule, RestrictedCourse
from openedx.core.lib.extract_tar import safetar_extractall
from xmodule.contentstore.django import contentstore # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.course_module import CourseFields # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.course_block import CourseFields # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.exceptions import SerializationError # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.modulestore import COURSE_ROOT, LIBRARY_ROOT # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-order

View File

@@ -28,7 +28,7 @@ from xmodule.capa_block import ProblemBlock
from xmodule.contentstore.content import StaticContent
from xmodule.contentstore.django import contentstore
from xmodule.contentstore.utils import empty_asset_trashcan, restore_asset_from_trashcan
from xmodule.course_module import CourseBlock, Textbook
from xmodule.course_block import CourseBlock, Textbook
from xmodule.exceptions import InvalidVersionError
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.django import modulestore
@@ -302,7 +302,7 @@ class ImportRequiredTestCases(ContentStoreTestCase):
filesystem = OSFS(root_dir / ('test_export/' + dirname))
self.assertTrue(filesystem.exists(item.location.block_id + filename_suffix))
@mock.patch('xmodule.course_module.requests.get')
@mock.patch('xmodule.course_block.requests.get')
def test_export_course_roundtrip(self, mock_get):
mock_get.return_value.text = dedent("""
<?xml version="1.0"?><table_of_contents>
@@ -912,7 +912,7 @@ class MiscCourseTests(ContentStoreTestCase):
num_drafts = self._get_draft_counts(course)
self.assertEqual(num_drafts, 1)
@mock.patch('xmodule.course_module.requests.get')
@mock.patch('xmodule.course_block.requests.get')
def test_import_textbook_as_content_element(self, mock_get):
mock_get.return_value.text = dedent("""
<?xml version="1.0"?><table_of_contents>

View File

@@ -16,7 +16,7 @@ from opaque_keys.edx.keys import CourseKey
from organizations.api import add_organization, get_course_organizations, get_organization_by_short_name
from organizations.exceptions import InvalidOrganizationException
from organizations.models import Organization
from xmodule.course_module import CourseFields
from xmodule.course_block import CourseFields
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory

View File

@@ -35,7 +35,7 @@ from common.djangoapps.student.tests.factories import UserFactory
from openedx.core.djangoapps.content.course_overviews.models import CourseOverview
from openedx.core.djangoapps.content.course_overviews.tests.factories import CourseOverviewFactory
from openedx.core.djangoapps.waffle_utils.testutils import WAFFLE_TABLES
from xmodule.course_module import CourseSummary # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.course_block import CourseSummary # 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 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

View File

@@ -3,7 +3,7 @@
from xmodule import templates
from xmodule.capa_block import ProblemBlock
from xmodule.course_module import CourseBlock
from xmodule.course_block import CourseBlock
from xmodule.html_module import HtmlBlock
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.exceptions import DuplicateCourseError

View File

@@ -77,7 +77,7 @@ from openedx.features.content_type_gating.models import ContentTypeGatingConfig
from openedx.features.content_type_gating.partitions import CONTENT_TYPE_GATING_SCHEME
from openedx.features.course_experience.waffle import ENABLE_COURSE_ABOUT_SIDEBAR_HTML
from xmodule.contentstore.content import StaticContent # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.course_module import CourseBlock, DEFAULT_START_DATE, CourseFields # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.course_block import CourseBlock, DEFAULT_START_DATE, CourseFields # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.error_module import ErrorBlock # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.modulestore import EdxJSONEncoder # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-order
@@ -907,7 +907,7 @@ def _create_or_rerun_course(request):
# Set a unique wiki_slug for newly created courses. To maintain active wiki_slugs for
# existing xml courses this cannot be changed in CourseBlock.
# # TODO get rid of defining wiki slug in this org/course/run specific way and reconcile
# w/ xmodule.course_module.CourseBlock.__init__
# w/ xmodule.course_block.CourseBlock.__init__
wiki_slug = f"{org}.{course}.{run}"
definition_data = {'wiki_slug': wiki_slug}
fields.update(definition_data)

View File

@@ -44,7 +44,7 @@ from openedx.core.djangoapps.discussions.models import DiscussionsConfiguration
from openedx.core.lib.gating import api as gating_api
from openedx.core.lib.xblock_utils import hash_resource, request_token, wrap_xblock, wrap_xblock_aside
from openedx.core.toggles import ENTRANCE_EXAMS
from xmodule.course_module import DEFAULT_START_DATE # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.course_block import DEFAULT_START_DATE # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.library_tools import LibraryToolsService # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.modulestore import EdxJSONEncoder, ModuleStoreEnum # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-order

View File

@@ -11,7 +11,7 @@ from django.views.decorators.csrf import ensure_csrf_cookie
from django.views.decorators.http import require_http_methods
from opaque_keys.edx.keys import CourseKey, UsageKey
from rest_framework.exceptions import ValidationError
from xmodule.course_module import CourseBlock
from xmodule.course_block import CourseBlock
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.django import modulestore
from xmodule.tabs import CourseTab, CourseTabList, InvalidTabsException, StaticTab

View File

@@ -28,7 +28,7 @@ from xblock.runtime import DictKeyValueStore, KvsFieldData
from xblock.test.tools import TestRuntime
from xblock.validation import ValidationMessage
from xmodule.capa_block import ProblemBlock
from xmodule.course_module import DEFAULT_START_DATE
from xmodule.course_block import DEFAULT_START_DATE
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.exceptions import ItemNotFoundError

View File

@@ -18,7 +18,7 @@ from openedx.core.djangoapps.course_apps.toggles import exams_ida_enabled
from openedx.core.djangoapps.discussions.config.waffle_utils import legacy_discussion_experience_enabled
from openedx.core.lib.teams_config import TeamsetType
from openedx.features.course_experience import COURSE_ENABLE_UNENROLLED_ACCESS_FLAG
from xmodule.course_module import get_available_providers # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.course_block import get_available_providers # 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 InvalidProctoringProvider # lint-amnesty, pylint: disable=wrong-import-order

View File

@@ -13,7 +13,7 @@ from lms.djangoapps.courseware.courses import get_course
from lms.djangoapps.courseware.exceptions import CourseRunNotFound
from openedx.core.djangoapps.content.course_overviews.models import \
CourseOverview # lint-amnesty, pylint: disable=unused-import
from xmodule.course_module import COURSE_VISIBILITY_PUBLIC # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.course_block import COURSE_VISIBILITY_PUBLIC # lint-amnesty, pylint: disable=wrong-import-order
def can_access_all_blocks(requesting_user, course_key):

View File

@@ -11,7 +11,7 @@ from opaque_keys.edx.locator import CourseLocator
from rest_framework.request import Request
from rest_framework.test import APIRequestFactory
from xblock.core import XBlock
from xmodule.course_module import DEFAULT_START_DATE
from xmodule.course_block import DEFAULT_START_DATE
from xmodule.modulestore.tests.django_utils import TEST_DATA_MONGO_AMNESTY_MODULESTORE, ModuleStoreTestCase
from xmodule.modulestore.tests.factories import check_mongo_calls

View File

@@ -33,7 +33,7 @@ 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 # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.course_block 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

View File

@@ -49,7 +49,7 @@ 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 # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.course_block import COURSE_VISIBILITY_PUBLIC, COURSE_VISIBILITY_PUBLIC_OUTLINE # lint-amnesty, pylint: disable=wrong-import-order
class UnableToDismissWelcomeMessage(APIException):

View File

@@ -61,7 +61,7 @@ from common.djangoapps.util.milestones_helpers import (
get_pre_requisite_courses_not_completed,
is_prerequisite_courses_enabled
)
from xmodule.course_module import CATALOG_VISIBILITY_ABOUT, CATALOG_VISIBILITY_CATALOG_AND_ABOUT, CourseBlock # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.course_block import CATALOG_VISIBILITY_ABOUT, CATALOG_VISIBILITY_CATALOG_AND_ABOUT, CourseBlock # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.error_module import ErrorBlock # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.partitions.partitions import NoSuchUserPartitionError, NoSuchUserPartitionGroupError # lint-amnesty, pylint: disable=wrong-import-order

View File

@@ -24,7 +24,7 @@ from lms.djangoapps.courseware.access_response import (
)
from lms.djangoapps.courseware.masquerade import get_course_masquerade, is_masquerading_as_student
from openedx.features.course_experience import COURSE_ENABLE_UNENROLLED_ACCESS_FLAG, COURSE_PRE_START_ACCESS_FLAG
from xmodule.course_module import COURSE_VISIBILITY_PUBLIC # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.course_block import COURSE_VISIBILITY_PUBLIC # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.util.xmodule_django import get_current_request_hostname # lint-amnesty, pylint: disable=wrong-import-order
DEBUG_ACCESS = False
@@ -153,7 +153,7 @@ def check_public_access(course, visibilities):
This checks if the unenrolled access waffle flag for the course is set
and the course visibility matches any of the input visibilities.
The "visibilities" argument is one of these constants from xmodule.course_module:
The "visibilities" argument is one of these constants from xmodule.course_block:
- COURSE_VISIBILITY_PRIVATE
- COURSE_VISIBILITY_PUBLIC
- COURSE_VISIBILITY_PUBLIC_OUTLINE

View File

@@ -19,7 +19,7 @@ from openedx.core.djangoapps.content.course_overviews.models import CourseOvervi
from openedx.core.djangoapps.enrollments.api import is_enrollment_valid_for_proctoring
from common.djangoapps.student.models import CourseAccessRole
from common.djangoapps.student.roles import CourseRole, OrgRole
from xmodule.course_module import CourseBlock # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.course_block import CourseBlock # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.error_module import ErrorBlock # lint-amnesty, pylint: disable=wrong-import-order

View File

@@ -14,7 +14,7 @@ from django.test.utils import override_settings
from django.urls import reverse
from edx_toggles.toggles.testutils import override_waffle_flag, override_waffle_switch
from milestones.tests.utils import MilestonesTestCaseMixin
from xmodule.course_module import (
from xmodule.course_block import (
CATALOG_VISIBILITY_ABOUT,
CATALOG_VISIBILITY_NONE,
COURSE_VISIBILITY_PRIVATE,
@@ -207,7 +207,7 @@ class AboutTestCase(LoginEnrollmentTestCase, SharedModuleStoreTestCase, EventTra
Assert that anonymous or unenrolled users see View Course option
when unenrolled access flag is set
"""
with mock.patch('xmodule.course_module.CourseBlock.course_visibility', course_visibility):
with mock.patch('xmodule.course_block.CourseBlock.course_visibility', course_visibility):
with override_waffle_flag(COURSE_ENABLE_UNENROLLED_ACCESS_FLAG, active=True):
url = reverse('about_course', args=[str(self.course.id)])
resp = self.client.get(url)

View File

@@ -44,7 +44,7 @@ from common.djangoapps.student.tests.factories import InstructorFactory
from common.djangoapps.student.tests.factories import StaffFactory
from common.djangoapps.student.tests.factories import UserFactory
from common.djangoapps.util.milestones_helpers import fulfill_course_milestone, set_prerequisite_courses
from xmodule.course_module import ( # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.course_block import ( # lint-amnesty, pylint: disable=wrong-import-order
CATALOG_VISIBILITY_ABOUT,
CATALOG_VISIBILITY_CATALOG_AND_ABOUT,
CATALOG_VISIBILITY_NONE

View File

@@ -124,7 +124,7 @@ class TestMongoCoursesLoad(ModuleStoreTestCase, PageLoaderTestCase):
self.setup_user()
self.toy_course_key = ToyCourseFactory.create().id
@mock.patch('xmodule.course_module.requests.get')
@mock.patch('xmodule.course_block.requests.get')
def test_toy_textbooks_loads(self, mock_get):
mock_get.return_value.text = dedent("""
<?xml version="1.0"?><table_of_contents>

View File

@@ -24,7 +24,7 @@ from edx_django_utils.monitoring import set_custom_attributes_for_course_key
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey, UsageKey
from web_fragments.fragment import Fragment
from xmodule.course_module import COURSE_VISIBILITY_PUBLIC
from xmodule.course_block import COURSE_VISIBILITY_PUBLIC
from xmodule.modulestore.django import modulestore
from xmodule.x_module import PUBLIC_VIEW, STUDENT_VIEW

View File

@@ -45,7 +45,7 @@ from rest_framework.decorators import api_view, throttle_classes
from rest_framework.response import Response
from rest_framework.throttling import UserRateThrottle
from web_fragments.fragment import Fragment
from xmodule.course_module import COURSE_VISIBILITY_PUBLIC, COURSE_VISIBILITY_PUBLIC_OUTLINE
from xmodule.course_block import COURSE_VISIBILITY_PUBLIC, COURSE_VISIBILITY_PUBLIC_OUTLINE
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.exceptions import ItemNotFoundError, NoPathToItem
from xmodule.tabs import CourseTabList

View File

@@ -24,7 +24,7 @@ class RoleClassTestCase(ModuleStoreTestCase):
super().setUp()
# For course ID, syntax edx/classname/classdate is important
# because xmodel.course_module.id_to_location looks for a string to split
# because xmodel.course_block.id_to_location looks for a string to split
self.course_id = ToyCourseFactory.create().id
self.student_role = models.Role.objects.get_or_create(name="Student",

View File

@@ -75,7 +75,7 @@ from openedx.core.djangoapps.django_comment_common.signals import (
)
from openedx.core.djangoapps.user_api.accounts.api import get_account_settings
from openedx.core.lib.exceptions import CourseNotFoundError, DiscussionNotFoundError, PageNotFoundError
from xmodule.course_module import CourseBlock
from xmodule.course_block import CourseBlock
from xmodule.modulestore.django import modulestore
from xmodule.tabs import CourseTabList

View File

@@ -38,7 +38,7 @@ from lms.djangoapps.mobile_api.utils import API_V1, API_V05, API_V2
from openedx.core.lib.courses import course_image_url
from openedx.features.course_duration_limits.models import CourseDurationLimitConfig
from openedx.features.course_experience.tests.views.helpers import add_course_mode
from xmodule.course_module import DEFAULT_START_DATE # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.course_block import DEFAULT_START_DATE # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory # lint-amnesty, pylint: disable=wrong-import-order
from .. import errors

View File

@@ -28,7 +28,7 @@ from openedx.core.djangoapps.models.course_details import CourseDetails
from openedx.core.lib.cache_utils import request_cached, RequestCache
from common.djangoapps.static_replace.models import AssetBaseUrlConfig
from xmodule import block_metadata_utils, course_metadata_utils # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.course_module import DEFAULT_START_DATE, CourseBlock # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.course_block import DEFAULT_START_DATE, CourseBlock # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.error_module import ErrorBlock # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.tabs import CourseTab # lint-amnesty, pylint: disable=wrong-import-order

View File

@@ -28,7 +28,7 @@ from xmodule.assetstore.assetmgr import AssetManager # lint-amnesty, pylint: di
from xmodule.contentstore.content import StaticContent # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.contentstore.django import contentstore # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.course_metadata_utils import DEFAULT_START_DATE # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.course_module import ( # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.course_block import ( # lint-amnesty, pylint: disable=wrong-import-order
CATALOG_VISIBILITY_ABOUT,
CATALOG_VISIBILITY_CATALOG_AND_ABOUT,
CATALOG_VISIBILITY_NONE

View File

@@ -6,7 +6,7 @@ from lti_consumer.models import LtiConfiguration
from common.djangoapps.student.roles import CourseStaffRole, CourseInstructorRole
from xmodule.course_module import CourseBlock
from xmodule.course_block import CourseBlock
from xmodule.tabs import TabFragmentViewMixin
from lms.djangoapps.courseware.tabs import EnrolledTab
from openedx.core.djangoapps.course_live.config.waffle import ENABLE_COURSE_LIVE

View File

@@ -13,7 +13,7 @@ from openedx.core.lib.cache_utils import request_cached
from openedx.core.lib.courses import get_course_by_id
from xmodule.discussion_block import DiscussionXBlock
from openedx.core.types import User
from xmodule.course_module import CourseBlock # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.course_block import CourseBlock # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.partitions.partitions import ENROLLMENT_TRACK_PARTITION_ID, Group # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.partitions.partitions_service import PartitionService # lint-amnesty, pylint: disable=wrong-import-order

View File

@@ -19,7 +19,7 @@ from lms.djangoapps.courseware.tabs import EnrolledTab
from openedx.core.djangoapps.discussions.models import DiscussionsConfiguration
from openedx.core.djangolib.markup import HTML
from common.djangoapps.student.models import anonymous_id_for_user
from xmodule.course_module import CourseBlock # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.course_block import CourseBlock # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.tabs import TabFragmentViewMixin, key_checker # lint-amnesty, pylint: disable=wrong-import-order

View File

@@ -10,7 +10,7 @@ XBLOCKS = [
"annotatable = xmodule.annotatable_block:AnnotatableBlock",
"chapter = xmodule.seq_module:SectionBlock",
"conditional = xmodule.conditional_block:ConditionalBlock",
"course = xmodule.course_module:CourseBlock",
"course = xmodule.course_block:CourseBlock",
"course_info = xmodule.html_module:CourseInfoBlock",
"customtag = xmodule.template_module:CustomTagBlock",
"custom_tag_template = xmodule.template_module:CustomTagTemplateBlock",

View File

@@ -35,7 +35,7 @@ from xblock.fields import Reference, ReferenceList, ReferenceValueDict, Scope, S
from xblock.runtime import KvsFieldData
from xmodule.assetstore import AssetMetadata, CourseAssetsFromStorage
from xmodule.course_module import CourseSummary
from xmodule.course_block import CourseSummary
from xmodule.error_module import ErrorBlock
from xmodule.errortracker import exc_info_to_str, null_error_tracker
from xmodule.exceptions import HeartbeatFailure

View File

@@ -79,7 +79,7 @@ from xblock.core import XBlock
from xblock.fields import Reference, ReferenceList, ReferenceValueDict, Scope
from xmodule.assetstore import AssetMetadata
from xmodule.course_module import CourseSummary
from xmodule.course_block import CourseSummary
from xmodule.error_module import ErrorBlock
from xmodule.errortracker import null_error_tracker
from xmodule.library_content_module import LibrarySummary

View File

@@ -21,7 +21,7 @@ from opaque_keys.edx.keys import UsageKey
from opaque_keys.edx.locator import BlockUsageLocator
from xblock.core import XBlock
from xmodule.course_module import Textbook
from xmodule.course_block import Textbook
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.mixed import strip_key
from xmodule.modulestore.tests.sample_courses import TOY_BLOCK_INFO_TREE, default_block_info_tree

View File

@@ -14,7 +14,7 @@ from xblock.fields import Scope, String
from xblock.runtime import DictKeyValueStore, KvsFieldData
from xblock.test.tools import TestRuntime
from xmodule.course_module import CourseSummary
from xmodule.course_block import CourseSummary
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.draft_and_published import DIRECT_ONLY_CATEGORIES
from xmodule.modulestore.exceptions import ItemNotFoundError

View File

@@ -21,7 +21,7 @@ from xblock.fields import Reference, ReferenceList, ReferenceValueDict
from openedx.core.djangolib.testing.utils import CacheIsolationMixin
from openedx.core.lib import tempdir
from openedx.core.lib.tests import attr
from xmodule.course_module import CourseBlock
from xmodule.course_block import CourseBlock
from xmodule.fields import Date, Timedelta
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.edit_info import EditInfoMixin

View File

@@ -17,7 +17,7 @@ from pytz import utc
from xblock.runtime import DictKeyValueStore, KvsFieldData
from openedx.core.lib.teams_config import TeamsConfig, DEFAULT_COURSE_RUN_MAX_TEAM_SIZE
import xmodule.course_module
import xmodule.course_block
from xmodule.data import CertificatesDisplayBehaviors
from xmodule.modulestore.xml import ImportSystem, XMLModuleStore
from xmodule.modulestore.exceptions import InvalidProctoringProvider
@@ -35,7 +35,7 @@ _NEXT_WEEK = _TODAY + timedelta(days=7)
class CourseFieldsTestCase(unittest.TestCase):
def test_default_start_date(self):
assert xmodule.course_module.CourseFields.start.default == datetime(2030, 1, 1, tzinfo=utc)
assert xmodule.course_block.CourseFields.start.default == datetime(2030, 1, 1, tzinfo=utc)
class DummySystem(ImportSystem): # lint-amnesty, pylint: disable=abstract-method, missing-class-docstring
@@ -158,7 +158,7 @@ class CourseSummaryHasEnded(unittest.TestCase):
def test_course_end(self):
test_course = get_dummy_course("2012-01-01T12:00")
bad_end_date = parser.parse("2012-02-21 10:28:45")
summary = xmodule.course_module.CourseSummary(test_course.id, end=bad_end_date)
summary = xmodule.course_block.CourseSummary(test_course.id, end=bad_end_date)
assert summary.has_ended()
@@ -225,8 +225,8 @@ class IsNewCourseTestCase(unittest.TestCase):
('2012-12-02T12:00', '2011-11-01T12:00', 'Nov 01, 2011', False, 'Nov 01, 2011 at 12:00 UTC'),
('2012-12-02T12:00', 'Spring 2012', 'Spring 2012', False, 'Spring 2012'),
('2012-12-02T12:00', 'November, 2011', 'November, 2011', False, 'November, 2011'),
(xmodule.course_module.CourseFields.start.default, None, 'TBD', True, 'TBD'),
(xmodule.course_module.CourseFields.start.default, 'January 2014', 'January 2014', False, 'January 2014'),
(xmodule.course_block.CourseFields.start.default, None, 'TBD', True, 'TBD'),
(xmodule.course_block.CourseFields.start.default, 'January 2014', 'January 2014', False, 'January 2014'),
]
def test_start_date_is_default(self):
@@ -492,7 +492,7 @@ class ProctoringProviderTestCase(unittest.TestCase):
Initialize dummy testing course.
"""
super().setUp()
self.proctoring_provider = xmodule.course_module.ProctoringProvider()
self.proctoring_provider = xmodule.course_block.ProctoringProvider()
def test_from_json_with_platform_default(self):
"""
@@ -519,7 +519,7 @@ class ProctoringProviderTestCase(unittest.TestCase):
throws a ValueError with the correct error message.
"""
provider = 'invalid-provider'
allowed_proctoring_providers = xmodule.course_module.get_available_providers()
allowed_proctoring_providers = xmodule.course_block.get_available_providers()
FEATURES_WITH_PROCTORED_EXAMS = settings.FEATURES.copy()
FEATURES_WITH_PROCTORED_EXAMS['ENABLE_PROCTORED_EXAMS'] = proctored_exams_setting_enabled

View File

@@ -71,7 +71,7 @@ class RoundTripTestCase(unittest.TestCase):
self.addCleanup(shutil.rmtree, self.temp_dir)
@mock.patch('xmodule.video_module.video_module.edxval_api', None)
@mock.patch('xmodule.course_module.requests.get')
@mock.patch('xmodule.course_block.requests.get')
@ddt.data(
"toy",
"simple",

View File

@@ -11,7 +11,7 @@ from xblock.field_data import DictFieldData
from xblock.fields import Any, Boolean, Dict, Float, Integer, List, Scope, String
from xblock.runtime import DictKeyValueStore, KvsFieldData
from xmodule.course_module import CourseBlock
from xmodule.course_block import CourseBlock
from xmodule.fields import Date, RelativeTime, Timedelta
from xmodule.modulestore.inheritance import InheritanceKeyValueStore, InheritanceMixin, InheritingFieldData
from xmodule.modulestore.split_mongo.split_mongo_kvs import SplitMongoKVS