Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-django-push-notifications for openSUSE:Factory checked in at 2023-01-06 17:05:51 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-django-push-notifications (Old) and /work/SRC/openSUSE:Factory/.python-django-push-notifications.new.1563 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-django-push-notifications" Fri Jan 6 17:05:51 2023 rev:4 rq:1056304 version:3.0.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-django-push-notifications/python-django-push-notifications.changes 2022-05-12 23:00:09.340780314 +0200 +++ /work/SRC/openSUSE:Factory/.python-django-push-notifications.new.1563/python-django-push-notifications.changes 2023-01-06 17:06:38.652548151 +0100 @@ -1,0 +2,6 @@ +Fri Jan 6 01:50:42 UTC 2023 - Steve Kowalik <steven.kowa...@suse.com> + +- Add patch support-new-apns2.patch: + * Support new apsn2 that no longer exports init_context. + +------------------------------------------------------------------- New: ---- support-new-apns2.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-django-push-notifications.spec ++++++ --- /var/tmp/diff_new_pack.oTdil2/_old 2023-01-06 17:06:39.056550420 +0100 +++ /var/tmp/diff_new_pack.oTdil2/_new 2023-01-06 17:06:39.064550465 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-django-push-notifications # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,6 +24,7 @@ License: MIT URL: https://github.com/jazzband/django-push-notifications Source: https://github.com/jazzband/django-push-notifications/archive/%{version}.tar.gz#/django-push-notifications-%{version}.tar.gz +Patch0: support-new-apns2.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -50,7 +51,7 @@ to WebPush (Chrome, Firefox and Opera) in Django. %prep -%setup -q -n django-push-notifications-%{version} +%autosetup -p1 -n django-push-notifications-%{version} djcodemod run --removed-in 4.0 push_notifications/{admin,fields,models}.py %build ++++++ support-new-apns2.patch ++++++ Index: django-push-notifications-3.0.0/tests/test_apns_models.py =================================================================== --- django-push-notifications-3.0.0.orig/tests/test_apns_models.py +++ django-push-notifications-3.0.0/tests/test_apns_models.py @@ -1,3 +1,4 @@ +import ssl from unittest import mock from apns2.client import NotificationPriority @@ -24,7 +25,7 @@ class APNSModelTestCase(TestCase): "APNS_CERTIFICATE": "/path/to/apns/certificate.pem" }) - with mock.patch("apns2.credentials.init_context"): + with mock.patch("ssl.create_default_context"): with mock.patch("apns2.client.APNsClient.connect"): with mock.patch("apns2.client.APNsClient.send_notification_batch") as s: APNSDevice.objects.all().send_message("Hello world", expiration=1) @@ -38,7 +39,7 @@ class APNSModelTestCase(TestCase): def test_apns_send_message_extra(self): self._create_devices(["abc"]) - with mock.patch("apns2.credentials.init_context"): + with mock.patch("ssl.create_default_context"): with mock.patch("apns2.client.APNsClient.connect"): with mock.patch("apns2.client.APNsClient.send_notification") as s: APNSDevice.objects.get().send_message( @@ -53,7 +54,7 @@ class APNSModelTestCase(TestCase): def test_apns_send_message(self): self._create_devices(["abc"]) - with mock.patch("apns2.credentials.init_context"): + with mock.patch("ssl.create_default_context"): with mock.patch("apns2.client.APNsClient.connect"): with mock.patch("apns2.client.APNsClient.send_notification") as s: APNSDevice.objects.get().send_message("Hello world", expiration=1) Index: django-push-notifications-3.0.0/tests/test_apns_push_payload.py =================================================================== --- django-push-notifications-3.0.0.orig/tests/test_apns_push_payload.py +++ django-push-notifications-3.0.0/tests/test_apns_push_payload.py @@ -1,3 +1,4 @@ +import ssl from unittest import mock from apns2.client import NotificationPriority @@ -10,7 +11,7 @@ from push_notifications.exceptions impor class APNSPushPayloadTest(TestCase): def test_push_payload(self): - with mock.patch("apns2.credentials.init_context"): + with mock.patch("ssl.create_default_context"): with mock.patch("apns2.client.APNsClient.connect"): with mock.patch("apns2.client.APNsClient.send_notification") as s: _apns_send( @@ -28,7 +29,7 @@ class APNSPushPayloadTest(TestCase): self.assertEqual(kargs["expiration"], 3) def test_push_payload_with_thread_id(self): - with mock.patch("apns2.credentials.init_context"): + with mock.patch("ssl.create_default_context"): with mock.patch("apns2.client.APNsClient.connect"): with mock.patch("apns2.client.APNsClient.send_notification") as s: _apns_send( @@ -44,7 +45,7 @@ class APNSPushPayloadTest(TestCase): self.assertEqual(kargs["expiration"], 3) def test_push_payload_with_alert_dict(self): - with mock.patch("apns2.credentials.init_context"): + with mock.patch("ssl.create_default_context"): with mock.patch("apns2.client.APNsClient.connect"): with mock.patch("apns2.client.APNsClient.send_notification") as s: _apns_send( @@ -60,7 +61,7 @@ class APNSPushPayloadTest(TestCase): self.assertEqual(kargs["expiration"], 3) def test_localised_push_with_empty_body(self): - with mock.patch("apns2.credentials.init_context"): + with mock.patch("ssl.create_default_context"): with mock.patch("apns2.client.APNsClient.connect"): with mock.patch("apns2.client.APNsClient.send_notification") as s: _apns_send("123", None, loc_key="TEST_LOC_KEY", expiration=3) @@ -70,7 +71,7 @@ class APNSPushPayloadTest(TestCase): self.assertEqual(kargs["expiration"], 3) def test_using_extra(self): - with mock.patch("apns2.credentials.init_context"): + with mock.patch("ssl.create_default_context"): with mock.patch("apns2.client.APNsClient.connect"): with mock.patch("apns2.client.APNsClient.send_notification") as s: _apns_send( @@ -85,7 +86,7 @@ class APNSPushPayloadTest(TestCase): self.assertEqual(kargs["expiration"], 30) def test_collapse_id(self): - with mock.patch("apns2.credentials.init_context"): + with mock.patch("ssl.create_default_context"): with mock.patch("apns2.client.APNsClient.connect"): with mock.patch("apns2.client.APNsClient.send_notification") as s: _apns_send( @@ -97,7 +98,7 @@ class APNSPushPayloadTest(TestCase): self.assertEqual(kargs["collapse_id"], "456789") def test_bad_priority(self): - with mock.patch("apns2.credentials.init_context"): + with mock.patch("ssl.create_default_context"): with mock.patch("apns2.client.APNsClient.connect"): with mock.patch("apns2.client.APNsClient.send_notification") as s: self.assertRaises(APNSUnsupportedPriority, _apns_send, "123", "_" * 2049, priority=24)