-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce debug_toolbar_urls to simplify installation
While this isn't a huge improvement, it provides a hook for us to more easily introduce library level controls for when urls are installed. It also eliminates the user from having to write an if statement for the most basic of installations.
- Loading branch information
1 parent
d81b778
commit c6bd602
Showing
5 changed files
with
58 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from django.core.exceptions import ImproperlyConfigured | ||
|
||
from debug_toolbar.toolbar import debug_toolbar_urls | ||
from tests.base import BaseTestCase | ||
|
||
|
||
class DebugToolbarUrlsTestCase(BaseTestCase): | ||
def test_empty_prefix_errors(self): | ||
with self.assertRaises(ImproperlyConfigured): | ||
debug_toolbar_urls(prefix="") | ||
|
||
def test_empty_when_debug_is_false(self): | ||
self.assertEqual(debug_toolbar_urls(), []) | ||
|
||
def test_has_path(self): | ||
with self.settings(DEBUG=True): | ||
self.assertEqual(len(debug_toolbar_urls()), 1) |