Remove GenericAPIView subclass from grades API views; add a test that /api-docs/ works.

This commit is contained in:
Alex Dusenbery
2018-10-31 11:46:56 -04:00
committed by Alex Dusenbery
parent 2fc129fcda
commit 99705e54a6
3 changed files with 49 additions and 5 deletions

View File

@@ -3,8 +3,9 @@
import logging
import mimetypes
from django.urls import reverse
from django.conf import settings
from django.test import TestCase
from django.urls import reverse
from mock import patch
from six import text_type
@@ -29,6 +30,14 @@ class LmsModuleTests(TestCase):
mimetype, _ = mimetypes.guess_type('test.' + extension)
self.assertIsNotNone(mimetype)
def test_api_docs(self):
"""
Tests that requests to the `/api-docs/` endpoint do not raise an exception.
"""
assert settings.FEATURES['ENABLE_API_DOCS']
response = self.client.get('/api-docs/')
self.assertEqual(200, response.status_code)
class TemplateLookupTests(TestCase):
"""