Skip to content

Add note about template debug setting to README #72

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 31, 2021

Conversation

adnathanail
Copy link
Contributor

No description provided.

Copy link

@sparrowt sparrowt left a comment

Choose a reason for hiding this comment

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

Noting this in the readme would have saved me a lot of time 👍 A couple of thoughts


.. 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?)

@@ -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
Owner

Choose a reason for hiding this comment

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

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

@christopherpickering
Copy link

@nedbat wonder if this can be merged? Thanks!

@nedbat
Copy link
Owner

nedbat commented May 31, 2021

Thanks, I'll merge this and then make some tweaks.

@nedbat nedbat merged commit a66dcfb into nedbat:master May 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants