Validate image size in pixels at upload time (#3003)

This commit is contained in:
Raphael Michel
2023-01-12 16:30:28 +01:00
committed by GitHub
parent 738301d2af
commit 9dd3b12625
16 changed files with 226 additions and 16 deletions

View File

@@ -31,6 +31,7 @@ from django.utils.timezone import now
from django_countries.fields import Country
from django_scopes import scopes_disabled
from pytz import UTC
from tests.const import SAMPLE_PNG
from pretix.base.models import (
InvoiceAddress, Order, OrderPosition, Question, SeatingPlan,
@@ -1018,7 +1019,7 @@ def test_position_update_question_handling(token_client, organizer, event, order
'/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"',