mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 04:53:36 +00:00
emoji_name: Raise correct exception if emoji_name is missing.
Right now, the message is "Invalid characters in emoji name" when the emoji_name is empty. Changing check_valid_emoji_name() in zerver/lib/emoji.py which validates the name to accomodate the case of missing name. The new message is "Emoji name is missing".
This commit is contained in:
committed by
Tim Abbott
parent
d60efa1478
commit
68257e28ce
@@ -102,6 +102,13 @@ class RealmEmojiTest(ZulipTestCase):
|
||||
result = self.client_post('/json/realm/emoji/my_EMoji', info=emoji_data)
|
||||
self.assert_json_error(result, 'Invalid characters in emoji name')
|
||||
|
||||
def test_missing_name_exception(self) -> None:
|
||||
self.login('iago')
|
||||
with get_test_image_file('img.png') as fp1:
|
||||
emoji_data = {'f1': fp1}
|
||||
result = self.client_post('/json/realm/emoji/', info=emoji_data)
|
||||
self.assert_json_error(result, 'Emoji name is missing')
|
||||
|
||||
def test_upload_admins_only(self) -> None:
|
||||
self.login('othello')
|
||||
realm = get_realm('zulip')
|
||||
|
||||
Reference in New Issue
Block a user