mirror of https://github.com/zulip/zulip.git
fixup! thumbnail: Fix MAX_EMOJI_GIF_FILE_SIZE_BYTES check to be post-resize.
This commit is contained in:
parent
f6b99171ce
commit
2b3da0e70f
|
@ -1779,6 +1779,17 @@ class EmojiTest(UploadSerializeMixin, ZulipTestCase):
|
|||
self.assert_json_error(result, "Invalid image format")
|
||||
resize_mock.assert_not_called()
|
||||
|
||||
def test_upload_too_big_after_resize(self) -> None:
|
||||
"""Non-animated image is too big after resizing"""
|
||||
self.login("iago")
|
||||
with get_test_image_file("img.png") as f:
|
||||
with patch(
|
||||
"zerver.lib.upload.resize_emoji", return_value=(b"a" * (200 * 1024), None)
|
||||
) as resize_mock:
|
||||
result = self.client_post("/json/realm/emoji/new", {"f1": f})
|
||||
self.assert_json_error(result, "Image size exceeds limit")
|
||||
resize_mock.assert_called_once()
|
||||
|
||||
def test_upload_big_after_animated_resize(self) -> None:
|
||||
"""A big animated image is fine as long as the still is small"""
|
||||
self.login("iago")
|
||||
|
|
Loading…
Reference in New Issue