mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-30 05:21:08 +00:00
Updates tests
This commit is contained in:
parent
9acb8e53d8
commit
ae6c2b6375
2 changed files with 10 additions and 0 deletions
|
@ -441,6 +441,9 @@ class Status(TestCase):
|
||||||
id="http://www.faraway.com/boost/12",
|
id="http://www.faraway.com/boost/12",
|
||||||
actor=self.remote_user.remote_id,
|
actor=self.remote_user.remote_id,
|
||||||
object="http://fish.com/nothing",
|
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)
|
responses.add(responses.GET, "http://fish.com/nothing", status=404)
|
||||||
|
|
|
@ -559,6 +559,9 @@ class Inbox(TestCase):
|
||||||
"id": "%s/boost" % self.status.remote_id,
|
"id": "%s/boost" % self.status.remote_id,
|
||||||
"actor": self.remote_user.remote_id,
|
"actor": self.remote_user.remote_id,
|
||||||
"object": self.status.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:
|
with patch("bookwyrm.models.status.Status.ignore_activity") as discarder:
|
||||||
discarder.return_value = False
|
discarder.return_value = False
|
||||||
|
@ -607,6 +610,9 @@ class Inbox(TestCase):
|
||||||
"id": boost.remote_id,
|
"id": boost.remote_id,
|
||||||
"actor": self.remote_user.remote_id,
|
"actor": self.remote_user.remote_id,
|
||||||
"object": self.status.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(
|
with patch(
|
||||||
|
@ -614,6 +620,7 @@ class Inbox(TestCase):
|
||||||
) as redis_mock:
|
) as redis_mock:
|
||||||
views.inbox.activity_task(activity)
|
views.inbox.activity_task(activity)
|
||||||
self.assertTrue(redis_mock.called)
|
self.assertTrue(redis_mock.called)
|
||||||
|
self.assertFalse(models.Boost.objects.exists())
|
||||||
|
|
||||||
def test_handle_unboost_unknown_boost(self):
|
def test_handle_unboost_unknown_boost(self):
|
||||||
""" undo a boost """
|
""" undo a boost """
|
||||||
|
|
Loading…
Reference in a new issue