Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,20 @@ the plugin to identify untested templates.
If you get a :code:`django.core.exceptions.ImproperlyConfigured` error,
you need to set the :code:`DJANGO_SETTINGS_MODULE` environment variable.

If you get :code:`django_coverage_plugin.plugin.DjangoTemplatePluginException: Template debugging must be enabled in settings`, change your TEMPLATES setting:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that when using pytest, the check which can raise this exception doesn't actually run properly (#73) so it might help to mention here "...or if you are using pytest and getting 0% coverage (issue #73)"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As of coveragepy/coveragepy@30c023b, the check is now a real Python warning, so pytest will display it.


.. code-block:: python
DEBUG = True

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my local testing this top-level Django DEBUG setting isn't required, only the template debug setting below is needed so TEMPLATES ... 'OPTIONS': { 'debug': True } does seem to work even with DEBUG=False.

Given it is preferable to run tests in an as-close-to-prod-as-possible configuration, perhaps remove this line & set 'debug': True, below? (or 'debug': VAR_WHICH_IS_TRUE_IN_TESTING_ONLY to avoid enabling debug templates in prod?)

TEMPLATES = [
{
...
'OPTIONS': {
'debug': DEBUG,
},
},
]
Configuration
~~~~~~~~~~~~~
Expand Down