New version of black, new whitespace
This commit is contained in:
@ -11,10 +11,10 @@ from bookwyrm.activitypub import ActivitypubResponse
|
||||
|
||||
@patch("bookwyrm.models.activitypub_mixin.broadcast_task.delay")
|
||||
class ShelfViews(TestCase):
|
||||
""" tag views"""
|
||||
"""tag views"""
|
||||
|
||||
def setUp(self):
|
||||
""" we need basic test data and mocks """
|
||||
"""we need basic test data and mocks"""
|
||||
self.factory = RequestFactory()
|
||||
self.local_user = models.User.objects.create_user(
|
||||
"mouse@local.com",
|
||||
@ -37,7 +37,7 @@ class ShelfViews(TestCase):
|
||||
models.SiteSettings.objects.create()
|
||||
|
||||
def test_shelf_page(self, _):
|
||||
""" there are so many views, this just makes sure it LOADS """
|
||||
"""there are so many views, this just makes sure it LOADS"""
|
||||
view = views.Shelf.as_view()
|
||||
shelf = self.local_user.shelf_set.first()
|
||||
request = self.factory.get("")
|
||||
@ -64,7 +64,7 @@ class ShelfViews(TestCase):
|
||||
self.assertEqual(result.status_code, 200)
|
||||
|
||||
def test_edit_shelf_privacy(self, _):
|
||||
""" set name or privacy on shelf """
|
||||
"""set name or privacy on shelf"""
|
||||
view = views.Shelf.as_view()
|
||||
shelf = self.local_user.shelf_set.get(identifier="to-read")
|
||||
self.assertEqual(shelf.privacy, "public")
|
||||
@ -84,7 +84,7 @@ class ShelfViews(TestCase):
|
||||
self.assertEqual(shelf.privacy, "unlisted")
|
||||
|
||||
def test_edit_shelf_name(self, _):
|
||||
""" change the name of an editable shelf """
|
||||
"""change the name of an editable shelf"""
|
||||
view = views.Shelf.as_view()
|
||||
shelf = models.Shelf.objects.create(name="Test Shelf", user=self.local_user)
|
||||
self.assertEqual(shelf.privacy, "public")
|
||||
@ -101,7 +101,7 @@ class ShelfViews(TestCase):
|
||||
self.assertEqual(shelf.identifier, "testshelf-%d" % shelf.id)
|
||||
|
||||
def test_edit_shelf_name_not_editable(self, _):
|
||||
""" can't change the name of an non-editable shelf """
|
||||
"""can't change the name of an non-editable shelf"""
|
||||
view = views.Shelf.as_view()
|
||||
shelf = self.local_user.shelf_set.get(identifier="to-read")
|
||||
self.assertEqual(shelf.privacy, "public")
|
||||
@ -116,7 +116,7 @@ class ShelfViews(TestCase):
|
||||
self.assertEqual(shelf.name, "To Read")
|
||||
|
||||
def test_handle_shelve(self, _):
|
||||
""" shelve a book """
|
||||
"""shelve a book"""
|
||||
request = self.factory.post(
|
||||
"", {"book": self.book.id, "shelf": self.shelf.identifier}
|
||||
)
|
||||
@ -134,7 +134,7 @@ class ShelfViews(TestCase):
|
||||
self.assertEqual(self.shelf.books.get(), self.book)
|
||||
|
||||
def test_handle_shelve_to_read(self, _):
|
||||
""" special behavior for the to-read shelf """
|
||||
"""special behavior for the to-read shelf"""
|
||||
shelf = models.Shelf.objects.get(identifier="to-read")
|
||||
request = self.factory.post(
|
||||
"", {"book": self.book.id, "shelf": shelf.identifier}
|
||||
@ -147,7 +147,7 @@ class ShelfViews(TestCase):
|
||||
self.assertEqual(shelf.books.get(), self.book)
|
||||
|
||||
def test_handle_shelve_reading(self, _):
|
||||
""" special behavior for the reading shelf """
|
||||
"""special behavior for the reading shelf"""
|
||||
shelf = models.Shelf.objects.get(identifier="reading")
|
||||
request = self.factory.post(
|
||||
"", {"book": self.book.id, "shelf": shelf.identifier}
|
||||
@ -160,7 +160,7 @@ class ShelfViews(TestCase):
|
||||
self.assertEqual(shelf.books.get(), self.book)
|
||||
|
||||
def test_handle_shelve_read(self, _):
|
||||
""" special behavior for the read shelf """
|
||||
"""special behavior for the read shelf"""
|
||||
shelf = models.Shelf.objects.get(identifier="read")
|
||||
request = self.factory.post(
|
||||
"", {"book": self.book.id, "shelf": shelf.identifier}
|
||||
@ -173,7 +173,7 @@ class ShelfViews(TestCase):
|
||||
self.assertEqual(shelf.books.get(), self.book)
|
||||
|
||||
def test_handle_unshelve(self, _):
|
||||
""" remove a book from a shelf """
|
||||
"""remove a book from a shelf"""
|
||||
with patch("bookwyrm.models.activitypub_mixin.broadcast_task.delay"):
|
||||
models.ShelfBook.objects.create(
|
||||
book=self.book, user=self.local_user, shelf=self.shelf
|
||||
|
Reference in New Issue
Block a user