You should look at how capa/tests/test_html_render.py uses textwrap.dedent to make these kind of strings fit better with the surrounding code.