From b7fb55e6ad92fe1dfd44e1f39a54b587ecc76626 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Mon, 23 Aug 2021 14:53:48 -0700 Subject: [PATCH] Fixes test for login redirected view --- bookwyrm/tests/views/test_list.py | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/bookwyrm/tests/views/test_list.py b/bookwyrm/tests/views/test_list.py index f76b6ac92..e38f4eaec 100644 --- a/bookwyrm/tests/views/test_list.py +++ b/bookwyrm/tests/views/test_list.py @@ -91,11 +91,13 @@ class ListViews(TestCase): result.render() self.assertEqual(result.status_code, 200) - def test_bookmarked_lists_page(self): + def test_saved_lists_page(self): """there are so many views, this just makes sure it LOADS""" - view = views.BookmarkedLists.as_view() + view = views.SavedLists.as_view() with patch("bookwyrm.models.activitypub_mixin.broadcast_task.delay"): - booklist = models.List.objects.create(name="Public list", user=self.local_user) + booklist = models.List.objects.create( + name="Public list", user=self.local_user + ) models.List.objects.create( name="Private list", privacy="direct", user=self.local_user ) @@ -109,9 +111,9 @@ class ListViews(TestCase): self.assertEqual(result.status_code, 200) self.assertEqual(result.context_data["lists"].object_list, [booklist]) - def test_bookmarked_lists_page_empty(self): + def test_saved_lists_page_empty(self): """there are so many views, this just makes sure it LOADS""" - view = views.BookmarkedLists.as_view() + view = views.SavedLists.as_view() with patch("bookwyrm.models.activitypub_mixin.broadcast_task.delay"): models.List.objects.create(name="Public list", user=self.local_user) models.List.objects.create( @@ -126,9 +128,9 @@ class ListViews(TestCase): self.assertEqual(result.status_code, 200) self.assertEqual(result.context_data["lists"].object_list, []) - def test_bookmarked_lists_page_logged_out(self): - """logged out bookmarked lists""" - view = views.BookmarkedLists.as_view() + def test_saved_lists_page_logged_out(self): + """logged out saved lists""" + view = views.SavedLists.as_view() request = self.factory.get("") request.user = self.anonymous_user @@ -372,15 +374,9 @@ class ListViews(TestCase): def test_user_lists_page_logged_out(self): """there are so many views, this just makes sure it LOADS""" view = views.UserLists.as_view() - with patch("bookwyrm.models.activitypub_mixin.broadcast_task.delay"): - models.List.objects.create(name="Public list", user=self.local_user) - models.List.objects.create( - name="Private list", privacy="direct", user=self.local_user - ) request = self.factory.get("") request.user = self.anonymous_user result = view(request, self.local_user.username) - self.assertIsInstance(result, TemplateResponse) result.render() - self.assertEqual(result.status_code, 200) + self.assertEqual(result.status_code, 302)