add forgot endpoint

This commit is contained in:
2025-12-04 15:39:44 -03:00
parent c3917addfa
commit d29ad3ceb6
14 changed files with 267 additions and 30 deletions

View File

@@ -0,0 +1,37 @@
from http import HTTPMethod
from layercake.dynamodb import DynamoDBPersistenceLayer, PartitionKey
from ..conftest import HttpApiProxy, LambdaContext
def test_forgot(
app,
seeds,
dynamodb_persistence_layer: DynamoDBPersistenceLayer,
http_api_proxy: HttpApiProxy,
lambda_context: LambdaContext,
):
r = app.lambda_handler(
http_api_proxy(
raw_path='/forgot',
method=HTTPMethod.POST,
body={'username': '07879819908'},
),
lambda_context,
)
assert 's****io@somosbeta.com.br' == r['body']['email']
app.lambda_handler(
http_api_proxy(
raw_path='/forgot',
method=HTTPMethod.POST,
body={'username': '07879819908'},
),
lambda_context,
)
forgot = dynamodb_persistence_layer.collection.query(
PartitionKey('PASSWORD_RESET'),
)
assert len(forgot['items']) == 3