From 3cac69cd2c6d6bc566f9b551dce4d4289d51a118 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Wed, 24 Mar 2021 14:19:12 -0700 Subject: [PATCH] Updates tests --- bookwyrm/tests/models/test_status_model.py | 3 +++ bookwyrm/tests/views/test_inbox.py | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/bookwyrm/tests/models/test_status_model.py b/bookwyrm/tests/models/test_status_model.py index e4cdc4aba..bda5cef49 100644 --- a/bookwyrm/tests/models/test_status_model.py +++ b/bookwyrm/tests/models/test_status_model.py @@ -439,6 +439,9 @@ class Status(TestCase): id="http://www.faraway.com/boost/12", actor=self.remote_user.remote_id, object="http://fish.com/nothing", + published="2021-03-24T18:59:41.841208+00:00", + cc="", + to="", ) responses.add(responses.GET, "http://fish.com/nothing", status=404) diff --git a/bookwyrm/tests/views/test_inbox.py b/bookwyrm/tests/views/test_inbox.py index 10f55f89b..883fc26c9 100644 --- a/bookwyrm/tests/views/test_inbox.py +++ b/bookwyrm/tests/views/test_inbox.py @@ -543,6 +543,9 @@ class Inbox(TestCase): "id": "%s/boost" % self.status.remote_id, "actor": self.remote_user.remote_id, "object": self.status.remote_id, + "to": ["https://www.w3.org/ns/activitystreams#public"], + "cc": ["https://example.com/user/mouse/followers"], + "published": "Mon, 25 May 2020 19:31:20 GMT", } with patch("bookwyrm.models.status.Status.ignore_activity") as discarder: discarder.return_value = False @@ -589,9 +592,13 @@ class Inbox(TestCase): "id": boost.remote_id, "actor": self.remote_user.remote_id, "object": self.status.remote_id, + "to": ["https://www.w3.org/ns/activitystreams#public"], + "cc": ["https://example.com/user/mouse/followers"], + "published": "Mon, 25 May 2020 19:31:20 GMT", }, } views.inbox.activity_task(activity) + self.assertFalse(models.Boost.objects.exists()) def test_handle_unboost_unknown_boost(self): """ undo a boost """