diff --git a/api/users/tests/test_user_views.py b/api/users/tests/test_user_views.py index 5468bed..846e766 100644 --- a/api/users/tests/test_user_views.py +++ b/api/users/tests/test_user_views.py @@ -4,6 +4,7 @@ import json import pytest from unittest import mock +from django.test import Client from django.utils.http import urlsafe_base64_encode, urlsafe_base64_decode from django.utils.encoding import force_bytes @@ -38,4 +39,16 @@ def test_authenticate_post(setup_user, client): assert response.json()["success"] == True data = {"email": "random@cuebook.ai", "password": "random"} response = client.post(path, data=json.dumps(data), content_type="application/json") - assert response.json()["success"] == False \ No newline at end of file + assert response.json()["success"] == False + +# @pytest.mark.django_db(transaction=True) +def test_auth_middleware(setup_user, client): + """ test middleware """ + c = Client() + res = c.post("/accounts/login", {"email": "admin@domain.com", "password": "admin"} , follow=True) + res.status_code == 200 + res = c.get("/accounts/login", follow=True) + assert res.status_code == 200 + path = reverse("anomalyDefs") + res = c.get(path) + assert res.status_code == 200 \ No newline at end of file diff --git a/ui/src/components/Sidebar/Sidebar.js b/ui/src/components/Sidebar/Sidebar.js index 5fa1a25..cab36ca 100644 --- a/ui/src/components/Sidebar/Sidebar.js +++ b/ui/src/components/Sidebar/Sidebar.js @@ -127,7 +127,7 @@ export default function Sidebar(props) {