mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-25 09:30:33 +00:00
Merge pull request #1538 from bookwyrm-social/author-page
Author page validation
This commit is contained in:
commit
53e49baa20
2 changed files with 5 additions and 2 deletions
|
@ -12,7 +12,9 @@
|
||||||
<div>
|
<div>
|
||||||
<p>{% trans "Added:" %} {{ author.created_date | naturaltime }}</p>
|
<p>{% trans "Added:" %} {{ author.created_date | naturaltime }}</p>
|
||||||
<p>{% trans "Updated:" %} {{ author.updated_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>
|
<p>{% trans "Last edited by:" %} <a href="{{ author.last_edited_by.remote_id }}">{{ author.last_edited_by.display_name }}</a></p>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@ from django.test.client import RequestFactory
|
||||||
|
|
||||||
from bookwyrm import forms, models, views
|
from bookwyrm import forms, models, views
|
||||||
from bookwyrm.activitypub import ActivitypubResponse
|
from bookwyrm.activitypub import ActivitypubResponse
|
||||||
|
from bookwyrm.tests.validate_html import validate_html
|
||||||
|
|
||||||
|
|
||||||
class AuthorViews(TestCase):
|
class AuthorViews(TestCase):
|
||||||
|
@ -54,7 +55,7 @@ class AuthorViews(TestCase):
|
||||||
is_api.return_value = False
|
is_api.return_value = False
|
||||||
result = view(request, author.id)
|
result = view(request, author.id)
|
||||||
self.assertIsInstance(result, TemplateResponse)
|
self.assertIsInstance(result, TemplateResponse)
|
||||||
result.render()
|
validate_html(result.render())
|
||||||
self.assertEqual(result.status_code, 200)
|
self.assertEqual(result.status_code, 200)
|
||||||
self.assertEqual(result.status_code, 200)
|
self.assertEqual(result.status_code, 200)
|
||||||
|
|
||||||
|
@ -75,7 +76,7 @@ class AuthorViews(TestCase):
|
||||||
|
|
||||||
result = view(request, author.id)
|
result = view(request, author.id)
|
||||||
self.assertIsInstance(result, TemplateResponse)
|
self.assertIsInstance(result, TemplateResponse)
|
||||||
result.render()
|
validate_html(result.render())
|
||||||
self.assertEqual(result.status_code, 200)
|
self.assertEqual(result.status_code, 200)
|
||||||
self.assertEqual(result.status_code, 200)
|
self.assertEqual(result.status_code, 200)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue