#NEWLINE# def test_realm_emoji( self ) : #NEWLINE# #INDENT# def emoji_img( name , url ) : #NEWLINE# #INDENT# return ( '<img alt="%s" class="emoji" src="%s" title="%s">' % ( name , url , name ) ) #NEWLINE# #UNINDENT# zulip_realm = get_realm ( 'zulip.com' ) #NEWLINE# url = 'https://zulip.com/test_realm_emoji.png' #NEWLINE# check_add_realm_emoji ( zulip_realm , 'test' , url ) #NEWLINE# msg = Message ( sender = get_user_profile_by_email ( 'hamlet@zulip.com' ) ) #NEWLINE# converted = bugdown . convert ( ':test:' , 'zulip.com' , msg ) #NEWLINE# self . assertEqual ( converted , ( '<p>%s</p>' % emoji_img ( ':test:' , url ) ) ) #NEWLINE# do_remove_realm_emoji ( zulip_realm , 'test' ) #NEWLINE# converted = bugdown . convert ( ':test:' , 'zulip.com' , msg ) #NEWLINE# self . assertEqual ( converted , '<p>:test:</p>' )