1
0
Fork 1
mirror of https://github.com/bookwyrm-social/bookwyrm.git synced 2024-12-24 09:00:33 +00:00

Merge pull request from bookwyrm-social/author-page

Author page validation
This commit is contained in:
Mouse Reeve 2021-10-15 15:02:22 -07:00 committed by GitHub
commit 53e49baa20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions
bookwyrm
templates/author
tests/views

View file

@ -12,7 +12,9 @@
<div>
<p>{% trans "Added:" %} {{ author.created_date | naturaltime }}</p>
<p>{% trans "Updated:" %} {{ author.updated_date | naturaltime }}</p>
{% if author.last_edited_by %}
<p>{% trans "Last edited by:" %} <a href="{{ author.last_edited_by.remote_id }}">{{ author.last_edited_by.display_name }}</a></p>
{% endif %}
</div>
</header>

View file

@ -9,6 +9,7 @@ from django.test.client import RequestFactory
from bookwyrm import forms, models, views
from bookwyrm.activitypub import ActivitypubResponse
from bookwyrm.tests.validate_html import validate_html
class AuthorViews(TestCase):
@ -54,7 +55,7 @@ class AuthorViews(TestCase):
is_api.return_value = False
result = view(request, author.id)
self.assertIsInstance(result, TemplateResponse)
result.render()
validate_html(result.render())
self.assertEqual(result.status_code, 200)
self.assertEqual(result.status_code, 200)
@ -75,7 +76,7 @@ class AuthorViews(TestCase):
result = view(request, author.id)
self.assertIsInstance(result, TemplateResponse)
result.render()
validate_html(result.render())
self.assertEqual(result.status_code, 200)
self.assertEqual(result.status_code, 200)