Skip to content
This repository has been archived by the owner on Dec 21, 2022. It is now read-only.

Only modify urls if running as DEBUG and not during unit tests. #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stuaxo
Copy link

@stuaxo stuaxo commented Jan 17, 2020

Only modify urls DEBUG is True:
Should be obvious why this is a good idea.

Disable during unit testing:
Django debug toolbar and view based tests don't always work well together don't add debug toolbar urls when running unit tests.

Only modify urls DEBUG is True:
Should be obvious why this is a good idea.

Disable during unit testing:
Django debug toolbar and view based tests don't always work well together so disable under test.
import debug_toolbar

urlpatterns = [url(r'^__debug__/', include(debug_toolbar.urls))]
if settings.DEBUG and 'test' not in sys.argv:
urlpatterns = [url(r'^__debug__/', include(debug_toolbar.urls))]
Copy link

Choose a reason for hiding this comment

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

url is Django < 2, Will need a check for path for 2 =>

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants