Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lms/djangoapps/course_home_api/outline/tests/test_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ def test_vertical_icon(self, block_categories, expected_icon):

assert vertical_data['icon'] == expected_icon

@patch('xmodule.html_block.HtmlBlock.icon_class', 'video')
@patch('xmodule.x_module.XModuleMixin.icon_class', 'video')
def test_vertical_icon_determined_by_icon_class(self):
"""Test that the API checks the children `icon_class` to determine the icon for the unit."""
self.add_blocks_to_course()
Expand Down
17 changes: 12 additions & 5 deletions lms/djangoapps/courseware/tests/test_block_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@
from xblock.exceptions import NoSuchServiceError
from xblock.field_data import FieldData # lint-amnesty, pylint: disable=wrong-import-order
from xblock.fields import ScopeIds # lint-amnesty, pylint: disable=wrong-import-order
from xblock.runtime import DictKeyValueStore, KvsFieldData # lint-amnesty, pylint: disable=wrong-import-order
from xblock.runtime import ( # lint-amnesty, pylint: disable=wrong-import-order
DictKeyValueStore,
KvsFieldData,
Mixologist, # lint-amnesty, pylint: disable=wrong-import-order
)
from xblock.test.tools import TestRuntime # lint-amnesty, pylint: disable=wrong-import-order
from xblocks_contrib.problem.capa.tests.response_xml_factory import (
OptionResponseXMLFactory, # lint-amnesty, pylint: disable=reimported
Expand Down Expand Up @@ -111,7 +115,10 @@
from xmodule.modulestore.tests.test_asides import AsideTestType # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.services import RebindUserServiceError
from xmodule.video_block import VideoBlock # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.x_module import STUDENT_VIEW, ModuleStoreRuntime # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.x_module import ( # lint-amnesty, pylint: disable=wrong-import-order
STUDENT_VIEW,
ModuleStoreRuntime,
)

TEST_DATA_DIR = settings.COMMON_TEST_DATA_ROOT

Expand Down Expand Up @@ -1931,8 +1938,9 @@ def setUp(self):
@patch('lms.djangoapps.courseware.block_render.has_access', Mock(return_value=True, autospec=True))
def _get_anonymous_id(self, course_id, xblock_class, should_get_deprecated_id: bool): # lint-amnesty, pylint: disable=missing-function-docstring
location = course_id.make_usage_key('dummy_category', 'dummy_name')
mixed_class = Mixologist(settings.XBLOCK_MIXINS).mix(xblock_class)
block = Mock(
spec=xblock_class,
spec=mixed_class,
_field_data=Mock(spec=FieldData, name='field_data'),
location=location,
static_asset_path=None,
Expand All @@ -1951,8 +1959,7 @@ def _get_anonymous_id(self, course_id, xblock_class, should_get_deprecated_id: b
days_early_for_beta=None,
)
block.runtime = ModuleStoreRuntime(None, None, None)
# Use the xblock_class's bind_for_student method
block.bind_for_student = partial(xblock_class.bind_for_student, block)
block.bind_for_student = partial(mixed_class.bind_for_student, block)

if hasattr(xblock_class, 'module_class'):
block.module_class = xblock_class.module_class
Expand Down
1 change: 1 addition & 0 deletions lms/djangoapps/courseware/tests/test_discussion_xblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def setUp(self):
})
scope_ids = mock.Mock()
scope_ids.usage_id.course_key = self.course_id
scope_ids.usage_id.context_key = self.course_id
self.block = DiscussionXBlock(
self.runtime,
field_data=self.data,
Expand Down
4 changes: 2 additions & 2 deletions openedx/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2087,7 +2087,7 @@ def add_optional_apps(optional_apps, installed_apps):
# .. toggle_warning: Not production-ready until relevant subtask https://github.com/openedx/edx-platform/issues/34827 is done.
# .. toggle_creation_date: 2024-11-10
# .. toggle_target_removal_date: 2026-04-10
USE_EXTRACTED_DISCUSSION_BLOCK = False
USE_EXTRACTED_DISCUSSION_BLOCK = True

# .. toggle_name: USE_EXTRACTED_PROBLEM_BLOCK
# .. toggle_default: False
Expand All @@ -2097,7 +2097,7 @@ def add_optional_apps(optional_apps, installed_apps):
# .. toggle_warning: Not production-ready until relevant subtask https://github.com/openedx/edx-platform/issues/34827 is done.
# .. toggle_creation_date: 2024-11-10
# .. toggle_target_removal_date: 2026-04-10
USE_EXTRACTED_PROBLEM_BLOCK = False
USE_EXTRACTED_PROBLEM_BLOCK = True
Comment on lines 2090 to +2100
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Revert these flags before merging


# .. toggle_name: USE_EXTRACTED_VIDEO_BLOCK
# .. toggle_default: True
Expand Down
2 changes: 1 addition & 1 deletion requirements/edx/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1302,7 +1302,7 @@ xblock-utils==4.0.0
# via
# edx-sga
# xblock-poll
xblocks-contrib==0.15.3
git+https://github.com/openedx/xblocks-contrib.git@remove-legacy-mixins#egg=xblocks-contrib
# via -r requirements/edx/bundled.in
xmlsec==1.3.14
# via
Expand Down
2 changes: 1 addition & 1 deletion requirements/edx/development.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2329,7 +2329,7 @@ xblock-utils==4.0.0
# -r requirements/edx/testing.txt
# edx-sga
# xblock-poll
xblocks-contrib==0.15.3
git+https://github.com/openedx/xblocks-contrib.git@remove-legacy-mixins#egg=xblocks-contrib
# via
# -r requirements/edx/doc.txt
# -r requirements/edx/testing.txt
Expand Down
2 changes: 1 addition & 1 deletion requirements/edx/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1640,7 +1640,7 @@ xblock-utils==4.0.0
# -r requirements/edx/base.txt
# edx-sga
# xblock-poll
xblocks-contrib==0.15.3
git+https://github.com/openedx/xblocks-contrib.git@remove-legacy-mixins#egg=xblocks-contrib
# via -r requirements/edx/base.txt
xmlsec==1.3.14
# via
Expand Down
2 changes: 1 addition & 1 deletion requirements/edx/testing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1733,7 +1733,7 @@ xblock-utils==4.0.0
# -r requirements/edx/base.txt
# edx-sga
# xblock-poll
xblocks-contrib==0.15.3
git+https://github.com/openedx/xblocks-contrib.git@remove-legacy-mixins#egg=xblocks-contrib
# via -r requirements/edx/base.txt
xmlsec==1.3.14
# via
Expand Down
4 changes: 3 additions & 1 deletion xmodule/modulestore/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from operator import itemgetter
from zoneinfo import ZoneInfo

from django.conf import settings
from django.db import transaction
from opaque_keys.edx.keys import AssetKey, CourseKey
from opaque_keys.edx.locations import Location # For import backwards compatibility
Expand Down Expand Up @@ -1196,7 +1197,8 @@ def __init__( # lint-amnesty, pylint: disable=unused-argument
# TODO move the inheritance_cache_subsystem to classes which use it
self.metadata_inheritance_cache_subsystem = metadata_inheritance_cache_subsystem
self.request_cache = request_cache
self.xblock_mixins = xblock_mixins
settings_mixins = getattr(settings, 'XBLOCK_MIXINS', ())
self.xblock_mixins = tuple(dict.fromkeys(settings_mixins + xblock_mixins))
self.xblock_select = xblock_select
self.xblock_field_data_wrappers = xblock_field_data_wrappers
self.disabled_xblock_types = disabled_xblock_types
Expand Down
Loading