Skip to content

Commit 26073b4

Browse files
Fixed a type lint error and updated pytest docs
1 parent a6fd524 commit 26073b4

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

docs/customization.qmd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ The following fixtures, defined in `tests/conftest.py`, are available in the tes
2525
- `set_up_database`: Sets up the test database before running the test suite by dropping all tables and recreating them to ensure a clean state.
2626
- `session`: Provides a session for database operations in tests.
2727
- `clean_db`: Cleans up the database tables before each test by deleting all entries in the `PasswordResetToken` and `User` tables.
28-
- `client`: Provides a `TestClient` instance with the session fixture, overriding the `get_session` dependency to use the test session.
28+
- `auth_client`: Provides a `TestClient` instance with access and refresh token cookies set, overriding the `get_session` dependency to use the `session` fixture.
29+
- `unauth_client`: Provides a `TestClient` instance without authentication cookies set, overriding the `get_session` dependency to use the `session` fixture.
2930
- `test_user`: Creates a test user in the database with a predefined name, email, and hashed password.
3031

3132
To run the tests, use these commands:

tests/test_user.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from fastapi.testclient import TestClient
2-
from fastapi.responses import Response
2+
from httpx import Response
33
from sqlmodel import Session
44

55
from main import app
@@ -63,7 +63,7 @@ def test_delete_account_wrong_password(auth_client: TestClient, test_user: User)
6363
follow_redirects=False
6464
)
6565
assert response.status_code == 400
66-
assert "Password is incorrect" in response.text
66+
assert "Password is incorrect" in response.text.strip()
6767

6868

6969
def test_delete_account_success(auth_client: TestClient, test_user: User, session: Session):

0 commit comments

Comments
 (0)