Small fixes

This commit is contained in:
Mouse Reeve 2022-09-19 12:10:27 -07:00
parent 9d8d85ebc1
commit bf092ec44e
5 changed files with 7 additions and 2 deletions

View file

@ -17,6 +17,7 @@ from bookwyrm.tests.validate_html import validate_html
class FederationViews(TestCase):
"""every response to a get request, html or json"""
# pylint: disable=invalid-name
def setUp(self):
"""we need basic test data and mocks"""
self.factory = RequestFactory()

View file

@ -83,6 +83,7 @@ class InviteViews(TestCase):
view = views.InviteRequest.as_view()
request = self.factory.post("", form.data)
request.user = self.local_user
result = view(request)
validate_html(result.render())
@ -97,6 +98,7 @@ class InviteViews(TestCase):
view = views.InviteRequest.as_view()
request = self.factory.post("", form.data)
request.user = self.local_user
result = view(request)
validate_html(result.render())
@ -110,6 +112,7 @@ class InviteViews(TestCase):
request = self.factory.get("")
request.user = self.local_user
request.user.is_superuser = True
result = view(request)
self.assertIsInstance(result, TemplateResponse)
validate_html(result.render())

View file

@ -15,6 +15,7 @@ from bookwyrm.tests.validate_html import validate_html
class ListViews(TestCase):
"""lists of lists"""
# pylint: disable=invalid-name
def setUp(self):
"""we need basic test data and mocks"""
self.factory = RequestFactory()

View file

@ -119,7 +119,7 @@ class ImportServerBlocklist(View):
server_name=server_name,
)
server.notes = info_link
server.save(request)
server.save()
server.block()
success_count += 1
data = {"failed": failed, "succeeded": success_count}

View file

@ -36,7 +36,7 @@ class Lists(View):
form = forms.ListForm(request.POST)
if not form.is_valid():
return redirect("lists")
book_list = form.save(request)
book_list = form.save(request, commit=False)
# list should not have a group if it is not group curated
if not book_list.curation == "group":