mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-06-02 21:39:23 +00:00
add a failing test for rss feeds for shelves
Currently can't get the test to succeed - it fails in an unrelated redis error, so pushing this so I can open a draft PR to get advice on a better test.
This commit is contained in:
parent
856737e19c
commit
4ae0dbde92
|
@ -127,3 +127,26 @@ class RssFeedView(TestCase):
|
||||||
self.assertEqual(result.status_code, 200)
|
self.assertEqual(result.status_code, 200)
|
||||||
|
|
||||||
self.assertIn(b"a sickening sense", result.content)
|
self.assertIn(b"a sickening sense", result.content)
|
||||||
|
|
||||||
|
def test_rss_shelf(self, *_):
|
||||||
|
"""load the rss feed of a shelf"""
|
||||||
|
with patch("bookwyrm.models.activitypub_mixin.broadcast_task.apply_async"):
|
||||||
|
# make the shelf
|
||||||
|
self.shelf = models.Shelf.objects.create(
|
||||||
|
name="Test Shelf", identifier="test-shelf", user=self.local_user
|
||||||
|
)
|
||||||
|
# put the shelf on the book
|
||||||
|
models.ShelfBook.objects.create(
|
||||||
|
book=self.book,
|
||||||
|
shelf=self.shelf,
|
||||||
|
user=self.local_user,
|
||||||
|
)
|
||||||
|
models.SiteSettings.objects.create()
|
||||||
|
view = rss_feed.RssShelfFeed()
|
||||||
|
request = self.factory.get("/user/books/test-shelf/rss")
|
||||||
|
request.user = self.local_user
|
||||||
|
result = view(
|
||||||
|
request, username=self.local_user.username, shelf_identifier="test-shelf"
|
||||||
|
)
|
||||||
|
self.assertEqual(result.status_code, 200)
|
||||||
|
self.assertIn(b"Example Edition", result.content)
|
||||||
|
|
Loading…
Reference in a new issue