Skip to content

Commit

Permalink
rename validator property
Browse files Browse the repository at this point in the history
  • Loading branch information
felipao-mx committed Oct 30, 2023
1 parent a841a0c commit b24148e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions speid/tasks/transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ def check_deposits_status(deposit: Dict) -> None:
# Si no existe en los registros se obtiene de STP y se intenta con 3 fechas
# operativas próximas a la fecha que el cliente nos proporcionó
fechas_operacion = [
get_next_business_day(req.fecha_deposito),
get_prior_business_day(req.fecha_deposito),
get_next_business_day(req.fecha_deposito + dt.timedelta(days=1)),
get_next_business_day(req.fecha_operacion),
get_prior_business_day(req.fecha_operacion),
get_next_business_day(req.fecha_operacion + dt.timedelta(days=1)),
]

for fecha_operacion in fechas_operacion:
Expand Down
2 changes: 1 addition & 1 deletion speid/validations/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
class DepositStatusQuery(BaseModel):
clave_rastreo: str
cuenta_beneficiario: Clabe
fecha_deposito: dt.date
fecha_operacion: dt.date
10 changes: 5 additions & 5 deletions tests/tasks/test_transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,14 +420,14 @@ def test_check_existing_deposit(mock_send_task) -> None:
req = dict(
clave_rastreo='Test162467872',
cuenta_beneficiario='646180157018877012',
fecha_deposito='2023-08-28',
fecha_operacion='2023-08-28',
)
check_deposits_status(req)
transaction = Transaction.objects.get(clave_rastreo=req['clave_rastreo'])
assert transaction
assert transaction.cuenta_beneficiario == req['cuenta_beneficiario']
assert transaction.fecha_operacion.date() == dt.date.fromisoformat(
req['fecha_deposito']
req['fecha_operacion']
)
assert transaction.estado is Estado.succeeded
mock_send_task.assert_called_once()
Expand All @@ -439,7 +439,7 @@ def test_check_not_existing_deposit(mock_send_task) -> None:
req = dict(
clave_rastreo='FOOBARBAZ',
cuenta_beneficiario='646180157018877012',
fecha_deposito='2023-08-28',
fecha_operacion='2023-08-28',
)
check_deposits_status(req)
with pytest.raises(DoesNotExist):
Expand All @@ -453,7 +453,7 @@ def test_check_refunded_deposit(mock_send_task):
req = dict(
clave_rastreo='Test162467872',
cuenta_beneficiario='646180157018877012',
fecha_deposito='2023-08-28',
fecha_operacion='2023-08-28',
)
check_deposits_status(req)
with pytest.raises(DoesNotExist):
Expand All @@ -476,7 +476,7 @@ def test_retry_incoming_transaction(
req = dict(
clave_rastreo=default_income_transaction['ClaveRastreo'],
cuenta_beneficiario=default_income_transaction['CuentaBeneficiario'],
fecha_deposito=(
fecha_operacion=(
f'{fecha_operacion[0:4]}-'
f'{fecha_operacion[4:6]}-{fecha_operacion[6:]}'
),
Expand Down

0 comments on commit b24148e

Please sign in to comment.