'Helper function to insert 10 torrent into designated channel'

@blocking_call_on_reactor_thread
def create_torrents_in_channel(self, dispersy_cid_hex):

    for i in xrange(0, 10):
        self.insert_channel_in_db(('rand%d' % i), (42 + i), ('Test    channel    %d' % i), ('Test    description    %d' % i))
    self.channel_id = self.insert_channel_in_db(dispersy_cid_hex.decode('hex'), 42, 'Simple    Channel', 'Channel    description')
    torrent_list = [[self.channel_id, 1, 1, TORRENT_UBUNTU_FILE_INFOHASH, 1460000000, TORRENT_UBUNTU_FILE, self.tdef.get_files_with_length(), self.tdef.get_trackers_as_single_tuple()]]
    self.insert_torrents_into_channel(torrent_list)
