That's the fun part. It's just HTML attributes, so you can test them without a full browser and JS engine. Just parse the HTML. Tests are super fast and never flaky.
But how are you checking that e.g. on submit the HTMX replaced the correct selector inside another form and that on submitting that form HTMX uses a HX-Redirect header to send you to the right page? If you're not testing that, don't you get cases of tests passing when the UI is actually broken in the browser?
Just submit a request, capture the response, and test it for whatever you like. Django has a test HTTP client that lets you craft whatever request you like, submit it, and captures the response. Once you have the response it's trivial to check its HTML content and its headers.
We can use playwright for these type of tests and still stay almost entirely in Python.