Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_if_no_valid_emoji_return_unchanged(self):
self.assertEqual(Emoji.replace(':ducklingdrinkingcoffee:'),
':ducklingdrinkingcoffee:')
def test_replace_string_should_use_staticfiles_app(self):
self.assertEqual(
Emoji.replace(':+1:'),
'<img class="emoji" alt="+1" src="/static/emoji/img/%2B1.png">'
def test_replace_string_with_emojis(self):
test_string = '''It's raining :cat:s and :dog:s.'''
replaced_string = Emoji.replace(test_string)
self.assertTrue('cat.png' in replaced_string)
self.assertTrue('dog.png' in replaced_string)
def test_replace_string_with_emojis_no_emoji_do_nothing(self):
self.assertEqual(Emoji.replace('Hello.'), 'Hello.')