tests: use bytes for attachments (#36515)

This commit is contained in:
Frédéric Péters 2019-11-15 23:34:11 +01:00
parent d62e945441
commit 8158b456fa
1 changed files with 2 additions and 2 deletions

View File

@ -9,7 +9,7 @@ import time
import pytest
from django.utils.six import StringIO
from django.utils.six import BytesIO
from quixote import cleanup
from wcs import fields
from wcs.formdef import FormDef, get_formdefs_of_all_kinds
@ -353,7 +353,7 @@ def test_unused_file_removal_job(pub):
formdata.store()
formdata.evolution[-1].parts = [AttachmentEvolutionPart('hello.txt',
fp=StringIO('hello world'), varname='testfile')]
fp=BytesIO(b'hello world'), varname='testfile')]
formdata.store()
assert len(glob.glob(os.path.join(pub.app_dir, 'attachments', '*/*'))) == 1
clean_unused_files(pub)