coveragepy / coveragepy/django_coverage_plugin
Coverage differs depending on location of name-clashed template
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 202
- Forks
- 38
- PR merge metrics
- No merged PRs in 30d
Description
This is a fairly odd setup, and therefore probably not high-priority.
If a Django app has a template that shares the same namespace as a core template (say, Django Admin's registration/password_reset_done.html), then it is only used if the app appears before the Admin in the INSTALLED_APPS setting. Coverage for the local template should be 0% if the app is listed below the Admin, as it is not used by the project.
Coverage for such a template is correctly reported if such a template exists in an app template directory (e.g. app_name/templates/registration/password_reset_done.html) but not if it exists in directory specified in the TEMPLATES[0][DIRS] setting (e.g. project_templates/registration/password_reset_done.html).
An immediate workaround is to make sure you don't have a namespace clash in your templates. 😄
This may be a wont-fix, as we may not have the ability to tell these templates apart.
For more information and example output, please refer to my post here.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the namespace clash with Django Admin's registration/password_reset_done.html, comparing an app template directory with the directory configured in TEMPLATES[0][DIRS]. Trace how coverage is reported for each location and use the example output in the linked discussion as the expected behavior; done means the local template receives 0% coverage when a higher-priority template shadows it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- django, python
- Domain
- backend, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100