From 8382d1a684f4eafe5b078cb67a43e1bbbbf956bd Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Mon, 6 Sep 2021 12:30:11 -0700 Subject: [PATCH] Updates tests --- bookwyrm/tests/views/inbox/test_inbox_delete.py | 12 +++++++++++- bookwyrm/tests/views/test_list_actions.py | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/bookwyrm/tests/views/inbox/test_inbox_delete.py b/bookwyrm/tests/views/inbox/test_inbox_delete.py index c40f7a331..f47d87374 100644 --- a/bookwyrm/tests/views/inbox/test_inbox_delete.py +++ b/bookwyrm/tests/views/inbox/test_inbox_delete.py @@ -135,6 +135,7 @@ class InboxActivities(TestCase): book_list = models.List.objects.create( name="test list", user=self.remote_user, + remote_id="https://example.com/list/1", ) activity = { "@context": "https://www.w3.org/ns/activitystreams", @@ -142,7 +143,16 @@ class InboxActivities(TestCase): "type": "Delete", "actor": "https://example.com/users/test-user", "to": ["https://www.w3.org/ns/activitystreams#Public"], - "object": {"id": book_list.remote_id, "type": "List"} + "object": { + "id": book_list.remote_id, + "owner": self.remote_user.remote_id, + "type": "BookList", + "totalItems": 0, + "first": "", + "name": "test list", + "to": [], + "cc": [], + }, } views.inbox.activity_task(activity) self.assertFalse(models.List.objects.exists()) diff --git a/bookwyrm/tests/views/test_list_actions.py b/bookwyrm/tests/views/test_list_actions.py index 8ebeea28b..b998f2749 100644 --- a/bookwyrm/tests/views/test_list_actions.py +++ b/bookwyrm/tests/views/test_list_actions.py @@ -91,6 +91,7 @@ class ListActionViews(TestCase): self.assertEqual(activity["type"], "Delete") self.assertEqual(activity["actor"], self.local_user.remote_id) self.assertEqual(activity["object"]["id"], self.list.remote_id) + self.assertEqual(activity["object"]["type"], "BookList") self.assertEqual(mock.call_count, 1) self.assertFalse(models.List.objects.exists())