Patch broadcast in test

This commit is contained in:
Mouse Reeve 2021-04-19 20:01:29 -07:00
parent 63509c954d
commit 2c013b677b

View file

@ -1,4 +1,5 @@
""" test for app action functionality """ """ test for app action functionality """
from unittest.mock import patch
from django.contrib.auth.models import Group from django.contrib.auth.models import Group
from django.template.response import TemplateResponse from django.template.response import TemplateResponse
from django.test import TestCase from django.test import TestCase
@ -58,6 +59,7 @@ class UserAdminViews(TestCase):
request.user = self.local_user request.user = self.local_user
request.user.is_superuser = True request.user.is_superuser = True
with patch("bookwyrm.models.activitypub_mixin.broadcast_task.delay"):
result = view(request, self.local_user.id) result = view(request, self.local_user.id)
self.assertIsInstance(result, TemplateResponse) self.assertIsInstance(result, TemplateResponse)