You can collapse the previous three lines:

export.return_value = StringIO.StringIO('Fake result file content')