mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-23 10:01:04 +00:00
Adds mock to fields
This commit is contained in:
parent
ebc0680288
commit
ee9c5a2a4b
2 changed files with 11 additions and 9 deletions
|
@ -186,6 +186,7 @@ class ActivitypubFields(TestCase):
|
|||
|
||||
@patch("bookwyrm.models.activitypub_mixin.ObjectMixin.broadcast")
|
||||
@patch("bookwyrm.activitystreams.ActivityStream.add_status")
|
||||
@patch("bookwyrm.suggested_users.rerank_suggestions_task.delay")
|
||||
def test_privacy_field_set_activity_from_field(self, *_):
|
||||
"""translate between to/cc fields and privacy"""
|
||||
user = User.objects.create_user(
|
||||
|
|
|
@ -21,15 +21,16 @@ class ViewsHelpers(TestCase):
|
|||
"""we need basic test data and mocks"""
|
||||
self.factory = RequestFactory()
|
||||
with patch("bookwyrm.suggested_users.rerank_suggestions_task.delay"):
|
||||
self.local_user = models.User.objects.create_user(
|
||||
"mouse@local.com",
|
||||
"mouse@mouse.com",
|
||||
"mouseword",
|
||||
local=True,
|
||||
discoverable=True,
|
||||
localname="mouse",
|
||||
remote_id="https://example.com/users/mouse",
|
||||
)
|
||||
with patch("bookwyrm.suggested_users.rerank_user_task.delay"):
|
||||
self.local_user = models.User.objects.create_user(
|
||||
"mouse@local.com",
|
||||
"mouse@mouse.com",
|
||||
"mouseword",
|
||||
local=True,
|
||||
discoverable=True,
|
||||
localname="mouse",
|
||||
remote_id="https://example.com/users/mouse",
|
||||
)
|
||||
with patch("bookwyrm.models.user.set_remote_server.delay"):
|
||||
self.remote_user = models.User.objects.create_user(
|
||||
"rat",
|
||||
|
|
Loading…
Reference in a new issue