Django Template Test Coverage
Templates do not store any kind of line number information like python source code does. The best you could do is monkey patch the NodeList object to record how many times each node has been evaluated, and then re-render the templates in a special mode that will show which nodes are evaluated.
EDIT: I have been corrected.
Templates DO store line number information, but only for the start of a token. I.E. if you have a TextNode span multiple lines, you will need to handle that yourself. There is some interesting code in django.templates.debug that may be useful for constructing such a coverage reporter.
Is there any way to produce a report containing the code coverage in my django test suite for my site's templates? I already have coverage for python, but coverage for templates to identify dead or untested template code would be awesome.
To clarify: I want to find lines in my templates that are never executed or emitted during my test suite.