mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-28 19:46:46 +00:00
commit
af3faa5369
@ -152,7 +152,8 @@ REST_FRAMEWORK = {
|
|||||||
'rest_framework.authentication.BasicAuthentication',
|
'rest_framework.authentication.BasicAuthentication',
|
||||||
'rest_framework.authentication.SessionAuthentication',
|
'rest_framework.authentication.SessionAuthentication',
|
||||||
'rest_framework.authentication.TokenAuthentication',
|
'rest_framework.authentication.TokenAuthentication',
|
||||||
)
|
),
|
||||||
|
'DEFAULT_SCHEMA_CLASS': 'rest_framework.schemas.coreapi.AutoSchema'
|
||||||
}
|
}
|
||||||
|
|
||||||
WSGI_APPLICATION = 'InvenTree.wsgi.application'
|
WSGI_APPLICATION = 'InvenTree.wsgi.application'
|
||||||
|
27
InvenTree/InvenTree/test_views.py
Normal file
27
InvenTree/InvenTree/test_views.py
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
""" Unit tests for the main web views """
|
||||||
|
|
||||||
|
from django.test import TestCase
|
||||||
|
from django.urls import reverse
|
||||||
|
from django.contrib.auth import get_user_model
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
|
||||||
|
class ViewTests(TestCase):
|
||||||
|
""" Tests for various top-level views """
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
|
||||||
|
# Create a user
|
||||||
|
User = get_user_model()
|
||||||
|
User.objects.create_user('username', 'user@email.com', 'password')
|
||||||
|
|
||||||
|
self.client.login(username='username', password='password')
|
||||||
|
|
||||||
|
def test_api_doc(self):
|
||||||
|
""" Test that the api-doc view works """
|
||||||
|
|
||||||
|
api_url = os.path.join(reverse('index'), 'api-doc') + '/'
|
||||||
|
|
||||||
|
response = self.client.get(api_url)
|
||||||
|
self.assertEqual(response.status_code, 200)
|
Loading…
x
Reference in New Issue
Block a user