Implement OTP verification

This commit is contained in:
2020-09-28 18:19:59 +02:00
parent 43bcc703d0
commit d87aade803
5 changed files with 64 additions and 29 deletions

View File

@@ -1,8 +1,10 @@
from pytest import mark
from pytest import mark, fixture
from secrets import token_hex
from app.schemas import *
from database.models import *
from tests import client
from tests.queries_test import get_test_db
def test_registration():
@@ -33,3 +35,13 @@ def test_login():
}
response = client.post("/login", json=user)
assert response.status_code == 200
def test_otp_verification(get_test_db):
user = get_test_db.query(Users).filter(Users.email == "oyvey@hotmail.com").first()
data = {
"access_key": user.access_key,
"otp": user.otp,
}
response = client.post("/otpVerification", json=data)
assert response.status_code == 200