mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-23 10:01:04 +00:00
Small fixes
This commit is contained in:
parent
9d8d85ebc1
commit
bf092ec44e
5 changed files with 7 additions and 2 deletions
|
@ -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()
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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}
|
||||
|
|
|
@ -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":
|
||||
|
|
Loading…
Reference in a new issue