1
0
Fork 0

Update to match newer code style

This commit is contained in:
Bart Schuurmans 2024-04-24 15:02:05 +02:00
parent 839ab2fafd
commit f24fdf73b5
2 changed files with 23 additions and 19 deletions

View file

@ -14,20 +14,21 @@ from bookwyrm import forms, models, views
@patch("bookwyrm.suggested_users.rerank_suggestions_task.delay")
@patch("bookwyrm.activitystreams.populate_stream_task.delay")
@patch("bookwyrm.suggested_users.rerank_user_task.delay")
class ViewsHelpers(TestCase): # pylint: disable=too-many-public-methods
class ViewsHelpers(TestCase):
"""viewing and creating statuses"""
@classmethod
def setUpTestData(self): # pylint: disable=bad-classmethod-argument
def setUpTestData(cls):
"""we need basic test data and mocks"""
with patch("bookwyrm.suggested_users.rerank_suggestions_task.delay"), patch(
"bookwyrm.activitystreams.populate_stream_task.delay"
), patch("bookwyrm.lists_stream.populate_lists_task.delay"), patch(
"bookwyrm.suggested_users.rerank_user_task.delay"
with (
patch("bookwyrm.suggested_users.rerank_suggestions_task.delay"),
patch("bookwyrm.activitystreams.populate_stream_task.delay"),
patch("bookwyrm.lists_stream.populate_lists_task.delay"),
patch("bookwyrm.suggested_users.rerank_user_task.delay"),
):
self.local_user = models.User.objects.create_user(
cls.local_user = models.User.objects.create_user(
"rat",
"rat@rat.com",
"ratword",
@ -37,10 +38,11 @@ class ViewsHelpers(TestCase): # pylint: disable=too-many-public-methods
remote_id="https://your.domain.here/user/rat",
)
with patch("bookwyrm.models.user.set_remote_server.delay"), patch(
"bookwyrm.suggested_users.rerank_user_task.delay"
with (
patch("bookwyrm.models.user.set_remote_server.delay"),
patch("bookwyrm.suggested_users.rerank_user_task.delay"),
):
self.remote_user = models.User.objects.create_user(
cls.remote_user = models.User.objects.create_user(
"mouse@example.com",
"mouse@mouse.com",
"mouseword",