Skip to content

Commit

Permalink
Update ddt to debug_toolbar, and update the tests now that those are …
Browse files Browse the repository at this point in the history
…just warnings
  • Loading branch information
matthiask committed Sep 13, 2018
1 parent 553f0d3 commit 07b063c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions debug_toolbar/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def check_middleware(app_configs, **kwargs):
"from %s." % setting_name,
hint="Add debug_toolbar.middleware.DebugToolbarMiddleware to "
"%s." % setting_name,
id='ddt.W001',
id='debug_toolbar.W001',
)
)
elif len(debug_toolbar_indexes) != 1:
Expand All @@ -55,7 +55,7 @@ def check_middleware(app_configs, **kwargs):
"multiple times in %s." % setting_name,
hint="Load debug_toolbar.middleware.DebugToolbarMiddleware only "
"once in %s." % setting_name,
id='ddt.W002',
id='debug_toolbar.W002',
)
)
elif gzip_index is not None and debug_toolbar_indexes[0] < gzip_index:
Expand All @@ -66,7 +66,7 @@ def check_middleware(app_configs, **kwargs):
"django.middleware.gzip.GZipMiddleware in %s." % setting_name,
hint="Move debug_toolbar.middleware.DebugToolbarMiddleware to "
"after django.middleware.gzip.GZipMiddleware in %s." % setting_name,
id='ddt.W003',
id='debug_toolbar.W003',
)
)

Expand Down
8 changes: 5 additions & 3 deletions tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import html5lib
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.core import signing
from django.core.checks import Error, run_checks
from django.core.checks import Warning, run_checks
from django.template.loader import get_template
from django.test import RequestFactory, TestCase
from django.test.utils import override_settings
Expand Down Expand Up @@ -358,11 +358,12 @@ def test_check_missing_middleware_error(self):
self.assertEqual(
messages,
[
Error(
Warning(
"debug_toolbar.middleware.DebugToolbarMiddleware is "
"missing from MIDDLEWARE.",
hint="Add debug_toolbar.middleware.DebugToolbarMiddleware "
"to MIDDLEWARE.",
id='debug_toolbar.W001',
),
]
)
Expand All @@ -380,13 +381,14 @@ def test_check_gzip_middleware_error(self):
self.assertEqual(
messages,
[
Error(
Warning(
"debug_toolbar.middleware.DebugToolbarMiddleware occurs "
"before django.middleware.gzip.GZipMiddleware in "
"MIDDLEWARE.",
hint="Move debug_toolbar.middleware.DebugToolbarMiddleware "
"to after django.middleware.gzip.GZipMiddleware in "
"MIDDLEWARE.",
id='debug_toolbar.W003',
),
]
)

0 comments on commit 07b063c

Please sign in to comment.