'Tests that a duplicated xblock aside is identical to the original'

@XBlockAside.register_temp_plugin(AsideTest, 'test_aside')
@patch('xmodule.modulestore.split_mongo.caching_descriptor_system.CachingDescriptorSystem.applicable_aside_types', (lambda self, block: ['test_aside']))
def test_duplicate_equality_with_asides(self):

    def create_aside(usage_key, block_type):
        '\n                                                Helper    function    to    create    aside\n                                                '
        item = self.get_item_from_modulestore(usage_key)
        key_store = DictKeyValueStore()
        field_data = KvsFieldData(key_store)
        runtime = TestRuntime(services={'field-data': field_data})
        def_id = runtime.id_generator.create_definition(block_type)
        usage_id = runtime.id_generator.create_usage(def_id)
        aside = AsideTest(scope_ids=ScopeIds('user', block_type, def_id, usage_id), runtime=runtime)
        aside.field11 = ('%s_new_value11' % block_type)
        aside.field12 = ('%s_new_value12' % block_type)
        aside.field13 = ('%s_new_value13' % block_type)
        self.store.update_item(item, self.user.id, asides=[aside])
    create_aside(self.html_usage_key, 'html')
    create_aside(self.problem_usage_key, 'problem')
    create_aside(self.seq_usage_key, 'seq')
    create_aside(self.chapter_usage_key, 'chapter')
    self._duplicate_and_verify(self.problem_usage_key, self.seq_usage_key, check_asides=True)
    self._duplicate_and_verify(self.html_usage_key, self.seq_usage_key, check_asides=True)
    self._duplicate_and_verify(self.seq_usage_key, self.chapter_usage_key, check_asides=True)
