forked from mirrors/bookwyrm
Adds validate_html to announcement page tests
This commit is contained in:
parent
9facaf404f
commit
161532f8a8
1 changed files with 5 additions and 4 deletions
|
@ -5,6 +5,7 @@ from django.test import TestCase
|
||||||
from django.test.client import RequestFactory
|
from django.test.client import RequestFactory
|
||||||
|
|
||||||
from bookwyrm import forms, models, views
|
from bookwyrm import forms, models, views
|
||||||
|
from bookwyrm.tests.validate_html import validate_html
|
||||||
|
|
||||||
|
|
||||||
class AnnouncementViews(TestCase):
|
class AnnouncementViews(TestCase):
|
||||||
|
@ -38,7 +39,7 @@ class AnnouncementViews(TestCase):
|
||||||
result = view(request)
|
result = view(request)
|
||||||
|
|
||||||
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)
|
||||||
|
|
||||||
def test_announcements_page_empty(self):
|
def test_announcements_page_empty(self):
|
||||||
|
@ -51,7 +52,7 @@ class AnnouncementViews(TestCase):
|
||||||
result = view(request)
|
result = view(request)
|
||||||
|
|
||||||
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)
|
||||||
|
|
||||||
def test_announcement_page(self):
|
def test_announcement_page(self):
|
||||||
|
@ -68,7 +69,7 @@ class AnnouncementViews(TestCase):
|
||||||
result = view(request, announcement.id)
|
result = view(request, announcement.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)
|
||||||
|
|
||||||
def test_create_announcement(self):
|
def test_create_announcement(self):
|
||||||
|
@ -138,5 +139,5 @@ class AnnouncementViews(TestCase):
|
||||||
result = view(request, self.local_user.localname)
|
result = view(request, self.local_user.localname)
|
||||||
|
|
||||||
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)
|
||||||
|
|
Loading…
Reference in a new issue