tests: upload files as binaries (#35425)

This commit is contained in:
Frédéric Péters 2019-08-18 12:21:06 +02:00
parent f48c661980
commit 176576c5e3
1 changed files with 2 additions and 2 deletions

View File

@ -178,7 +178,7 @@ def test_page_edit_picture(app, admin_user):
resp = resp.click(href='.*/picture/')
resp.form['picture'] = Upload('black.svg',
'<svg xmlns="http://www.w3.org/2000/svg"/>', 'image/svg+xml')
b'<svg xmlns="http://www.w3.org/2000/svg"/>', 'image/svg+xml')
resp = resp.form.submit()
assert resp.location.endswith('/manage/pages/%s/' % page.id)
resp = resp.follow()
@ -860,7 +860,7 @@ def test_asset_slots_management(app, admin_user):
assert '>Delete<' not in resp.text
resp = resp.click('Overwrite')
resp.form['upload'] = Upload('test.pdf', 'PDF-1.4 ...', 'application.pdf')
resp.form['upload'] = Upload('test.pdf', b'PDF-1.4 ...', 'application.pdf')
resp = resp.form.submit().follow()
assert 'test.pdf' in resp.text
assert '<img data-href' not in resp.text # no thumbnail