mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-25 01:20:35 +00:00
Updates tests
This commit is contained in:
parent
cb21099e0b
commit
8382d1a684
2 changed files with 12 additions and 1 deletions
|
@ -135,6 +135,7 @@ class InboxActivities(TestCase):
|
||||||
book_list = models.List.objects.create(
|
book_list = models.List.objects.create(
|
||||||
name="test list",
|
name="test list",
|
||||||
user=self.remote_user,
|
user=self.remote_user,
|
||||||
|
remote_id="https://example.com/list/1",
|
||||||
)
|
)
|
||||||
activity = {
|
activity = {
|
||||||
"@context": "https://www.w3.org/ns/activitystreams",
|
"@context": "https://www.w3.org/ns/activitystreams",
|
||||||
|
@ -142,7 +143,16 @@ class InboxActivities(TestCase):
|
||||||
"type": "Delete",
|
"type": "Delete",
|
||||||
"actor": "https://example.com/users/test-user",
|
"actor": "https://example.com/users/test-user",
|
||||||
"to": ["https://www.w3.org/ns/activitystreams#Public"],
|
"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)
|
views.inbox.activity_task(activity)
|
||||||
self.assertFalse(models.List.objects.exists())
|
self.assertFalse(models.List.objects.exists())
|
||||||
|
|
|
@ -91,6 +91,7 @@ class ListActionViews(TestCase):
|
||||||
self.assertEqual(activity["type"], "Delete")
|
self.assertEqual(activity["type"], "Delete")
|
||||||
self.assertEqual(activity["actor"], self.local_user.remote_id)
|
self.assertEqual(activity["actor"], self.local_user.remote_id)
|
||||||
self.assertEqual(activity["object"]["id"], self.list.remote_id)
|
self.assertEqual(activity["object"]["id"], self.list.remote_id)
|
||||||
|
self.assertEqual(activity["object"]["type"], "BookList")
|
||||||
|
|
||||||
self.assertEqual(mock.call_count, 1)
|
self.assertEqual(mock.call_count, 1)
|
||||||
self.assertFalse(models.List.objects.exists())
|
self.assertFalse(models.List.objects.exists())
|
||||||
|
|
Loading…
Reference in a new issue