'Copies a fixture mediafile with the extension to a temporary
location and returns the path.
It keeps track of the created locations and will delete the with
`remove_mediafile_fixtures()`
`images` is a subset of \'png\', \'jpg\', and \'tiff\'. For each
specified extension a cover art image is added to the media
file.'

def create_mediafile_fixture(self, ext='mp3', images=[]):

    src = os.path.join(_common.RSRC, util.bytestring_path(('full.' + ext)))
    (handle, path) = mkstemp()
    os.close(handle)
    shutil.copyfile(src, path)
    if images:
        mediafile = MediaFile(path)
        imgs = []
        for img_ext in images:
            file = util.bytestring_path('image-2x3.{0}'.format(img_ext))
            img_path = os.path.join(_common.RSRC, file)
            with open(img_path, 'rb') as f:
                imgs.append(Image(f.read()))
        mediafile.images = imgs
        mediafile.save()
    if (not hasattr(self, '_mediafile_fixtures')):
        self._mediafile_fixtures = []
    self._mediafile_fixtures.append(path)
    return path
