Where you need one mock, you probably need the other
This commit is contained in:
@ -27,7 +27,9 @@ class ActivitypubMixins(TestCase):
|
||||
|
||||
def setUp(self):
|
||||
"""shared data"""
|
||||
with patch("bookwyrm.suggested_users.rerank_suggestions_task.delay"):
|
||||
with patch("bookwyrm.suggested_users.rerank_suggestions_task.delay"), patch(
|
||||
"bookwyrm.activitystreams.populate_stream_task.delay"
|
||||
):
|
||||
self.local_user = models.User.objects.create_user(
|
||||
"mouse", "mouse@mouse.com", "mouseword", local=True, localname="mouse"
|
||||
)
|
||||
|
@ -13,7 +13,9 @@ class BaseModel(TestCase):
|
||||
|
||||
def setUp(self):
|
||||
"""shared data"""
|
||||
with patch("bookwyrm.suggested_users.rerank_suggestions_task.delay"):
|
||||
with patch("bookwyrm.suggested_users.rerank_suggestions_task.delay"), patch(
|
||||
"bookwyrm.activitystreams.populate_stream_task.delay"
|
||||
):
|
||||
self.local_user = models.User.objects.create_user(
|
||||
"mouse", "mouse@mouse.com", "mouseword", local=True, localname="mouse"
|
||||
)
|
||||
|
@ -59,7 +59,9 @@ class ImportJob(TestCase):
|
||||
unknown_read_data["Exclusive Shelf"] = "read"
|
||||
unknown_read_data["Date Read"] = ""
|
||||
|
||||
with patch("bookwyrm.suggested_users.rerank_suggestions_task.delay"):
|
||||
with patch("bookwyrm.suggested_users.rerank_suggestions_task.delay"), patch(
|
||||
"bookwyrm.activitystreams.populate_stream_task.delay"
|
||||
):
|
||||
user = models.User.objects.create_user(
|
||||
"mouse", "mouse@mouse.mouse", "mouseword", local=True, localname="mouse"
|
||||
)
|
||||
|
@ -11,7 +11,9 @@ class List(TestCase):
|
||||
|
||||
def setUp(self):
|
||||
"""look, a list"""
|
||||
with patch("bookwyrm.suggested_users.rerank_suggestions_task.delay"):
|
||||
with patch("bookwyrm.suggested_users.rerank_suggestions_task.delay"), patch(
|
||||
"bookwyrm.activitystreams.populate_stream_task.delay"
|
||||
):
|
||||
self.local_user = models.User.objects.create_user(
|
||||
"mouse", "mouse@mouse.mouse", "mouseword", local=True, localname="mouse"
|
||||
)
|
||||
|
@ -13,7 +13,9 @@ class ReadThrough(TestCase):
|
||||
|
||||
def setUp(self):
|
||||
"""look, a shelf"""
|
||||
with patch("bookwyrm.suggested_users.rerank_suggestions_task.delay"):
|
||||
with patch("bookwyrm.suggested_users.rerank_suggestions_task.delay"), patch(
|
||||
"bookwyrm.activitystreams.populate_stream_task.delay"
|
||||
):
|
||||
self.user = models.User.objects.create_user(
|
||||
"mouse", "mouse@mouse.mouse", "mouseword", local=True, localname="mouse"
|
||||
)
|
||||
|
@ -21,7 +21,9 @@ class Relationship(TestCase):
|
||||
inbox="https://example.com/users/rat/inbox",
|
||||
outbox="https://example.com/users/rat/outbox",
|
||||
)
|
||||
with patch("bookwyrm.suggested_users.rerank_suggestions_task.delay"):
|
||||
with patch("bookwyrm.suggested_users.rerank_suggestions_task.delay"), patch(
|
||||
"bookwyrm.activitystreams.populate_stream_task.delay"
|
||||
):
|
||||
self.local_user = models.User.objects.create_user(
|
||||
"mouse", "mouse@mouse.com", "mouseword", local=True, localname="mouse"
|
||||
)
|
||||
|
@ -13,7 +13,9 @@ class Shelf(TestCase):
|
||||
|
||||
def setUp(self):
|
||||
"""look, a shelf"""
|
||||
with patch("bookwyrm.suggested_users.rerank_suggestions_task.delay"):
|
||||
with patch("bookwyrm.suggested_users.rerank_suggestions_task.delay"), patch(
|
||||
"bookwyrm.activitystreams.populate_stream_task.delay"
|
||||
):
|
||||
self.local_user = models.User.objects.create_user(
|
||||
"mouse", "mouse@mouse.mouse", "mouseword", local=True, localname="mouse"
|
||||
)
|
||||
|
@ -22,7 +22,9 @@ class Status(TestCase):
|
||||
|
||||
def setUp(self):
|
||||
"""useful things for creating a status"""
|
||||
with patch("bookwyrm.suggested_users.rerank_suggestions_task.delay"):
|
||||
with patch("bookwyrm.suggested_users.rerank_suggestions_task.delay"), patch(
|
||||
"bookwyrm.activitystreams.populate_stream_task.delay"
|
||||
):
|
||||
self.local_user = models.User.objects.create_user(
|
||||
"mouse", "mouse@mouse.mouse", "mouseword", local=True, localname="mouse"
|
||||
)
|
||||
|
@ -13,7 +13,9 @@ class User(TestCase):
|
||||
protocol = "https://" if USE_HTTPS else "http://"
|
||||
|
||||
def setUp(self):
|
||||
with patch("bookwyrm.suggested_users.rerank_suggestions_task.delay"):
|
||||
with patch("bookwyrm.suggested_users.rerank_suggestions_task.delay"), patch(
|
||||
"bookwyrm.activitystreams.populate_stream_task.delay"
|
||||
):
|
||||
self.user = models.User.objects.create_user(
|
||||
"mouse@%s" % DOMAIN,
|
||||
"mouse@mouse.mouse",
|
||||
|
Reference in New Issue
Block a user