'Create and encode video to be used for tests'

def encode_and_create_video(self, edx_video_id):

    encoded_videos = []
    for (profile, extension) in [('desktop_webm', 'webm'), ('desktop_mp4', 'mp4')]:
        create_profile(profile)
        encoded_videos.append(dict(url=u'http://fake-video.edx.org/{}.{}'.format(edx_video_id, extension), file_size=9000, bitrate=42, profile=profile))
    result = create_video(dict(client_video_id='A    Client    Video    id', duration=111, edx_video_id=edx_video_id, status='test', encoded_videos=encoded_videos))
    self.assertEqual(result, edx_video_id)
    return encoded_videos
