mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2025-02-17 03:25:19 +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.models.activitypub_mixin.ObjectMixin.broadcast")
|
||||||
@patch("bookwyrm.activitystreams.ActivityStream.add_status")
|
@patch("bookwyrm.activitystreams.ActivityStream.add_status")
|
||||||
|
@patch("bookwyrm.suggested_users.rerank_suggestions_task.delay")
|
||||||
def test_privacy_field_set_activity_from_field(self, *_):
|
def test_privacy_field_set_activity_from_field(self, *_):
|
||||||
"""translate between to/cc fields and privacy"""
|
"""translate between to/cc fields and privacy"""
|
||||||
user = User.objects.create_user(
|
user = User.objects.create_user(
|
||||||
|
|
|
@ -21,15 +21,16 @@ class ViewsHelpers(TestCase):
|
||||||
"""we need basic test data and mocks"""
|
"""we need basic test data and mocks"""
|
||||||
self.factory = RequestFactory()
|
self.factory = RequestFactory()
|
||||||
with patch("bookwyrm.suggested_users.rerank_suggestions_task.delay"):
|
with patch("bookwyrm.suggested_users.rerank_suggestions_task.delay"):
|
||||||
self.local_user = models.User.objects.create_user(
|
with patch("bookwyrm.suggested_users.rerank_user_task.delay"):
|
||||||
"mouse@local.com",
|
self.local_user = models.User.objects.create_user(
|
||||||
"mouse@mouse.com",
|
"mouse@local.com",
|
||||||
"mouseword",
|
"mouse@mouse.com",
|
||||||
local=True,
|
"mouseword",
|
||||||
discoverable=True,
|
local=True,
|
||||||
localname="mouse",
|
discoverable=True,
|
||||||
remote_id="https://example.com/users/mouse",
|
localname="mouse",
|
||||||
)
|
remote_id="https://example.com/users/mouse",
|
||||||
|
)
|
||||||
with patch("bookwyrm.models.user.set_remote_server.delay"):
|
with patch("bookwyrm.models.user.set_remote_server.delay"):
|
||||||
self.remote_user = models.User.objects.create_user(
|
self.remote_user = models.User.objects.create_user(
|
||||||
"rat",
|
"rat",
|
||||||
|
|
Loading…
Reference in a new issue