Fixes actors in inbox add/remove tests

This commit is contained in:
Mouse Reeve 2021-04-08 15:50:21 -07:00
parent 32bf510755
commit 37aacee9c6
2 changed files with 8 additions and 8 deletions

View file

@ -13,15 +13,15 @@ class InboxAdd(TestCase):
def setUp(self): def setUp(self):
""" basic user and book data """ """ basic user and book data """
self.local_user = models.User.objects.create_user( local_user = models.User.objects.create_user(
"mouse@example.com", "mouse@example.com",
"mouse@mouse.com", "mouse@mouse.com",
"mouseword", "mouseword",
local=True, local=True,
localname="mouse", localname="mouse",
) )
self.local_user.remote_id = "https://example.com/user/mouse" local_user.remote_id = "https://example.com/user/mouse"
self.local_user.save(broadcast=False) local_user.save(broadcast=False)
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",
@ -52,10 +52,10 @@ class InboxAdd(TestCase):
"type": "Add", "type": "Add",
"actor": "https://example.com/users/rat", "actor": "https://example.com/users/rat",
"object": { "object": {
"actor": self.local_user.remote_id, "actor": self.remote_user.remote_id,
"type": "ShelfItem", "type": "ShelfItem",
"book": self.book.remote_id, "book": self.book.remote_id,
"id": "https://bookwyrm.social/listbook/6189", "id": "https://bookwyrm.social/shelfbook/6189",
}, },
"target": "https://bookwyrm.social/user/mouse/shelf/to-read", "target": "https://bookwyrm.social/user/mouse/shelf/to-read",
"@context": "https://www.w3.org/ns/activitystreams", "@context": "https://www.w3.org/ns/activitystreams",
@ -90,7 +90,7 @@ class InboxAdd(TestCase):
"type": "Add", "type": "Add",
"actor": "https://example.com/users/rat", "actor": "https://example.com/users/rat",
"object": { "object": {
"actor": self.local_user.remote_id, "actor": self.remote_user.remote_id,
"type": "ListItem", "type": "ListItem",
"book": self.book.remote_id, "book": self.book.remote_id,
"id": "https://bookwyrm.social/listbook/6189", "id": "https://bookwyrm.social/listbook/6189",

View file

@ -58,7 +58,7 @@ class InboxRemove(TestCase):
"type": "Remove", "type": "Remove",
"actor": "https://example.com/users/rat", "actor": "https://example.com/users/rat",
"object": { "object": {
"actor": self.local_user.remote_id, "actor": self.remote_user.remote_id,
"type": "ShelfItem", "type": "ShelfItem",
"book": self.book.remote_id, "book": self.book.remote_id,
"id": shelfbook.remote_id, "id": shelfbook.remote_id,
@ -88,7 +88,7 @@ class InboxRemove(TestCase):
"type": "Remove", "type": "Remove",
"actor": "https://example.com/users/rat", "actor": "https://example.com/users/rat",
"object": { "object": {
"actor": self.local_user.remote_id, "actor": self.remote_user.remote_id,
"type": "ListItem", "type": "ListItem",
"book": self.book.remote_id, "book": self.book.remote_id,
"id": listitem.remote_id, "id": listitem.remote_id,