Merge pull request #1542 from bookwyrm-social/cancel-button

A cancel button that leads nowhere
This commit is contained in:
Mouse Reeve 2021-10-16 07:21:39 -07:00 committed by GitHub
commit 5558216917
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 0 deletions

View file

@ -108,7 +108,13 @@
{% if not confirm_mode %}
<div class="block">
<button class="button is-primary" type="submit">{% trans "Save" %}</button>
{% if book %}
<a class="button" href="{{ book.local_path }}">{% trans "Cancel" %}</a>
{% else %}
<a href="/" class="button" data-back>
<span>{% trans "Cancel" %}</span>
</a>
{% endif %}
</div>
{% endif %}
</form>

View file

@ -58,6 +58,17 @@ class EditBookViews(TestCase):
validate_html(result.render())
self.assertEqual(result.status_code, 200)
def test_edit_book_create_page(self):
"""there are so many views, this just makes sure it LOADS"""
view = views.EditBook.as_view()
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())
self.assertEqual(result.status_code, 200)
def test_edit_book(self):
"""lets a user edit a book"""
view = views.EditBook.as_view()