summaryrefslogtreecommitdiffstats
path: root/tests/conftest.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/conftest.py')
-rw-r--r--tests/conftest.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
index 9127466..a86f2f3 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -1,6 +1,7 @@
import time
import pytest
+from django.conf import settings
from activities.models import Emoji
from api.models import Application, Token
@@ -74,6 +75,19 @@ def config_system(keypair):
@pytest.fixture
+def client_with_identity(client, identity, user):
+ """
+ Provides a logged-in test client with an identity selected
+ """
+ client.force_login(user)
+ session = client.session
+ session["identity_id"] = identity.id
+ session.save()
+ client.cookies[settings.SESSION_COOKIE_NAME] = session.session_key
+ return client
+
+
+@pytest.fixture
@pytest.mark.django_db
def emoji_locals():
Emoji.locals = Emoji.load_locals()