mock celery tasks for broadcast tests

This commit is contained in:
Mouse Reeve 2020-11-29 10:13:30 -08:00
parent 205fa0d465
commit 96563598bf

View file

@ -6,9 +6,15 @@ from bookwyrm import models, broadcast
class Book(TestCase):
def setUp(self):
with patch('bookwyrm.models.user.get_remote_reviews.delay'):
self.user = models.User.objects.create_user(
'mouse', 'mouse@mouse.mouse', 'mouseword')
local_follower = models.User.objects.create_user(
'joe', 'joe@mouse.mouse', 'jeoword')
self.user.followers.add(local_follower)
with patch('bookwyrm.models.user.set_remote_server.delay'):
follower = models.User.objects.create_user(
'rat', 'rat@mouse.mouse', 'ratword', local=False,
remote_id='http://example.com/u/1',
@ -34,11 +40,6 @@ class Book(TestCase):
bookwyrm_user=False, local=False)
self.user.followers.add(non_fr_follower)
local_follower = models.User.objects.create_user(
'joe', 'joe@mouse.mouse', 'jeoword')
self.user.followers.add(local_follower)
with patch('bookwyrm.models.user.set_remote_server.delay'):
models.User.objects.create_user(
'nutria', 'nutria@mouse.mouse', 'nuword',
remote_id='http://example.com/u/4',