tests: use bytes for attachments (#36515)
This commit is contained in:
parent
d62e945441
commit
8158b456fa
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue