Part 5 of my series on HTMX with Django: testing the urls and views
https://dev.to/rodbv/creating-a-to-do-app-with-htmx-and-django-part-5-testing-the-views-2iml
@rodbv do you have a preferred way to test that the htmx directives are configured correctly and that htmx does what it's supposed to?
I'm still figuring this out. It would be nice to be able to assert the attributes hx-swap, hx-trigger etc but that would require e2e tests. For the unit tests, I am just asserting the content being returned by the partial template, which is OK for simple projects but I'm not very proud of it https://github.com/rodbv/todo-mx/blob/main/core/tests/test_view_tasks.py#L62
It would be great to have `assertTemplateUsed(response, "template#partial"` but it's not supported by django-template-partials yet (https://github.com/carltongibson/django-template-partials/issues/54)
@rodbv that sounds like what we're doing as well. Thank you for following up. I really need to give template partials library a go