simonwillisonblog
simonwillisonblog copied to clipboard
WIP: Run prettier against all the templates
https://til.simonwillison.net/npm/prettier-django
It broke at least the year archive page:
Test failure in Circle CI: https://app.circleci.com/pipelines/github/simonw/simonwillisonblog/951/workflows/01ce1081-96c4-4f0e-8cfc-09360a929d91/jobs/962
System check identified no issues (2 silenced).
......F...
======================================================================
FAIL: test_markup (blog.tests.BlogTests.test_markup)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/circleci/.pyenv/versions/3.11.2/lib/python3.11/site-packages/django/test/testcases.py", line 78, in assert_and_parse_html
dom = parse_html(html)
^^^^^^^^^^^^^^^^
File "/home/circleci/.pyenv/versions/3.11.2/lib/python3.11/site-packages/django/test/html.py", line 266, in parse_html
parser.feed(html)
File "/home/circleci/.pyenv/versions/3.11.2/lib/python3.11/html/parser.py", line 110, in feed
self.goahead(0)
File "/home/circleci/.pyenv/versions/3.11.2/lib/python3.11/html/parser.py", line 172, in goahead
k = self.parse_endtag(i)
^^^^^^^^^^^^^^^^^^^^
File "/home/circleci/.pyenv/versions/3.11.2/lib/python3.11/html/parser.py", line 413, in parse_endtag
self.handle_endtag(elem)
File "/home/circleci/.pyenv/versions/3.11.2/lib/python3.11/site-packages/django/test/html.py", line 249, in handle_endtag
self.error(
File "/home/circleci/.pyenv/versions/3.11.2/lib/python3.11/site-packages/django/test/html.py", line 212, in error
raise HTMLParseError(msg, self.getpos())
django.test.html.HTMLParseError: ('Unexpected end tag `body` (Line 130, Column 0)', (130, 0))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/circleci/project/blog/tests.py", line 72, in test_markup
self.assertContains(
File "/home/circleci/.pyenv/versions/3.11.2/lib/python3.11/site-packages/django/test/testcases.py", line 524, in assertContains
text_repr, real_count, msg_prefix = self._assert_contains(
^^^^^^^^^^^^^^^^^^^^^^
File "/home/circleci/.pyenv/versions/3.11.2/lib/python3.11/site-packages/django/test/testcases.py", line 505, in _assert_contains
content = assert_and_parse_html(
^^^^^^^^^^^^^^^^^^^^^^
File "/home/circleci/.pyenv/versions/3.11.2/lib/python3.11/site-packages/django/test/testcases.py", line 81, in assert_and_parse_html
self.fail(self._formatMessage(user_msg, standardMsg))
AssertionError: Response's content is not valid HTML:
('Unexpected end tag `body` (Line 130, Column 0)', (130, 0))
----------------------------------------------------------------------
Ran 10 tests in 1.481s
FAILED (failures=1)
Destroying test database for alias 'default'...