Validate author page html

This commit is contained in:
Mouse Reeve 2021-10-15 14:26:07 -07:00
parent eac1ed3484
commit 931f78d7c2

View file

@ -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)