From 2d350474bf4c036f591415be7fcd303f43699aa7 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Tue, 23 Mar 2021 09:09:30 -0700 Subject: [PATCH] Mocks redis in feed view tests --- bookwyrm/tests/views/test_feed.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/bookwyrm/tests/views/test_feed.py b/bookwyrm/tests/views/test_feed.py index 426684676..1ff995732 100644 --- a/bookwyrm/tests/views/test_feed.py +++ b/bookwyrm/tests/views/test_feed.py @@ -14,6 +14,8 @@ from bookwyrm import views from bookwyrm.activitypub import ActivitypubResponse +@patch("bookwyrm.activitystreams.ActivityStream.get_activity_stream") +@patch("bookwyrm.activitystreams.ActivityStream.add_status") class FeedViews(TestCase): """ activity feed, statuses, dms """ @@ -34,7 +36,7 @@ class FeedViews(TestCase): ) models.SiteSettings.objects.create() - def test_feed(self): + def test_feed(self, *_): """ there are so many views, this just makes sure it LOADS """ view = views.Feed.as_view() request = self.factory.get("") @@ -44,7 +46,7 @@ class FeedViews(TestCase): result.render() self.assertEqual(result.status_code, 200) - def test_status_page(self): + def test_status_page(self, *_): """ there are so many views, this just makes sure it LOADS """ view = views.Status.as_view() with patch("bookwyrm.models.activitypub_mixin.broadcast_task.delay"): @@ -64,7 +66,7 @@ class FeedViews(TestCase): self.assertIsInstance(result, ActivitypubResponse) self.assertEqual(result.status_code, 200) - def test_status_page_with_image(self): + def test_status_page_with_image(self, *_): """ there are so many views, this just makes sure it LOADS """ view = views.Status.as_view() @@ -100,7 +102,7 @@ class FeedViews(TestCase): self.assertIsInstance(result, ActivitypubResponse) self.assertEqual(result.status_code, 200) - def test_replies_page(self): + def test_replies_page(self, *_): """ there are so many views, this just makes sure it LOADS """ view = views.Replies.as_view() with patch("bookwyrm.models.activitypub_mixin.broadcast_task.delay"): @@ -120,7 +122,7 @@ class FeedViews(TestCase): self.assertIsInstance(result, ActivitypubResponse) self.assertEqual(result.status_code, 200) - def test_direct_messages_page(self): + def test_direct_messages_page(self, *_): """ there are so many views, this just makes sure it LOADS """ view = views.DirectMessage.as_view() request = self.factory.get("") @@ -130,7 +132,7 @@ class FeedViews(TestCase): result.render() self.assertEqual(result.status_code, 200) - def test_get_suggested_book(self): + def test_get_suggested_book(self, *_): """ gets books the ~*~ algorithm ~*~ thinks you want to post about """ with patch("bookwyrm.models.activitypub_mixin.broadcast_task.delay"): models.ShelfBook.objects.create(