diff --git a/docs/release_notes.rst b/docs/release_notes.rst index e3d1347..1d3ac2a 100644 --- a/docs/release_notes.rst +++ b/docs/release_notes.rst @@ -8,6 +8,7 @@ Version 2.1 (2024-04-30) ``get_html_submit_element``, thanks @fabiocaccamo * Added pay now button #266, thanks @ohidurbappy * Dropped support for Python 3.6 +* Fixed Django 5.0 support Version 2.0 (2022-03-25) ------------------------ diff --git a/paypal/pro/helpers.py b/paypal/pro/helpers.py index 02a5ec5..f60a6dc 100644 --- a/paypal/pro/helpers.py +++ b/paypal/pro/helpers.py @@ -47,7 +47,7 @@ def paypaltime2datetime(s): return naive else: # TIMESTAMP_FORMAT is UTC - return timezone.make_aware(naive, timezone.utc) + return timezone.make_aware(naive, timezone.timezone.utc) class PayPalError(TypeError): diff --git a/paypal/standard/forms.py b/paypal/standard/forms.py index 7e90712..b60eb61 100644 --- a/paypal/standard/forms.py +++ b/paypal/standard/forms.py @@ -89,7 +89,7 @@ def to_python(self, value): # PST/PDT is 'US/Pacific' dt = pytz.timezone("US/Pacific").localize(dt, is_dst=zone_part == "PDT") if not settings.USE_TZ: - dt = timezone.make_naive(dt, timezone=timezone.utc) + dt = timezone.make_naive(dt, timezone=timezone.timezone.utc) return dt diff --git a/paypal/standard/ipn/tests/test_ipn.py b/paypal/standard/ipn/tests/test_ipn.py index 7a9bbb3..bdf4705 100644 --- a/paypal/standard/ipn/tests/test_ipn.py +++ b/paypal/standard/ipn/tests/test_ipn.py @@ -1,13 +1,12 @@ import locale import unittest -from datetime import datetime +from datetime import datetime, timezone from decimal import Decimal from urllib.parse import urlencode from django.conf import settings from django.test import TestCase from django.test.utils import override_settings -from django.utils import timezone from paypal.standard.ipn.models import PayPalIPN from paypal.standard.ipn.signals import invalid_ipn_received, valid_ipn_received @@ -384,7 +383,6 @@ def test_postback(self): @override_settings(ROOT_URLCONF="paypal.standard.ipn.tests.test_urls") class IPNSimulatorTests(TestCase): - # Some requests, as sent by the simulator. # The simulator itself has bugs. For example, it doesn't send the 'charset'