diff --git a/cms/djangoapps/contentstore/management/commands/generate_courses.py b/cms/djangoapps/contentstore/management/commands/generate_courses.py index 2161c48f39..4a91761e0b 100644 --- a/cms/djangoapps/contentstore/management/commands/generate_courses.py +++ b/cms/djangoapps/contentstore/management/commands/generate_courses.py @@ -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 diff --git a/cms/djangoapps/contentstore/rest_api/v0/serializers/advanced_settings.py b/cms/djangoapps/contentstore/rest_api/v0/serializers/advanced_settings.py index 76694ac618..0de09900e2 100644 --- a/cms/djangoapps/contentstore/rest_api/v0/serializers/advanced_settings.py +++ b/cms/djangoapps/contentstore/rest_api/v0/serializers/advanced_settings.py @@ -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 diff --git a/cms/djangoapps/contentstore/rest_api/v1/serializers.py b/cms/djangoapps/contentstore/rest_api/v1/serializers.py index ee99efa31f..2a5f92325f 100644 --- a/cms/djangoapps/contentstore/rest_api/v1/serializers.py +++ b/cms/djangoapps/contentstore/rest_api/v1/serializers.py @@ -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): diff --git a/cms/djangoapps/contentstore/rest_api/v1/views.py b/cms/djangoapps/contentstore/rest_api/v1/views.py index f56a6287ab..2b80ebeb25 100644 --- a/cms/djangoapps/contentstore/rest_api/v1/views.py +++ b/cms/djangoapps/contentstore/rest_api/v1/views.py @@ -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 diff --git a/cms/djangoapps/contentstore/tasks.py b/cms/djangoapps/contentstore/tasks.py index aaee20fbb1..fc053bb4fa 100644 --- a/cms/djangoapps/contentstore/tasks.py +++ b/cms/djangoapps/contentstore/tasks.py @@ -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 diff --git a/cms/djangoapps/contentstore/tests/test_contentstore.py b/cms/djangoapps/contentstore/tests/test_contentstore.py index 5049a91e65..40c9e3a3e3 100644 --- a/cms/djangoapps/contentstore/tests/test_contentstore.py +++ b/cms/djangoapps/contentstore/tests/test_contentstore.py @@ -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(""" @@ -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(""" diff --git a/cms/djangoapps/contentstore/tests/test_course_create_rerun.py b/cms/djangoapps/contentstore/tests/test_course_create_rerun.py index 5d8dab906b..0dc03417d5 100644 --- a/cms/djangoapps/contentstore/tests/test_course_create_rerun.py +++ b/cms/djangoapps/contentstore/tests/test_course_create_rerun.py @@ -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 diff --git a/cms/djangoapps/contentstore/tests/test_course_listing.py b/cms/djangoapps/contentstore/tests/test_course_listing.py index b8d39dfd4b..461a1281f5 100644 --- a/cms/djangoapps/contentstore/tests/test_course_listing.py +++ b/cms/djangoapps/contentstore/tests/test_course_listing.py @@ -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 diff --git a/cms/djangoapps/contentstore/tests/test_crud.py b/cms/djangoapps/contentstore/tests/test_crud.py index f1be99b41a..1cac18bdde 100644 --- a/cms/djangoapps/contentstore/tests/test_crud.py +++ b/cms/djangoapps/contentstore/tests/test_crud.py @@ -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 diff --git a/cms/djangoapps/contentstore/views/course.py b/cms/djangoapps/contentstore/views/course.py index 4fbf4add83..70ebc65893 100644 --- a/cms/djangoapps/contentstore/views/course.py +++ b/cms/djangoapps/contentstore/views/course.py @@ -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) diff --git a/cms/djangoapps/contentstore/views/item.py b/cms/djangoapps/contentstore/views/item.py index 2ef9b80d38..52689f217b 100644 --- a/cms/djangoapps/contentstore/views/item.py +++ b/cms/djangoapps/contentstore/views/item.py @@ -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 diff --git a/cms/djangoapps/contentstore/views/tabs.py b/cms/djangoapps/contentstore/views/tabs.py index 72c7c90c72..6ccbee3aea 100644 --- a/cms/djangoapps/contentstore/views/tabs.py +++ b/cms/djangoapps/contentstore/views/tabs.py @@ -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 diff --git a/cms/djangoapps/contentstore/views/tests/test_item.py b/cms/djangoapps/contentstore/views/tests/test_item.py index 6a643de54f..97fe106871 100644 --- a/cms/djangoapps/contentstore/views/tests/test_item.py +++ b/cms/djangoapps/contentstore/views/tests/test_item.py @@ -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 diff --git a/cms/djangoapps/models/settings/course_metadata.py b/cms/djangoapps/models/settings/course_metadata.py index 9dea9868d9..c072a4ae55 100644 --- a/cms/djangoapps/models/settings/course_metadata.py +++ b/cms/djangoapps/models/settings/course_metadata.py @@ -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 diff --git a/lms/djangoapps/course_api/blocks/permissions.py b/lms/djangoapps/course_api/blocks/permissions.py index 45156de411..1fc39e9b52 100644 --- a/lms/djangoapps/course_api/blocks/permissions.py +++ b/lms/djangoapps/course_api/blocks/permissions.py @@ -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): diff --git a/lms/djangoapps/course_api/tests/test_serializers.py b/lms/djangoapps/course_api/tests/test_serializers.py index 5ac8a119ac..045f399f4e 100644 --- a/lms/djangoapps/course_api/tests/test_serializers.py +++ b/lms/djangoapps/course_api/tests/test_serializers.py @@ -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 diff --git a/lms/djangoapps/course_home_api/outline/tests/test_view.py b/lms/djangoapps/course_home_api/outline/tests/test_view.py index c37788e9ee..aa29bdd559 100644 --- a/lms/djangoapps/course_home_api/outline/tests/test_view.py +++ b/lms/djangoapps/course_home_api/outline/tests/test_view.py @@ -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 diff --git a/lms/djangoapps/course_home_api/outline/views.py b/lms/djangoapps/course_home_api/outline/views.py index 9d9e4e1cd1..253779005e 100644 --- a/lms/djangoapps/course_home_api/outline/views.py +++ b/lms/djangoapps/course_home_api/outline/views.py @@ -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): diff --git a/lms/djangoapps/courseware/access.py b/lms/djangoapps/courseware/access.py index a6750122cd..b38a0230d2 100644 --- a/lms/djangoapps/courseware/access.py +++ b/lms/djangoapps/courseware/access.py @@ -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 diff --git a/lms/djangoapps/courseware/access_utils.py b/lms/djangoapps/courseware/access_utils.py index 18f4bb27a8..6e5699f4e2 100644 --- a/lms/djangoapps/courseware/access_utils.py +++ b/lms/djangoapps/courseware/access_utils.py @@ -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 diff --git a/lms/djangoapps/courseware/rules.py b/lms/djangoapps/courseware/rules.py index 76e30b64a8..8f4d0de981 100644 --- a/lms/djangoapps/courseware/rules.py +++ b/lms/djangoapps/courseware/rules.py @@ -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 diff --git a/lms/djangoapps/courseware/tests/test_about.py b/lms/djangoapps/courseware/tests/test_about.py index bb02a59122..62dedf31da 100644 --- a/lms/djangoapps/courseware/tests/test_about.py +++ b/lms/djangoapps/courseware/tests/test_about.py @@ -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) diff --git a/lms/djangoapps/courseware/tests/test_access.py b/lms/djangoapps/courseware/tests/test_access.py index 9b6e0e718f..f30c823f32 100644 --- a/lms/djangoapps/courseware/tests/test_access.py +++ b/lms/djangoapps/courseware/tests/test_access.py @@ -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 diff --git a/lms/djangoapps/courseware/tests/tests.py b/lms/djangoapps/courseware/tests/tests.py index 7d613721fa..86e5a53bbb 100644 --- a/lms/djangoapps/courseware/tests/tests.py +++ b/lms/djangoapps/courseware/tests/tests.py @@ -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(""" diff --git a/lms/djangoapps/courseware/views/index.py b/lms/djangoapps/courseware/views/index.py index d2d72eae94..407874112e 100644 --- a/lms/djangoapps/courseware/views/index.py +++ b/lms/djangoapps/courseware/views/index.py @@ -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 diff --git a/lms/djangoapps/courseware/views/views.py b/lms/djangoapps/courseware/views/views.py index 9536640b24..f5c6864af5 100644 --- a/lms/djangoapps/courseware/views/views.py +++ b/lms/djangoapps/courseware/views/views.py @@ -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 diff --git a/lms/djangoapps/discussion/django_comment_client/tests/test_models.py b/lms/djangoapps/discussion/django_comment_client/tests/test_models.py index 270f688006..098eedf51e 100644 --- a/lms/djangoapps/discussion/django_comment_client/tests/test_models.py +++ b/lms/djangoapps/discussion/django_comment_client/tests/test_models.py @@ -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", diff --git a/lms/djangoapps/discussion/rest_api/api.py b/lms/djangoapps/discussion/rest_api/api.py index 7c85c93bdd..6a0b15f1bd 100644 --- a/lms/djangoapps/discussion/rest_api/api.py +++ b/lms/djangoapps/discussion/rest_api/api.py @@ -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 diff --git a/lms/djangoapps/mobile_api/users/tests.py b/lms/djangoapps/mobile_api/users/tests.py index 237bdea157..8eb6924bc0 100644 --- a/lms/djangoapps/mobile_api/users/tests.py +++ b/lms/djangoapps/mobile_api/users/tests.py @@ -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 diff --git a/openedx/core/djangoapps/content/course_overviews/models.py b/openedx/core/djangoapps/content/course_overviews/models.py index d16defff36..0c0e574ea4 100644 --- a/openedx/core/djangoapps/content/course_overviews/models.py +++ b/openedx/core/djangoapps/content/course_overviews/models.py @@ -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 diff --git a/openedx/core/djangoapps/content/course_overviews/tests/test_course_overviews.py b/openedx/core/djangoapps/content/course_overviews/tests/test_course_overviews.py index 74b704a303..1f3650ff1e 100644 --- a/openedx/core/djangoapps/content/course_overviews/tests/test_course_overviews.py +++ b/openedx/core/djangoapps/content/course_overviews/tests/test_course_overviews.py @@ -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 diff --git a/openedx/core/djangoapps/course_live/tab.py b/openedx/core/djangoapps/course_live/tab.py index 0fb97fabcd..34bcc8ba16 100644 --- a/openedx/core/djangoapps/course_live/tab.py +++ b/openedx/core/djangoapps/course_live/tab.py @@ -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 diff --git a/openedx/core/djangoapps/discussions/utils.py b/openedx/core/djangoapps/discussions/utils.py index 15e5243c17..7c26a4e482 100644 --- a/openedx/core/djangoapps/discussions/utils.py +++ b/openedx/core/djangoapps/discussions/utils.py @@ -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 diff --git a/openedx/features/lti_course_tab/tab.py b/openedx/features/lti_course_tab/tab.py index 52693a1095..924dbe27f7 100644 --- a/openedx/features/lti_course_tab/tab.py +++ b/openedx/features/lti_course_tab/tab.py @@ -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 diff --git a/setup.py b/setup.py index 619cfe578a..fd2db8a663 100644 --- a/setup.py +++ b/setup.py @@ -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", diff --git a/xmodule/course_module.py b/xmodule/course_block.py similarity index 100% rename from xmodule/course_module.py rename to xmodule/course_block.py diff --git a/xmodule/modulestore/mongo/base.py b/xmodule/modulestore/mongo/base.py index 65ee947531..de49043e5b 100644 --- a/xmodule/modulestore/mongo/base.py +++ b/xmodule/modulestore/mongo/base.py @@ -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 diff --git a/xmodule/modulestore/split_mongo/split.py b/xmodule/modulestore/split_mongo/split.py index d53e6a0c23..5010bf443f 100644 --- a/xmodule/modulestore/split_mongo/split.py +++ b/xmodule/modulestore/split_mongo/split.py @@ -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 diff --git a/xmodule/modulestore/tests/factories.py b/xmodule/modulestore/tests/factories.py index b4e3d5b080..9572b0e488 100644 --- a/xmodule/modulestore/tests/factories.py +++ b/xmodule/modulestore/tests/factories.py @@ -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 diff --git a/xmodule/modulestore/tests/test_semantics.py b/xmodule/modulestore/tests/test_semantics.py index 4c12712d5a..a50f19735b 100644 --- a/xmodule/modulestore/tests/test_semantics.py +++ b/xmodule/modulestore/tests/test_semantics.py @@ -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 diff --git a/xmodule/modulestore/tests/test_split_modulestore.py b/xmodule/modulestore/tests/test_split_modulestore.py index 2e0ffcf481..d9372bb1a8 100644 --- a/xmodule/modulestore/tests/test_split_modulestore.py +++ b/xmodule/modulestore/tests/test_split_modulestore.py @@ -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 diff --git a/xmodule/tests/test_course_module.py b/xmodule/tests/test_course_module.py index a8176aaf11..6db84fcde0 100644 --- a/xmodule/tests/test_course_module.py +++ b/xmodule/tests/test_course_module.py @@ -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 diff --git a/xmodule/tests/test_export.py b/xmodule/tests/test_export.py index 7b0e44f431..8e3c835586 100644 --- a/xmodule/tests/test_export.py +++ b/xmodule/tests/test_export.py @@ -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", diff --git a/xmodule/tests/test_xml_module.py b/xmodule/tests/test_xml_module.py index 09fd771421..f36782075f 100644 --- a/xmodule/tests/test_xml_module.py +++ b/xmodule/tests/test_xml_module.py @@ -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