MCPcopy Index your code
hub / github.com/fastapi-users/fastapi-users / test_write_token

Function test_write_token

tests/test_authentication_strategy_db.py:126–135  ·  view source on GitHub ↗
(
    database_strategy: DatabaseStrategy[UserModel, IDType, AccessTokenModel],
    access_token_database: AccessTokenDatabaseMock,
    user: UserModel,
)

Source from the content-addressed store, hash-verified

124@pytest.mark.authentication
125@pytest.mark.asyncio
126async def test_write_token(
127 database_strategy: DatabaseStrategy[UserModel, IDType, AccessTokenModel],
128 access_token_database: AccessTokenDatabaseMock,
129 user: UserModel,
130):
131 token = await database_strategy.write_token(user)
132
133 access_token = await access_token_database.get_by_token(token)
134 assert access_token is not None
135 assert access_token.user_id == user.id
136
137
138@pytest.mark.authentication

Callers

nothing calls this directly

Calls 2

write_tokenMethod · 0.45
get_by_tokenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…