Merge pull request #146 from cisagov/nmb/fix-deploy

Fix deploy issue with debug_toolbar URLs
This commit is contained in:
Neil MartinsenBurrell 2022-09-28 13:44:38 -05:00 committed by GitHub
commit 4c60c6e345
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 4 deletions

View file

@ -15,6 +15,15 @@ urlpatterns = [
path("health/", health.health), path("health/", health.health),
path("edit_profile/", profile.edit_profile, name="edit-profile"), path("edit_profile/", profile.edit_profile, name="edit-profile"),
path("openid/", include("djangooidc.urls")), path("openid/", include("djangooidc.urls")),
# these views respect the DEBUG setting
path("__debug__/", include("debug_toolbar.urls")),
] ]
# we normally would guard these with `if settings.DEBUG` but tests run with
# DEBUG = False even when these apps have been loaded because settings.DEBUG
# was actually True. Instead, let's add these URLs any time we are able to
# import the debug toolbar package.
try:
import debug_toolbar
urlpatterns += [path("__debug__/", include(debug_toolbar.urls))]
except ImportError:
pass

View file

@ -1,8 +1,6 @@
from django.test import Client, TestCase from django.test import Client, TestCase
from django.contrib.auth import get_user_model from django.contrib.auth import get_user_model
from registrar.models import UserProfile
class HealthTest(TestCase): class HealthTest(TestCase):
def setUp(self): def setUp(self):