forked from mirrors/bookwyrm
Fixes inbox tests
This commit is contained in:
parent
eeb8ae19db
commit
3970df312a
2 changed files with 4 additions and 3 deletions
|
@ -28,7 +28,7 @@ class Inbox(TestCase):
|
||||||
localname="mouse",
|
localname="mouse",
|
||||||
)
|
)
|
||||||
local_user.remote_id = "https://example.com/user/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"):
|
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",
|
||||||
|
@ -145,7 +145,8 @@ class Inbox(TestCase):
|
||||||
)
|
)
|
||||||
self.assertTrue(views.inbox.is_blocked_activity(activity))
|
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"""
|
"""don't let deactivated users post"""
|
||||||
self.remote_user.delete(broadcast=False)
|
self.remote_user.delete(broadcast=False)
|
||||||
self.assertTrue(self.remote_user.deleted)
|
self.assertTrue(self.remote_user.deleted)
|
||||||
|
|
|
@ -22,7 +22,7 @@ class InboxAdd(TestCase):
|
||||||
localname="mouse",
|
localname="mouse",
|
||||||
)
|
)
|
||||||
local_user.remote_id = "https://example.com/user/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"):
|
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