Beispiel #1
0
 def setUp(self):
     self.source = Mock()
     self.read_only = ReadOnlyFieldData(self.source)
     self.block = TestingBlock(
         runtime=Mock(),
         field_data=self.read_only,
         scope_ids=Mock(),
     )
 def setUp(self):
     self.source = Mock()
     self.read_only = ReadOnlyFieldData(self.source)
     self.runtime = TestRuntime(services={'field-data': self.read_only})
     self.block = TestingBlock(
         runtime=self.runtime,
         scope_ids=Mock(),
     )
Beispiel #3
0
 def setup_method(self):
     """
     Setup for each test case in this class.
     """
     self.source = Mock()
     self.read_only = ReadOnlyFieldData(self.source)
     self.runtime = TestRuntime(services={'field-data': self.read_only})
     self.block = TestingBlock(
         runtime=self.runtime,
         scope_ids=Mock(),
     )
Beispiel #4
0
    def __init__(self, authored_data, student_data):
        # Make sure that we don't repeatedly nest LmsFieldData instances
        if isinstance(authored_data, LmsFieldData):
            authored_data = authored_data._authored_data
        else:
            authored_data = ReadOnlyFieldData(authored_data)

        self._authored_data = authored_data
        self._student_data = student_data

        super(LmsFieldData, self).__init__({
            Scope.content: authored_data,
            Scope.settings: authored_data,
            Scope.parent: authored_data,
            Scope.children: authored_data,
            Scope.user_state_summary: student_data,
            Scope.user_state: student_data,
            Scope.user_info: student_data,
            Scope.preferences: student_data,
        })