summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMichael Manfre2022-12-15 02:50:54 -0500
committerGitHub2022-12-15 00:50:54 -0700
commitaf3142ac3adb0d1f31d160edcb6d076b293020b1 (patch)
tree73cfd5d447f6444602c2ff401399d567c673949b /tests
parent69f1b3168ac3f29fc4bafba0418769248b10062a (diff)
downloadtakahe-af3142ac3adb0d1f31d160edcb6d076b293020b1.tar.gz
takahe-af3142ac3adb0d1f31d160edcb6d076b293020b1.tar.bz2
takahe-af3142ac3adb0d1f31d160edcb6d076b293020b1.zip
Basic Emoji suppport (#157)
Diffstat (limited to 'tests')
-rw-r--r--tests/activities/models/test_post.py4
-rw-r--r--tests/conftest.py11
2 files changed, 14 insertions, 1 deletions
diff --git a/tests/activities/models/test_post.py b/tests/activities/models/test_post.py
index a5f2f79..ff74a9e 100644
--- a/tests/activities/models/test_post.py
+++ b/tests/activities/models/test_post.py
@@ -100,7 +100,9 @@ def test_linkify_mentions_remote(
@pytest.mark.django_db
-def test_linkify_mentions_local(identity, identity2, remote_identity):
+def test_linkify_mentions_local(
+ config_system, emoji_locals, identity, identity2, remote_identity
+):
"""
Tests that we can linkify post mentions properly for local use
"""
diff --git a/tests/conftest.py b/tests/conftest.py
index f2b9d64..4466130 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -2,6 +2,7 @@ import time
import pytest
+from activities.models import Emoji
from api.models import Application, Token
from core.models import Config
from stator.runner import StatorModel, StatorRunner
@@ -69,6 +70,16 @@ def config_system(keypair):
@pytest.fixture
@pytest.mark.django_db
+def emoji_locals():
+ Emoji.locals = Emoji.load_locals()
+ Emoji.__forced__ = True
+ yield Emoji.locals
+ Emoji.__forced__ = False
+ del Emoji.locals
+
+
+@pytest.fixture
+@pytest.mark.django_db
def user() -> User:
return User.objects.create(email="test@example.com")