refactor: replace usages of XModuleMixin.system with XBlock.runtime

This commit is contained in:
0x29a
2023-01-09 11:44:24 +01:00
committed by Agrendalath
parent fd191db332
commit 3a1011bed8
24 changed files with 47 additions and 47 deletions

View File

@@ -1734,7 +1734,7 @@ class ProblemBlockTest(unittest.TestCase): # lint-amnesty, pylint: disable=miss
error_msg = "Superterrible error happened: ☠"
block.lcp.get_html = Mock(side_effect=Exception(error_msg))
block.system.is_author_mode = True
block.runtime.is_author_mode = True
# Try to render the block with the author mode turned on
html = block.get_problem_html()

View File

@@ -124,7 +124,7 @@ class SplitTestBlockTest(XModuleXmlImportTest, PartitionTestCase):
# view, since mock services exist and the rendering code will not short-circuit.
mocked_modulestore = Mock()
mocked_modulestore.get_course.return_value = self.course
self.split_test_block.system.modulestore = mocked_modulestore
self.split_test_block.runtime.modulestore = mocked_modulestore
@ddt.ddt
@@ -239,7 +239,7 @@ class SplitTestBlockStudioTest(SplitTestBlockTest):
mocked_course = Mock(advanced_modules=['split_test'])
mocked_modulestore = Mock()
mocked_modulestore.get_course.return_value = mocked_course
self.split_test_block.system.modulestore = mocked_modulestore
self.split_test_block.runtime.modulestore = mocked_modulestore
self.split_test_block.user_partitions = [
UserPartition(0, 'first_partition', 'First Partition', [Group("0", 'alpha'), Group("1", 'beta')])