Skip to content

Commit

Permalink
Fixes Tests (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
conor-f committed Sep 1, 2023
1 parent adedb42 commit ea80ef9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
python-version: '3.11'
- name: Install deps
uses: knowsuchagency/poetry-install@v1
env:
Expand All @@ -24,7 +24,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
python-version: '3.11'
- name: Install deps
uses: knowsuchagency/poetry-install@v1
env:
Expand All @@ -38,7 +38,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
python-version: '3.11'
- name: Install deps
uses: knowsuchagency/poetry-install@v1
env:
Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
python-version: '3.11'
- name: Install deps
uses: knowsuchagency/poetry-install@v1
env:
Expand Down
11 changes: 3 additions & 8 deletions fia_api/tests/test_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from fastapi import FastAPI
from httpx import AsyncClient

from fia_api.db.models.user_details_model import UserDetailsModel
from fia_api.db.models.user_model import UserModel


Expand Down Expand Up @@ -33,12 +32,11 @@ async def test_create_delete_user(fastapi_app: FastAPI, client: AsyncClient) ->
assert response.status_code == 201
created_user = await UserModel.filter(username=username)
assert len(created_user) == 1
assert created_user[0].password_hash == password
assert created_user[0].password_hash != password
assert created_user[0].is_fully_registered is False

user_details = await UserDetailsModel.filter(user_id=created_user[0])
assert len(user_details) == 1
assert user_details[0].times_logged_in == 0
user_details = await created_user[0].user_details.get()
assert user_details.times_logged_in == 0

response = await client.post(
delete_url,
Expand All @@ -50,6 +48,3 @@ async def test_create_delete_user(fastapi_app: FastAPI, client: AsyncClient) ->
assert response.status_code == 200
matched_users = await UserModel.filter(username=username)
assert not matched_users

user_details = await UserDetailsModel.filter(user_id=created_user[0])
assert not user_details
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ maintainers = [
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.9"
python = "^3.11"
fastapi = "^0.100.0"
uvicorn = { version = "^0.22.0", extras = ["standard"] }
gunicorn = "^21.2.0"
Expand Down

0 comments on commit ea80ef9

Please sign in to comment.