mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-11 04:19:25 +00:00
Use UploadedImage to check image correctness and better error responses
This commit is contained in:
@ -306,19 +306,19 @@ def test_apply_rights_recursively():
|
||||
SimpleUploadedFile(
|
||||
"test.jpg", content=b"invalid", content_type="image/jpg"
|
||||
),
|
||||
415,
|
||||
422,
|
||||
),
|
||||
(
|
||||
lambda: old_subscriber_user.make(),
|
||||
SimpleUploadedFile(
|
||||
"test.jpg", content=RED_PIXEL_PNG, content_type="invalid"
|
||||
),
|
||||
415,
|
||||
200, # PIL can guess
|
||||
),
|
||||
(
|
||||
lambda: old_subscriber_user.make(),
|
||||
SimpleUploadedFile("test.jpg", content=b"invalid", content_type="invalid"),
|
||||
415,
|
||||
422,
|
||||
),
|
||||
],
|
||||
)
|
||||
|
Reference in New Issue
Block a user