mirror of https://github.com/zulip/zulip.git
models: Change text representation for realm emoji.
This commit changes the textual representation for realm emoji to give more info.
This commit is contained in:
parent
e3c09e0308
commit
52e5b78613
|
@ -399,7 +399,11 @@ class RealmEmoji(models.Model):
|
|||
unique_together = ("realm", "name")
|
||||
|
||||
def __str__(self) -> Text:
|
||||
return "<RealmEmoji(%s): %s %s>" % (self.realm.string_id, self.name, self.file_name)
|
||||
return "<RealmEmoji(%s): %s %s %s %s>" % (self.realm.string_id,
|
||||
self.id,
|
||||
self.name,
|
||||
self.deactivated,
|
||||
self.file_name)
|
||||
|
||||
def get_realm_emoji_uncached(realm: Realm) -> Dict[Text, Dict[str, Any]]:
|
||||
d = {}
|
||||
|
|
|
@ -61,9 +61,10 @@ class RealmEmojiTest(ZulipTestCase):
|
|||
content["emoji"]['my_emoji']['author']['email'], email)
|
||||
|
||||
realm_emoji = RealmEmoji.objects.get(name='my_emoji')
|
||||
file_name = realm_emoji.name + '.png'
|
||||
self.assertEqual(
|
||||
str(realm_emoji),
|
||||
'<RealmEmoji(zulip): my_emoji my_emoji.png>'
|
||||
'<RealmEmoji(zulip): %s my_emoji False %s>' % (realm_emoji.id, file_name)
|
||||
)
|
||||
|
||||
def test_upload_exception(self) -> None:
|
||||
|
|
Loading…
Reference in New Issue