From 849c221aeeee89bdb61a88b4e6080481ecfeb934 Mon Sep 17 00:00:00 2001 From: Michael Manfre Date: Sat, 26 Nov 2022 12:09:31 -0500 Subject: Local-only posting --- tests/conftest.py | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'tests/conftest.py') diff --git a/tests/conftest.py b/tests/conftest.py index 48ee95a..d506c5c 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -68,11 +68,16 @@ def user() -> User: @pytest.fixture @pytest.mark.django_db -def identity(user): +def domain() -> Domain: + return Domain.objects.create(domain="example.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. """ - domain = Domain.objects.create(domain="example.com", local=True, public=True) identity = Identity.objects.create( actor_uri="https://example.com/@test@example.com/", username="test", @@ -84,9 +89,25 @@ def identity(user): return identity +@pytest.fixture +def other_identity(user, domain) -> Identity: + """ + Creates a different basic test identity with a user and domain. + """ + identity = Identity.objects.create( + actor_uri="https://example.com/@other@example.com/", + username="other", + domain=domain, + name="Other User", + local=True, + ) + identity.users.set([user]) + return identity + + @pytest.fixture @pytest.mark.django_db -def remote_identity(): +def remote_identity() -> Identity: """ Creates a basic remote test identity with a domain. """ -- cgit v1.2.3