forked from CGM_Public/pretix_original
Validate image size in pixels at upload time (#3003)
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
#
|
||||
import pytest
|
||||
from django.core.files.base import ContentFile
|
||||
from tests.const import SAMPLE_PNG
|
||||
|
||||
from pretix.testutils.mock import mocker_context
|
||||
|
||||
@@ -130,7 +131,7 @@ def test_patch_organizer_settings_file(token_client, organizer):
|
||||
'/api/v1/upload',
|
||||
data={
|
||||
'media_type': 'image/png',
|
||||
'file': ContentFile('file.png', 'invalid png content')
|
||||
'file': ContentFile(SAMPLE_PNG)
|
||||
},
|
||||
format='upload',
|
||||
HTTP_CONTENT_DISPOSITION='attachment; filename="file.png"',
|
||||
@@ -142,7 +143,7 @@ def test_patch_organizer_settings_file(token_client, organizer):
|
||||
'/api/v1/upload',
|
||||
data={
|
||||
'media_type': 'application/pdf',
|
||||
'file': ContentFile('file.pdf', 'invalid pdf content')
|
||||
'file': ContentFile('invalid pdf content')
|
||||
},
|
||||
format='upload',
|
||||
HTTP_CONTENT_DISPOSITION='attachment; filename="file.pdf"',
|
||||
|
||||
Reference in New Issue
Block a user