Skip to content

Commit 4faae90

Browse files
committed
fix: test cases
1 parent 25a2e7c commit 4faae90

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

lms/djangoapps/courseware/tests/test_block_render.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
from xmodule.modulestore.tests.test_asides import AsideTestType # lint-amnesty, pylint: disable=wrong-import-order
112112
from xmodule.services import RebindUserServiceError
113113
from xmodule.video_block import VideoBlock # lint-amnesty, pylint: disable=wrong-import-order
114-
from xmodule.x_module import STUDENT_VIEW, ModuleStoreRuntime # lint-amnesty, pylint: disable=wrong-import-order
114+
from xmodule.x_module import STUDENT_VIEW, ModuleStoreRuntime, XModuleMixin # lint-amnesty, pylint: disable=wrong-import-order
115115

116116
TEST_DATA_DIR = settings.COMMON_TEST_DATA_ROOT
117117

@@ -1951,8 +1951,8 @@ def _get_anonymous_id(self, course_id, xblock_class, should_get_deprecated_id: b
19511951
days_early_for_beta=None,
19521952
)
19531953
block.runtime = ModuleStoreRuntime(None, None, None)
1954-
# Use the xblock_class's bind_for_student method
1955-
block.bind_for_student = partial(xblock_class.bind_for_student, block)
1954+
# Use XModuleMixin.bind_for_student since it's no longer defined on the block classes directly
1955+
block.bind_for_student = partial(XModuleMixin.bind_for_student, block)
19561956

19571957
if hasattr(xblock_class, 'module_class'):
19581958
block.module_class = xblock_class.module_class

lms/djangoapps/courseware/tests/test_discussion_xblock.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ def setUp(self):
5555
})
5656
scope_ids = mock.Mock()
5757
scope_ids.usage_id.course_key = self.course_id
58+
scope_ids.usage_id.context_key = self.course_id
5859
self.block = DiscussionXBlock(
5960
self.runtime,
6061
field_data=self.data,

xmodule/modulestore/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
from operator import itemgetter
1515
from zoneinfo import ZoneInfo
1616

17-
from django.db import transaction
1817
from django.conf import settings
18+
from django.db import transaction
1919
from opaque_keys.edx.keys import AssetKey, CourseKey
2020
from opaque_keys.edx.locations import Location # For import backwards compatibility
2121
from sortedcontainers import SortedKeyList

0 commit comments

Comments
 (0)