Use example url in test
This commit is contained in:
parent
906201fa2a
commit
c9ed069121
|
@ -35,7 +35,7 @@ class InboxAdd(TestCase):
|
||||||
work = models.Work.objects.create(title="work title")
|
work = models.Work.objects.create(title="work title")
|
||||||
self.book = models.Edition.objects.create(
|
self.book = models.Edition.objects.create(
|
||||||
title="Test",
|
title="Test",
|
||||||
remote_id="https://bookwyrm.social/book/37292",
|
remote_id="https://example.com/book/37292",
|
||||||
parent_work=work,
|
parent_work=work,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -44,20 +44,20 @@ class InboxAdd(TestCase):
|
||||||
def test_handle_add_book_to_shelf(self):
|
def test_handle_add_book_to_shelf(self):
|
||||||
"""shelving a book"""
|
"""shelving a book"""
|
||||||
shelf = models.Shelf.objects.create(user=self.remote_user, name="Test Shelf")
|
shelf = models.Shelf.objects.create(user=self.remote_user, name="Test Shelf")
|
||||||
shelf.remote_id = "https://bookwyrm.social/user/mouse/shelf/to-read"
|
shelf.remote_id = "https://example.com/user/mouse/shelf/to-read"
|
||||||
shelf.save()
|
shelf.save()
|
||||||
|
|
||||||
activity = {
|
activity = {
|
||||||
"id": "https://bookwyrm.social/shelfbook/6189#add",
|
"id": "https://bookwyrm.l/shelfbook/6189#add",
|
||||||
"type": "Add",
|
"type": "Add",
|
||||||
"actor": "https://example.com/users/rat",
|
"actor": "https://example.com/users/rat",
|
||||||
"object": {
|
"object": {
|
||||||
"actor": self.remote_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/shelfbook/6189",
|
"id": "https://example.com/shelfbook/6189",
|
||||||
},
|
},
|
||||||
"target": "https://bookwyrm.social/user/mouse/shelf/to-read",
|
"target": "https://example.com/user/mouse/shelf/to-read",
|
||||||
"@context": "https://www.w3.org/ns/activitystreams",
|
"@context": "https://www.w3.org/ns/activitystreams",
|
||||||
}
|
}
|
||||||
views.inbox.activity_task(activity)
|
views.inbox.activity_task(activity)
|
||||||
|
@ -68,7 +68,7 @@ class InboxAdd(TestCase):
|
||||||
"""listing a book"""
|
"""listing a book"""
|
||||||
responses.add(
|
responses.add(
|
||||||
responses.GET,
|
responses.GET,
|
||||||
"https://bookwyrm.social/user/mouse/list/to-read",
|
"https://example.com/user/mouse/list/to-read",
|
||||||
json={
|
json={
|
||||||
"id": "https://example.com/list/22",
|
"id": "https://example.com/list/22",
|
||||||
"type": "BookList",
|
"type": "BookList",
|
||||||
|
@ -86,17 +86,17 @@ class InboxAdd(TestCase):
|
||||||
)
|
)
|
||||||
|
|
||||||
activity = {
|
activity = {
|
||||||
"id": "https://bookwyrm.social/listbook/6189#add",
|
"id": "https://example.com/listbook/6189#add",
|
||||||
"type": "Add",
|
"type": "Add",
|
||||||
"actor": "https://example.com/users/rat",
|
"actor": "https://example.com/users/rat",
|
||||||
"object": {
|
"object": {
|
||||||
"actor": self.remote_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://example.com/listbook/6189",
|
||||||
"order": 1,
|
"order": 1,
|
||||||
},
|
},
|
||||||
"target": "https://bookwyrm.social/user/mouse/list/to-read",
|
"target": "https://example.com/user/mouse/list/to-read",
|
||||||
"@context": "https://www.w3.org/ns/activitystreams",
|
"@context": "https://www.w3.org/ns/activitystreams",
|
||||||
}
|
}
|
||||||
views.inbox.activity_task(activity)
|
views.inbox.activity_task(activity)
|
||||||
|
@ -105,4 +105,4 @@ class InboxAdd(TestCase):
|
||||||
listitem = models.ListItem.objects.get()
|
listitem = models.ListItem.objects.get()
|
||||||
self.assertEqual(booklist.name, "Test List")
|
self.assertEqual(booklist.name, "Test List")
|
||||||
self.assertEqual(booklist.books.first(), self.book)
|
self.assertEqual(booklist.books.first(), self.book)
|
||||||
self.assertEqual(listitem.remote_id, "https://bookwyrm.social/listbook/6189")
|
self.assertEqual(listitem.remote_id, "https://example.com/listbook/6189")
|
||||||
|
|
Loading…
Reference in New Issue