Fixes inbox tests

This commit is contained in:
Mouse Reeve 2021-08-03 15:00:02 -07:00
parent eeb8ae19db
commit 3970df312a
2 changed files with 4 additions and 3 deletions

View file

@ -28,7 +28,7 @@ class Inbox(TestCase):
localname="mouse",
)
local_user.remote_id = "https://example.com/user/mouse"
local_user.save(broadcast=False)
local_user.save(broadcast=False, update_fields=["remote_id"])
with patch("bookwyrm.models.user.set_remote_server.delay"):
self.remote_user = models.User.objects.create_user(
"rat",
@ -145,7 +145,8 @@ class Inbox(TestCase):
)
self.assertTrue(views.inbox.is_blocked_activity(activity))
def test_create_by_deactivated_user(self):
@patch("bookwyrm.suggested_users.remove_user_task.delay")
def test_create_by_deactivated_user(self, _):
"""don't let deactivated users post"""
self.remote_user.delete(broadcast=False)
self.assertTrue(self.remote_user.deleted)

View file

@ -22,7 +22,7 @@ class InboxAdd(TestCase):
localname="mouse",
)
local_user.remote_id = "https://example.com/user/mouse"
local_user.save(broadcast=False)
local_user.save(broadcast=False, update_fields=["remote_id"])
with patch("bookwyrm.models.user.set_remote_server.delay"):
self.remote_user = models.User.objects.create_user(
"rat",