'Generates a temporary file for tests with the content
of \'file_content\' and returns the filename.
Don\'t forget to unlink the file with os.unlink() after.'

def generate_tempfile(self, file_content=None):

    local_tempfile = tempfile.NamedTemporaryFile(delete=False)
    local_tempfile.write(file_content.encode('UTF-8'))
    local_tempfile.close()
    return local_tempfile.name
