diff options
author | Michael Manfre | 2022-11-26 12:09:31 -0500 |
---|---|---|
committer | GitHub | 2022-11-26 10:09:31 -0700 |
commit | 849c221aeeee89bdb61a88b4e6080481ecfeb934 (patch) | |
tree | 323b5a720adf214f4bbbbdaadbcd30249bcdcec5 /tests/conftest.py | |
parent | c7588583927e004e10599912f6d7b76413d52730 (diff) | |
download | takahe-849c221aeeee89bdb61a88b4e6080481ecfeb934.tar.gz takahe-849c221aeeee89bdb61a88b4e6080481ecfeb934.tar.bz2 takahe-849c221aeeee89bdb61a88b4e6080481ecfeb934.zip |
Local-only posting
Diffstat (limited to 'tests/conftest.py')
-rw-r--r-- | tests/conftest.py | 27 |
1 files changed, 24 insertions, 3 deletions
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", @@ -85,8 +90,24 @@ def identity(user): @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. """ |