Skip to content

Commit 94492ac

Browse files
author
Emmanouil Konstantinidis
committed
Change 'HIDDEN' setting to 'SHOW_DOCS'
1 parent 63840e1 commit 94492ac

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

rest_framework_docs/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class DRFSettings(object):
55

66
def __init__(self):
77
self.drf_settings = {
8-
"HIDDEN": self.get_setting("HIDDEN") or False
8+
"SHOW_DOCS": self.get_setting("SHOW_DOCS") or True
99
}
1010

1111
def get_setting(self, name):

tests/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
ROOT_URLCONF = 'tests.urls'
3333

3434
REST_FRAMEWORK_DOCS = {
35-
'HIDDEN': False
35+
'SHOW_DOCS': True
3636
}
3737

3838
# Static files (CSS, JavaScript, Images)

tests/tests.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
class DRFDocsViewTests(TestCase):
77

88
SETTINGS_HIDE_DOCS = {
9-
'HIDDEN': True # Default: False
9+
'SHOW_DOCS': False # Default: True
1010
}
1111

1212
def setUp(self):
@@ -16,7 +16,7 @@ def test_settings_module(self):
1616

1717
settings = DRFSettings()
1818

19-
self.assertEqual(settings.get_setting("HIDDEN"), False)
19+
self.assertEqual(settings.get_setting("SHOW_DOCS"), True)
2020
self.assertEqual(settings.get_setting("TEST"), None)
2121

2222
def test_index_view_with_endpoints(self):
@@ -52,8 +52,8 @@ def test_index_search_with_endpoints(self):
5252
@override_settings(REST_FRAMEWORK_DOCS=SETTINGS_HIDE_DOCS)
5353
def test_index_view_docs_hidden(self):
5454
"""
55-
Should prevent the docs from loading the "HIDDEN" is set
56-
to "False" in settings
55+
Should prevent the docs from loading the "SHOW_DOCS" is set
56+
to "False" or undefined under settings
5757
"""
5858
response = self.client.get(reverse('drfdocs'))
5959

0 commit comments

Comments
 (0)