Commit 3d322bb0 authored by impfundev's avatar impfundev

deactivated django debug tool and try setup test

parent b64fcdc9
from django.test import TestCase
from django.urls import include, path, reverse
from rest_framework.test import APITestCase, URLPatternsTestCase
# Create your tests here.
class AccountTests(APITestCase, URLPatternsTestCase):
urlpatterns = [
path("api/", include("api.urls")),
]
def test_create_account(self):
"""
Ensure can create a new account object.
"""
url = reverse("users")
response = self.client.get(url, format="json")
self.assertEqual(response.status_code, 200)
self.assertEqual(len(response.data), 1)
......@@ -9,7 +9,7 @@ from api.views import (
)
router = routers.DefaultRouter()
router.register(r"users", UserViewSet, basename="user")
router.register(r"users", UserViewSet, basename="users")
router.register(r"books", BookViewSet, basename="books")
router.register(r"members", MemberViewSet, basename="members")
router.register(r"librarians", LibrarianViewSet, basename="librarians")
......
......@@ -61,7 +61,7 @@ INSTALLED_APPS = [
"django.contrib.messages",
"django.contrib.staticfiles",
# 3rd party
"debug_toolbar",
# "debug_toolbar",
"rest_framework",
"rest_framework.authtoken",
"django_filters",
......
......@@ -25,10 +25,14 @@ urlpatterns = [
path("dashboard/", include("dashboards.urls")),
path("admin/", admin.site.urls),
path("auth/", include("authentications.urls")),
path("__debug__/", include("debug_toolbar.urls")),
# path("__debug__/", include("debug_toolbar.urls")),
# API
path("api/v1/", include("api.urls")),
path("api/v1/auth/", include("dj_rest_auth.urls")),
path("api/v1/auth/registration/", include("dj_rest_auth.registration.urls")),
path(
"api/v1/auth/registration/",
include("dj_rest_auth.registration.urls"),
name="register",
),
path("api-auth/", include("rest_framework.urls")),
]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment