diff --git a/bookwyrm/tests/connectors/test_abstract_connector.py b/bookwyrm/tests/connectors/test_abstract_connector.py index 57d82c26c..5c50e4b73 100644 --- a/bookwyrm/tests/connectors/test_abstract_connector.py +++ b/bookwyrm/tests/connectors/test_abstract_connector.py @@ -111,9 +111,7 @@ class AbstractConnector(TestCase): responses.GET, "https://example.com/book/abcd", json=self.edition_data ) with patch("bookwyrm.connectors.abstract_connector.load_more_data.delay"): - result = self.connector.get_or_create_book( - "https://example.com/book/abcd" - ) + result = self.connector.get_or_create_book("https://example.com/book/abcd") self.assertEqual(result, self.book) self.assertEqual(models.Edition.objects.count(), 1) self.assertEqual(models.Edition.objects.count(), 1) diff --git a/bookwyrm/tests/connectors/test_openlibrary_connector.py b/bookwyrm/tests/connectors/test_openlibrary_connector.py index 75d4bddca..699b26ed4 100644 --- a/bookwyrm/tests/connectors/test_openlibrary_connector.py +++ b/bookwyrm/tests/connectors/test_openlibrary_connector.py @@ -178,12 +178,8 @@ class Openlibrary(TestCase): @responses.activate def test_expand_book_data(self): """given a book, get more editions""" - work = models.Work.objects.create( - title="Test Work", openlibrary_key="OL1234W" - ) - edition = models.Edition.objects.create( - title="Test Edition", parent_work=work - ) + work = models.Work.objects.create(title="Test Work", openlibrary_key="OL1234W") + edition = models.Edition.objects.create(title="Test Edition", parent_work=work) responses.add( responses.GET, @@ -232,9 +228,7 @@ class Openlibrary(TestCase): "bookwyrm.connectors.openlibrary.Connector." "get_authors_from_data" ) as mock: mock.return_value = [] - result = self.connector.create_edition_from_data( - work, self.edition_data - ) + result = self.connector.create_edition_from_data(work, self.edition_data) self.assertEqual(result.parent_work, work) self.assertEqual(result.title, "Sabriel") self.assertEqual(result.isbn_10, "0060273224") diff --git a/bookwyrm/tests/models/test_shelf_model.py b/bookwyrm/tests/models/test_shelf_model.py index 487c9e61b..911df059d 100644 --- a/bookwyrm/tests/models/test_shelf_model.py +++ b/bookwyrm/tests/models/test_shelf_model.py @@ -16,9 +16,7 @@ class Shelf(TestCase): "mouse", "mouse@mouse.mouse", "mouseword", local=True, localname="mouse" ) work = models.Work.objects.create(title="Test Work") - self.book = models.Edition.objects.create( - title="test book", parent_work=work - ) + self.book = models.Edition.objects.create(title="test book", parent_work=work) def test_remote_id(self): """shelves use custom remote ids""" diff --git a/bookwyrm/tests/test_templatetags.py b/bookwyrm/tests/test_templatetags.py index 96c4ead21..8e16c9d3d 100644 --- a/bookwyrm/tests/test_templatetags.py +++ b/bookwyrm/tests/test_templatetags.py @@ -123,12 +123,8 @@ class TemplateTags(TestCase): def test_get_boosted(self, *_): """load a boosted status""" with patch("bookwyrm.models.activitypub_mixin.broadcast_task.delay"): - status = models.Review.objects.create( - user=self.remote_user, book=self.book - ) - boost = models.Boost.objects.create( - user=self.user, boosted_status=status - ) + status = models.Review.objects.create(user=self.remote_user, book=self.book) + boost = models.Boost.objects.create(user=self.user, boosted_status=status) boosted = status_display.get_boosted(boost) self.assertIsInstance(boosted, models.Review) self.assertEqual(boosted, status) diff --git a/bookwyrm/tests/views/inbox/test_inbox_create.py b/bookwyrm/tests/views/inbox/test_inbox_create.py index 967d4a761..95a5ffe3f 100644 --- a/bookwyrm/tests/views/inbox/test_inbox_create.py +++ b/bookwyrm/tests/views/inbox/test_inbox_create.py @@ -157,9 +157,7 @@ class InboxCreate(TestCase): "rating": 3, "@context": "https://www.w3.org/ns/activitystreams", } - with patch( - "bookwyrm.activitystreams.ActivityStream.add_status" - ) as redis_mock: + with patch("bookwyrm.activitystreams.ActivityStream.add_status") as redis_mock: views.inbox.activity_task(activity) self.assertTrue(redis_mock.called) rating = models.ReviewRating.objects.first() diff --git a/bookwyrm/tests/views/test_book.py b/bookwyrm/tests/views/test_book.py index 8e1234a8a..73f2cad11 100644 --- a/bookwyrm/tests/views/test_book.py +++ b/bookwyrm/tests/views/test_book.py @@ -204,9 +204,7 @@ class BookViews(TestCase): """updates user's relationships to a book""" work = models.Work.objects.create(title="test work") edition1 = models.Edition.objects.create(title="first ed", parent_work=work) - edition2 = models.Edition.objects.create( - title="second ed", parent_work=work - ) + edition2 = models.Edition.objects.create(title="second ed", parent_work=work) with patch("bookwyrm.models.activitypub_mixin.broadcast_task.delay"): shelf = models.Shelf.objects.create(name="Test Shelf", user=self.local_user) models.ShelfBook.objects.create(