How to use the emoji.models.Emoji function in emoji

To help you get started, we’ve selected a few emoji examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gaqzi / django-emoji / emoji / tests.py View on Github external
def test_in_should_work_when_looking_for_emoji(self):
        emoji = Emoji()
        self.assertTrue('relaxed' in emoji)
github gaqzi / django-emoji / emoji / tests.py View on Github external
def test_should_also_store_the_unicode_of_an_emoji(self):
        self.assertEqual(len(Emoji._unicode_characters), TOTAL_EMOJIS_UNICODE)
github gaqzi / django-emoji / emoji / tests.py View on Github external
def test_should_replace_hex_encoded_unicode(self):
        self.assertEqual(
            Emoji.replace_html_entities(self.HEX_KISS),
            self.UNICODE_KISS
        )
github gaqzi / django-emoji / emoji / tests.py View on Github external
def test_emoji_is_singleton(self):
        e = Emoji()
        e2 = Emoji()

        self.assertEqual(id(e), id(e2))
github gaqzi / django-emoji / emoji / tests.py View on Github external
def test_convert_instance_to_dict_and_act_like_dict(self):
        e = Emoji()
        as_dict = dict(e)

        self.assertEqual(len(as_dict), TOTAL_EMOJIS)
        self.assertEqual(as_dict['+1'], '/static/emoji/img/%2B1.png')
        with self.assertRaises(KeyError):
            as_dict['nonexistant']
github gaqzi / django-emoji / emoji / tests.py View on Github external
def test_emoji_is_singleton(self):
        e = Emoji()
        e2 = Emoji()

        self.assertEqual(id(e), id(e2))
github gaqzi / django-emoji / emoji / __init__.py View on Github external
from .models import Emoji as emoji_class

__version__ = '2.0.0'

Emoji = emoji_class()
github gaqzi / django-emoji / emoji / models.py View on Github external
def __new__(cls, *args, **kwargs):
        if not cls._instance:
            cls._instance = super(Emoji, cls).__new__(cls, *args, **kwargs)

        return cls._instance