Helper function for html validation

This commit is contained in:
Mouse Reeve
2021-09-30 22:22:20 -07:00
parent 9c78a9d95c
commit bdb1d1998a
17 changed files with 76 additions and 338 deletions

View File

@ -1,12 +1,12 @@
""" test for app action functionality """
from unittest.mock import patch
from tidylib import tidy_document
from django.template.response import TemplateResponse
from django.test import TestCase
from django.test.client import RequestFactory
from bookwyrm import models, views
from bookwyrm.tests.validate_html import validate_html
class ChangePasswordViews(TestCase):
@ -35,10 +35,7 @@ class ChangePasswordViews(TestCase):
result = view(request)
self.assertIsInstance(result, TemplateResponse)
html = result.render()
_, errors = tidy_document(html.content)
if errors:
raise Exception(errors)
validate_html(result.render())
self.assertEqual(result.status_code, 200)
def test_password_change(self):