Fix: Fix 500 error while trying to access /api/v2/docs

This commit is contained in:
winkidney
2020-03-05 12:28:45 +08:00
parent 144c816be3
commit 8d7ddf48c1
2 changed files with 7 additions and 0 deletions

View File

@@ -35,3 +35,9 @@ class CreateImageTest(TestCase):
]
}
)
class TestDocs(TestCase):
def test_should_doc_api_available_without_error(self):
response = self.client.get("/api/v2/docs")
self.assertEqual(response.status_code, 200)

View File

@@ -152,6 +152,7 @@ DRF_URL_FIELD_NAME = "resource_link"
REST_FRAMEWORK = {
# Use Django's standard `django.contrib.auth` permissions,
# or allow read-only access for unauthenticated users.
'DEFAULT_SCHEMA_CLASS': 'rest_framework.schemas.coreapi.AutoSchema',
'DEFAULT_PERMISSION_CLASSES': [
'rest_framework.permissions.IsAuthenticatedOrReadOnly'
],