diff --git a/app/main.py b/app/main.py index 011119b..30054ca 100644 --- a/app/main.py +++ b/app/main.py @@ -8,10 +8,10 @@ from jose import jwe, jws from jose.exceptions import JWEError, JWSError from . import crud, models, schemas, errors -from .database import get_db, engine +from .database import get_db, engine, Base from .settings import settings -models.Base.metadata.create_all(bind=engine) +Base.metadata.create_all(bind=engine) app = FastAPI() diff --git a/app/tests/test_auth.py b/app/tests/test_auth.py index 20f4688..4b1fd42 100644 --- a/app/tests/test_auth.py +++ b/app/tests/test_auth.py @@ -40,17 +40,17 @@ def test_ballot_token(): Can verify ballot tokens with MANY different tokens """ vote_ids = list(range(1000)) - election_id = 0 - token = create_ballot_token(vote_ids, election_id) + election_ref = "qwertyuiop" + token = create_ballot_token(vote_ids, election_ref) data = jws_verify(token) - assert data == {"votes": vote_ids, "election": election_id} + assert data == {"votes": vote_ids, "election": election_ref} def test_admin_token(): """ Can verify ballot tokens with MANY different tokens """ - election_id = 0 - token = create_admin_token(election_id) + election_ref = "qwertyuiop" + token = create_admin_token(election_ref) data = jws_verify(token) - assert data == {"admin": True, "election": election_id} + assert data == {"admin": True, "election": election_ref} diff --git a/requirements-dev.txt b/requirements-dev.txt index 455bc15..22afecb 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,3 +3,5 @@ requests==2.28.1 pytest==7.2.0 mypy==0.991 black==22.10.0 +alembic==1.8.1 +types-python-jose==3.3.4