adjust test

This commit is contained in:
Pablo Barton 2021-04-18 11:52:22 -04:00
parent 3d0de5bea8
commit afd1cdc2a8
2 changed files with 2 additions and 2 deletions

View file

@ -221,7 +221,7 @@ class ListViews(TestCase):
with patch("bookwyrm.models.activitypub_mixin.broadcast_task.delay") as mock:
view(request, self.list.id)
self.assertEqual(mock.call_count, 1)
self.assertEqual(mock.call_count, 2)
activity = json.loads(mock.call_args[0][1])
self.assertEqual(activity["type"], "Add")
self.assertEqual(activity["actor"], self.local_user.remote_id)

View file

@ -357,7 +357,7 @@ def normalize_book_list_ordering(book_list_id, start=0, add_offset=0):
try:
book_list = models.List.objects.get(id=book_list_id)
except models.List.DoesNotExist:
return
return HttpResponseNotFound()
items = book_list.listitem_set.filter(order__gt=start).order_by("order")
for i, item in enumerate(items, start):
effective_order = i + add_offset