-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #116 from cuebook/CUEAPP#2437
Cueapp #2437 Auth Fixes
- Loading branch information
Showing
2 changed files
with
15 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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": "[email protected]", "password": "random"} | ||
response = client.post(path, data=json.dumps(data), content_type="application/json") | ||
assert response.json()["success"] == False | ||
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": "[email protected]", "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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters