From 9becbb24d49da4efa163048e6716d3e24d0f01df Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Sun, 4 Dec 2022 21:30:18 -0700 Subject: [PATCH] Fix post tests, don't reply to self --- activities/views/compose.py | 1 + tests/activities/models/test_post.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/activities/views/compose.py b/activities/views/compose.py index b4ddcf5..583d6d3 100644 --- a/activities/views/compose.py +++ b/activities/views/compose.py @@ -87,6 +87,7 @@ class Compose(FormView): # Build a set of mentions for the content to start as mentioned = {self.reply_to.author} mentioned.update(self.reply_to.mentions.all()) + mentioned.discard(self.request.identity) initial["text"] = "".join( f"@{identity.handle} " for identity in mentioned ) diff --git a/tests/activities/models/test_post.py b/tests/activities/models/test_post.py index d215be0..21e7000 100644 --- a/tests/activities/models/test_post.py +++ b/tests/activities/models/test_post.py @@ -8,7 +8,7 @@ from activities.models import Post, PostStates @pytest.mark.django_db -def test_fetch_post(httpx_mock: HTTPXMock): +def test_fetch_post(httpx_mock: HTTPXMock, config_system): """ Tests that a post we don't have locally can be fetched by by_object_uri """