summaryrefslogtreecommitdiffstats
path: root/tests/conftest.py
diff options
context:
space:
mode:
authorMichael Manfre2022-12-05 23:44:26 -0500
committerGitHub2022-12-05 21:44:26 -0700
commit64cea557bebdb0a5b4f17362d8e66845b0a77113 (patch)
tree7f5ff24cfa18f3aebf8c8ef91b79465363953be1 /tests/conftest.py
parent5b82c76defd8016df137087e5ce55b44cf017399 (diff)
downloadtakahe-64cea557bebdb0a5b4f17362d8e66845b0a77113.tar.gz
takahe-64cea557bebdb0a5b4f17362d8e66845b0a77113.tar.bz2
takahe-64cea557bebdb0a5b4f17362d8e66845b0a77113.zip
Collapse linkify mentions (#123)
Diffstat (limited to 'tests/conftest.py')
-rw-r--r--tests/conftest.py40
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
index 80622f0..c67717c 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -80,6 +80,12 @@ def domain() -> Domain:
@pytest.fixture
@pytest.mark.django_db
+def domain2() -> Domain:
+ return Domain.objects.create(domain="example2.com", local=True, public=True)
+
+
+@pytest.fixture
+@pytest.mark.django_db
def identity(user, domain) -> Identity:
"""
Creates a basic test identity with a user and domain.
@@ -96,6 +102,23 @@ def identity(user, domain) -> Identity:
@pytest.fixture
+@pytest.mark.django_db
+def identity2(user, domain2) -> Identity:
+ """
+ Creates a basic test identity with a user and domain.
+ """
+ identity = Identity.objects.create(
+ actor_uri="https://example2.com/@test@example2.com/",
+ username="test",
+ domain=domain2,
+ name="Test User Domain2",
+ local=True,
+ )
+ identity.users.set([user])
+ return identity
+
+
+@pytest.fixture
def other_identity(user, domain) -> Identity:
"""
Creates a different basic test identity with a user and domain.
@@ -129,6 +152,23 @@ def remote_identity() -> Identity:
@pytest.fixture
+@pytest.mark.django_db
+def remote_identity2() -> Identity:
+ """
+ Creates a basic remote test identity with a domain.
+ """
+ domain = Domain.objects.create(domain="remote2.test", local=False)
+ return Identity.objects.create(
+ actor_uri="https://remote2.test/test-actor/",
+ profile_uri="https://remote2.test/@test/",
+ username="test",
+ domain=domain,
+ name="Test2 Remote User",
+ local=False,
+ )
+
+
+@pytest.fixture
def stator(config_system) -> StatorRunner:
"""
Return an initialized StatorRunner for tests that need state transitioning