-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
7 changed files
with
25 additions
and
26 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
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
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import pytest | ||
import datetime | ||
import bcrypt | ||
from tools import users_collection | ||
|
||
|
||
@pytest.fixture | ||
def fixtureuser() -> dict: | ||
users_collection.find_one_and_delete({"email": "[email protected]"}) | ||
hashed_pswd = bcrypt.hashpw("Kennwort1!".encode("utf-8"), bcrypt.gensalt(5)).decode( | ||
"utf-8" | ||
) | ||
user_data = { | ||
"password": hashed_pswd, | ||
"email": "[email protected]", | ||
"username": "FixtureUser", | ||
"createdAt": datetime.datetime.now(), | ||
} | ||
users_collection.insert_one(user_data) | ||
user_data["password"] = "Kennwort1!" | ||
return user_data |
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 |
---|---|---|
@@ -1,31 +1,10 @@ | ||
import pytest | ||
import datetime | ||
import bcrypt | ||
from tools import users_collection | ||
from fastapi.testclient import TestClient | ||
|
||
from .main import app | ||
|
||
client = TestClient(app) | ||
|
||
|
||
@pytest.fixture | ||
def fixtureuser() -> dict: | ||
users_collection.find_one_and_delete({"email": "[email protected]"}) | ||
hashed_pswd = bcrypt.hashpw("Kennwort1!".encode("utf-8"), bcrypt.gensalt(5)).decode( | ||
"utf-8" | ||
) | ||
user_data = { | ||
"password": hashed_pswd, | ||
"email": "[email protected]", | ||
"username": "FixtureUser", | ||
"createdAt": datetime.datetime.now(), | ||
} | ||
users_collection.insert_one(user_data) | ||
user_data["password"] = "Kennwort1!" | ||
return user_data | ||
|
||
|
||
# SUCCESSFUL TESTS | ||
def test_login_email_identifier(fixtureuser): | ||
response = client.post( | ||
|
File renamed without changes.
Empty file.
File renamed without changes.