diff --git a/bookwyrm/tests/views/test_shelf.py b/bookwyrm/tests/views/test_shelf.py index 0d7d01cb..b2585d9c 100644 --- a/bookwyrm/tests/views/test_shelf.py +++ b/bookwyrm/tests/views/test_shelf.py @@ -1,6 +1,8 @@ """ test for app action functionality """ import json 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 @@ -53,7 +55,16 @@ class ShelfViews(TestCase): is_api.return_value = False result = view(request, self.local_user.username, shelf.identifier) self.assertIsInstance(result, TemplateResponse) - result.render() + html = result.render() + _, errors = tidy_document( + html.content, + options={ + "drop-empty-elements": False, + "warn-proprietary-attributes": False, + }, + ) + if errors: + raise Exception(errors) self.assertEqual(result.status_code, 200) with patch("bookwyrm.views.shelf.is_api_request") as is_api: diff --git a/bookwyrm/views/goal.py b/bookwyrm/views/goal.py index 105c8b90..b28c0476 100644 --- a/bookwyrm/views/goal.py +++ b/bookwyrm/views/goal.py @@ -41,7 +41,7 @@ class Goal(View): "year": year, "is_self": request.user == user, } - return TemplateResponse(request, "goal.html", data) + return TemplateResponse(request, "user/goal.html", data) def post(self, request, username, year): """update or create an annual goal""" @@ -58,7 +58,7 @@ class Goal(View): "goal": goal, "year": year, } - return TemplateResponse(request, "goal.html", data) + return TemplateResponse(request, "user/goal.html", data) goal = form.save() if request.POST.get("post-status"):