'Helper function to create filestream for upload.
Parameters :
strData : str, test string data
Optional Arguments :
filename : str, Defaults to \'test.txt\''

def _createTxtFilestream(self, strData, **kwargs):

    filename = kwargs.get(u'filename', u'test.txt')
    data = strData.encode(u'utf-8')
    filedata = BytesIO(data)
    filestream = InMemoryUploadedFile(filedata, None, filename, u'text', len(data), None)
    return filestream
