Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependency updates and changes for Python 3.11 #175

Merged
merged 3 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM registry.lil.tools/library/python:3.9-bullseye
FROM registry.lil.tools/library/python:3.11-bookworm
ENV LANG=C.UTF-8 \
LC_ALL=C.UTF-8 \
PYTHONUNBUFFERED=1 \
Expand Down
3 changes: 2 additions & 1 deletion web/perma_payments/security.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import base64
from collections import OrderedDict, Mapping
from collections import OrderedDict
from collections.abc import Mapping
from datetime import timedelta, datetime
import hashlib
import hmac
Expand Down
12 changes: 6 additions & 6 deletions web/perma_payments/tests/test_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import pytest
from pytest_factoryboy import register
from unittest.mock import Mock

from perma_payments.constants import CS_SUBSCRIPTION_SEARCH_URL
from perma_payments.models import (STANDING_STATUSES,
Expand Down Expand Up @@ -1259,16 +1260,17 @@ def test_cybersource_callback_payment_token_invalid(client, cybersource_callback


@pytest.mark.django_db
def test_cybersource_callback_post_purchase_request(client, cybersource_callback, purchase_request, mocker):
def test_cybersource_callback_post_purchase_request(client, cybersource_callback, purchase_request_response, mocker):
mocker.patch('perma_payments.views.process_cybersource_transmission', autospec=True, return_value=cybersource_callback['valid_data'])
purchase_request = purchase_request_response.related_request
get_request = mocker.patch(
'perma_payments.views.OutgoingTransaction.objects.get',
autospec=True,
return_value = purchase_request
)
purchase_request_response = mocker.patch('perma_payments.views.PurchaseRequest.purchase_request_response', autospec=True)
act_on_cs_decision = mocker.patch.object(purchase_request_response.return_value, 'act_on_cs_decision', autospec=True)
r = mocker.patch('perma_payments.views.Response', autospec=True)
r.save_new_with_encrypted_full_response.return_value = purchase_request_response
purchase_request_response.act_on_cs_decision = Mock()

# request
response = client.post(cybersource_callback['route'], cybersource_callback['valid_data'])
Expand All @@ -1285,9 +1287,7 @@ def test_cybersource_callback_post_purchase_request(client, cybersource_callback
'message': cybersource_callback['valid_data']['message'],
}
)
act_on_cs_decision.assert_called_once_with(
purchase_request,
cybersource_callback['valid_data']['decision'],
purchase_request_response.act_on_cs_decision.assert_called_once_with(
redact(cybersource_callback['valid_data'])
)
assert response.status_code == 200
Expand Down
Loading
Loading