forked from pool/python-django-push-notifications
Compare commits
10 Commits
82fbb6e684
...
685ff62ae8
Author | SHA256 | Date | |
---|---|---|---|
685ff62ae8 | |||
02fcef19ba | |||
5c9d7f553f | |||
099bfbebc6 | |||
d7fbea1f05 | |||
5338c74fac | |||
9c0b871a3a | |||
|
393a14b61d | ||
62256d9ef7 | |||
|
969fcc384a |
@@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:d10e1e7301ad83a1613d57b4cbdde946770605e9e8ceaf79feb91bc345470c8c
|
|
||||||
size 48006
|
|
3
django-push-notifications-3.0.2.tar.gz
Normal file
3
django-push-notifications-3.0.2.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:9429f6611662ed5a71085e604e689a05e4ef0804d7d28855429972bf2d211bd8
|
||||||
|
size 55988
|
@@ -1,3 +1,64 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Apr 3 03:41:59 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
|
||||||
|
|
||||||
|
- No more greedy globs in %files.
|
||||||
|
- Switch back to PyPi tarball, and use setuptools_scm.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Nov 29 12:14:57 UTC 2023 - Dirk Müller <dmueller@suse.com>
|
||||||
|
|
||||||
|
- update to 3.0.2:
|
||||||
|
* LegacyConfig.get_apns_use_alternative_port always return None
|
||||||
|
* Add django 4.1, remove master branch
|
||||||
|
* Update topic send_message docs in README
|
||||||
|
* Fix: HexadecimalField accepts non-hex values
|
||||||
|
* Expanded documentation for Web Push
|
||||||
|
* Allow APNS tokens of variable length.
|
||||||
|
* Add WebPush support for Safari
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Jan 6 01:50:42 UTC 2023 - Steve Kowalik <steven.kowalik@suse.com>
|
||||||
|
|
||||||
|
- Add patch support-new-apns2.patch:
|
||||||
|
* Support new apsn2 that no longer exports init_context.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed May 11 10:11:10 UTC 2022 - pgajdos@suse.com
|
||||||
|
|
||||||
|
- version update to 3.0.0
|
||||||
|
* #567 Fixes crash on bulk_send test message operation from admin by @DataGreed in #568
|
||||||
|
* Updated README: added info about APNS_AUTH_KEY_PATH, APNS_AUTH_KEY_ID, APNS_TEAM_ID by @DataGreed in #566
|
||||||
|
* Add some details to APNS settings description by @scherbakovx in #575
|
||||||
|
* Django 4.0 warnings by @jheld in #585
|
||||||
|
* Run tests on python3.9 by @bertonha in #589
|
||||||
|
* add mutable_content to fcm by @paradizer in #582
|
||||||
|
* Improve efficiency of ORM lookups by @code-review-doctor in #598
|
||||||
|
* Drop python 2.x and django before 2.2 by @sevdog in #599
|
||||||
|
* Migrate to GitHub Actions. by @jezdez in #607
|
||||||
|
* Mention WebPushDevice in README by @Tyilo in #608
|
||||||
|
* Make push optional dependecies by @sevdog in #600
|
||||||
|
* fix: Remove python3.5 deps by @bertonha in #621
|
||||||
|
* Spelling error & convert string to be translatable by @Andrew-Chen-Wang in #614
|
||||||
|
* ++Enable sending image in GCM notifications by @ashishnitinpatil in #624
|
||||||
|
* [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #625
|
||||||
|
* Change feature detection logic for database field by @sevdog in #612
|
||||||
|
* Add Edge support to webpush by @simonkern in #631
|
||||||
|
* chore: test on Django 4.0 by @bertonha in #638
|
||||||
|
* chore: test only active Django versions by @bertonha in #639
|
||||||
|
* chore: dry tests, use newer DRF on tests by @bertonha in #641
|
||||||
|
* [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #635
|
||||||
|
* More robust handling of userAgentData, fix WebPushDeviceAdmin by @simonkern in #643
|
||||||
|
* [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #644
|
||||||
|
* Add missing migration for #614 by @simonkern in #645
|
||||||
|
* Jazzband: Synced file(s) with jazzband/.github by @jazzband-bot in #626
|
||||||
|
* Show coverage badge in README. by @shimakaze-git in #651
|
||||||
|
- python-mock is not required for build
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Sun Dec 26 14:34:58 UTC 2021 - John Vandenberg <jayvdb@gmail.com>
|
||||||
|
|
||||||
|
- - Use django-codemod to make Django 4 compatible
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Aug 6 05:50:27 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
|
Thu Aug 6 05:50:27 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package python-django-push-notifications
|
# spec file for package python-django-push-notifications
|
||||||
#
|
#
|
||||||
# Copyright (c) 2020 SUSE LLC
|
# Copyright (c) 2024 SUSE LLC
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@@ -16,15 +16,16 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
%{?sle15_python_module_pythons}
|
||||||
Name: python-django-push-notifications
|
Name: python-django-push-notifications
|
||||||
Version: 2.0.0
|
Version: 3.0.2
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: Django package to send push notifications to mobile devices
|
Summary: Django package to send push notifications to mobile devices
|
||||||
License: MIT
|
License: MIT
|
||||||
URL: https://github.com/jazzband/django-push-notifications
|
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
|
Source: https://files.pythonhosted.org/packages/source/d/django-push-notifications/django-push-notifications-%{version}.tar.gz
|
||||||
BuildRequires: %{python_module setuptools}
|
Patch0: support-new-apns2.patch
|
||||||
|
BuildRequires: %{python_module setuptools_scm}
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: python-rpm-macros
|
BuildRequires: python-rpm-macros
|
||||||
Requires: python-Django >= 1.11
|
Requires: python-Django >= 1.11
|
||||||
@@ -34,11 +35,14 @@ BuildArch: noarch
|
|||||||
# SECTION test requirements
|
# SECTION test requirements
|
||||||
BuildRequires: %{python_module Django >= 1.11}
|
BuildRequires: %{python_module Django >= 1.11}
|
||||||
BuildRequires: %{python_module apns2}
|
BuildRequires: %{python_module apns2}
|
||||||
|
BuildRequires: %{python_module django-codemod}
|
||||||
BuildRequires: %{python_module djangorestframework >= 3.7}
|
BuildRequires: %{python_module djangorestframework >= 3.7}
|
||||||
BuildRequires: %{python_module mock}
|
BuildRequires: %{python_module pip}
|
||||||
|
BuildRequires: %{python_module pytest-cov}
|
||||||
BuildRequires: %{python_module pytest-django}
|
BuildRequires: %{python_module pytest-django}
|
||||||
BuildRequires: %{python_module pytest}
|
BuildRequires: %{python_module pytest}
|
||||||
BuildRequires: %{python_module pywebpush >= 1.3.0}
|
BuildRequires: %{python_module pywebpush >= 1.3.0}
|
||||||
|
BuildRequires: %{python_module wheel}
|
||||||
# /SECTION
|
# /SECTION
|
||||||
%python_subpackages
|
%python_subpackages
|
||||||
|
|
||||||
@@ -47,13 +51,14 @@ Send push notifications to mobile devices through GCM, APNS or WNS and
|
|||||||
to WebPush (Chrome, Firefox and Opera) in Django.
|
to WebPush (Chrome, Firefox and Opera) in Django.
|
||||||
|
|
||||||
%prep
|
%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
|
%build
|
||||||
%python_build
|
%pyproject_wheel
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%python_install
|
%pyproject_install
|
||||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||||
|
|
||||||
%check
|
%check
|
||||||
@@ -64,6 +69,7 @@ export PYTHONPATH="$(pwd)"
|
|||||||
%files %{python_files}
|
%files %{python_files}
|
||||||
%doc README.rst
|
%doc README.rst
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
%{python_sitelib}/*
|
%{python_sitelib}/push_notifications
|
||||||
|
%{python_sitelib}/django_push_notifications-%{version}.dist-info
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
108
support-new-apns2.patch
Normal file
108
support-new-apns2.patch
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
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)
|
Reference in New Issue
Block a user