'Creates a new temporary file containing the specified data,
registers the file for deletion during the test fixture tear down, and
returns the absolute path of the file.'

def createNewTempFile(self, data=''):

    (newFd, newFilePath) = tempfile.mkstemp()
    try:
        self.registerFileForCleanUp(newFilePath)
        newFile = os.fdopen(newFd, 'wb')
        newFile.write(data)
        newFile.close()
    finally:
        try:
            newFile.close()
        except:
            pass
    return newFilePath
