2022-12-22 09:18:50 -08:00
|
|
|
import pytest
|
|
|
|
|
|
|
|
from activities.models import Emoji
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.django_db
|
|
|
|
def test_emoji_ingestion(identity):
|
|
|
|
"""
|
|
|
|
Tests that emoji ingest properly from JSON-LD
|
|
|
|
"""
|
|
|
|
|
|
|
|
emoji1 = Emoji.by_ap_tag(
|
|
|
|
identity.domain,
|
|
|
|
{
|
|
|
|
"icon": {
|
|
|
|
"type": "Image",
|
|
|
|
"url": "https://example.com/emoji/custom/emoji1.png",
|
|
|
|
"mediaType": "image/png",
|
|
|
|
},
|
|
|
|
"id": "https://example.com/emoji/custom/emoji1.png",
|
|
|
|
"name": ":emoji1:",
|
|
|
|
"type": "Emoji",
|
|
|
|
"updated": "1970-01-01T00:00:00Z",
|
|
|
|
},
|
|
|
|
create=True,
|
|
|
|
)
|
|
|
|
assert emoji1.shortcode == "emoji1"
|
|
|
|
|
|
|
|
emoji2 = Emoji.by_ap_tag(
|
|
|
|
identity.domain,
|
|
|
|
{
|
|
|
|
"icon": {
|
|
|
|
"type": "Image",
|
|
|
|
"url": "https://example.com/emoji/custom/emoji2.png",
|
|
|
|
"mediaType": "image/png",
|
|
|
|
},
|
|
|
|
"id": "https://example.com/emoji/custom/emoji2.png",
|
|
|
|
"nameMap": {"und": ":emoji2:"},
|
|
|
|
"type": "Emoji",
|
|
|
|
"updated": "1970-01-01T00:00:00Z",
|
|
|
|
},
|
|
|
|
create=True,
|
|
|
|
)
|
|
|
|
assert emoji2.shortcode == "emoji2"
|
2023-02-03 16:02:35 -08:00
|
|
|
|
|
|
|
cased_emoji = Emoji.by_ap_tag(
|
|
|
|
identity.domain,
|
|
|
|
{
|
|
|
|
"icon": {
|
|
|
|
"type": "Image",
|
|
|
|
"url": "https://example.com/emoji/custom/CasedEmoji.png",
|
|
|
|
"mediaType": "image/png",
|
|
|
|
},
|
|
|
|
"id": "https://example.com/emoji/custom/CasedEmoji.png",
|
|
|
|
"nameMap": {"und": ":CasedEmoji:"},
|
|
|
|
"type": "Emoji",
|
|
|
|
"updated": "1970-01-01T00:00:00Z",
|
|
|
|
},
|
|
|
|
create=True,
|
|
|
|
)
|
|
|
|
assert cased_emoji.shortcode == "CasedEmoji"
|