[FIX] Write to StringIO instead of temp file while exporting
[FIX] Write to Stringio instead of file in tests