Exemplo n.º 1
0
 def setUp(self):
     self.system = get_test_descriptor_system()
     self.all_blocks = {}
     self.system.get_block = self.all_blocks.get
     self.field_data = InheritingFieldData(
         inheritable_names=['inherited'],
         kvs=DictKeyValueStore({}),
     )
Exemplo n.º 2
0
 def setUp(self):
     super(InheritingFieldDataTest, self).setUp()
     self.dummy_course_key = CourseLocator('test_org', 'test_123', 'test_run')
     self.system = get_test_descriptor_system()
     self.all_blocks = {}
     self.system.get_block = self.all_blocks.get
     self.field_data = InheritingFieldData(
         inheritable_names=['inherited'],
         kvs=DictKeyValueStore({}),
     )
Exemplo n.º 3
0
    def get_block_using_split_kvs(self, block_type, block_id, fields,
                                  defaults):
        """
        Construct an Xblock with split mongo kvs.
        """
        kvs = SplitMongoKVS(definition=Mock(),
                            initial_values=fields,
                            default_values=defaults,
                            parent=None)
        self.field_data = InheritingFieldData(
            inheritable_names=['inherited'],
            kvs=kvs,
        )
        block = self.get_a_block(
            usage_id=self.get_usage_id(block_type, block_id))

        return block