4545from xblock .exceptions import NoSuchServiceError
4646from xblock .field_data import FieldData # lint-amnesty, pylint: disable=wrong-import-order
4747from xblock .fields import ScopeIds # lint-amnesty, pylint: disable=wrong-import-order
48- from xblock .runtime import DictKeyValueStore , KvsFieldData # lint-amnesty, pylint: disable=wrong-import-order
48+ from xblock .runtime import ( # lint-amnesty, pylint: disable=wrong-import-order
49+ DictKeyValueStore ,
50+ KvsFieldData ,
51+ Mixologist , # lint-amnesty, pylint: disable=wrong-import-order
52+ )
4953from xblock .test .tools import TestRuntime # lint-amnesty, pylint: disable=wrong-import-order
5054from xblocks_contrib .problem .capa .tests .response_xml_factory import (
5155 OptionResponseXMLFactory , # lint-amnesty, pylint: disable=reimported
111115from xmodule .modulestore .tests .test_asides import AsideTestType # lint-amnesty, pylint: disable=wrong-import-order
112116from xmodule .services import RebindUserServiceError
113117from 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
118+ from xmodule .x_module import ( # lint-amnesty, pylint: disable=wrong-import-order
119+ STUDENT_VIEW ,
120+ ModuleStoreRuntime ,
121+ )
115122
116123TEST_DATA_DIR = settings .COMMON_TEST_DATA_ROOT
117124
@@ -1931,8 +1938,9 @@ def setUp(self):
19311938 @patch ('lms.djangoapps.courseware.block_render.has_access' , Mock (return_value = True , autospec = True ))
19321939 def _get_anonymous_id (self , course_id , xblock_class , should_get_deprecated_id : bool ): # lint-amnesty, pylint: disable=missing-function-docstring
19331940 location = course_id .make_usage_key ('dummy_category' , 'dummy_name' )
1941+ mixed_class = Mixologist (settings .XBLOCK_MIXINS ).mix (xblock_class )
19341942 block = Mock (
1935- spec = xblock_class ,
1943+ spec = mixed_class ,
19361944 _field_data = Mock (spec = FieldData , name = 'field_data' ),
19371945 location = location ,
19381946 static_asset_path = None ,
@@ -1951,8 +1959,7 @@ def _get_anonymous_id(self, course_id, xblock_class, should_get_deprecated_id: b
19511959 days_early_for_beta = None ,
19521960 )
19531961 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 )
1962+ block .bind_for_student = partial (mixed_class .bind_for_student , block )
19561963
19571964 if hasattr (xblock_class , 'module_class' ):
19581965 block .module_class = xblock_class .module_class
0 commit comments