def _computer_create_temp_file(transport, scheduler, authinfo):
    """
    Internal test to check if it is possible to create a temporary file
    and then delete it in the work directory

    :note: exceptions could be raised

    :param transport: an open transport
    :param scheduler: the corresponding scheduler class
    :param authinfo: the AuthInfo object (from which one can get computer and aiidauser)
    :return: tuple of boolean indicating success or failure and an optional string message
    """
    import tempfile
    import datetime
    import os
    file_content = "Test from 'verdi computer test' on {}".format(datetime.
        datetime.now().isoformat())
    workdir = authinfo.get_workdir().format(username=transport.whoami())
    try:
        transport.chdir(workdir)
    except IOError:
        transport.makedirs(workdir)
        transport.chdir(workdir)
    with tempfile.NamedTemporaryFile(mode='w+') as tempf:
        fname = os.path.split(tempf.name)[1]
        remote_file_path = os.path.join(workdir, fname)
        tempf.write(file_content)
        tempf.flush()
        transport.putfile(tempf.name, remote_file_path)
    if not transport.path_exists(remote_file_path):
        return False, 'failed to create the file `{}` on the remote'.format(
            remote_file_path)
    handle, destfile = tempfile.mkstemp()
    os.close(handle)
    try:
        transport.getfile(remote_file_path, destfile)
        with open(destfile, encoding='utf8') as dfile:
            read_string = dfile.read()
        if read_string != file_content:
            message = (
                'retrieved file content is different from what was expected')
            message += '\n  Expected: {}'.format(file_content)
            message += '\n  Retrieved: {}'.format(read_string)
            return False, message
    finally:
        os.remove(destfile)
    transport.remove(remote_file_path)
    return True, None
