Skip to content

Commit

Permalink
Add fixes from PR suggestions, update tested environments
Browse files Browse the repository at this point in the history
  • Loading branch information
pomali authored and 50-Course committed Oct 3, 2024
1 parent 7eaec6f commit 9733b22
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ classifiers =
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Topic :: Internet :: WWW/HTTP
Topic :: System :: Networking
Expand Down
2 changes: 0 additions & 2 deletions tests/test_apns_async_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,8 @@ def test_apns_send_bulk_message(self, mock_apns):
APNSDevice.objects.all().send_message("Hello world", expiration=time.time() + 3)

[call1, call2] = mock_apns.return_value.send_notification.call_args_list
print(call1)
req1 = call1.args[0]
req2 = call2.args[0]
print(dir(req1))

self.assertEqual(req1.device_token, "abc")
self.assertEqual(req2.device_token, "def")
Expand Down
2 changes: 1 addition & 1 deletion tests/test_apns_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from push_notifications.exceptions import APNSError
from push_notifications.models import APNSDevice
except AttributeError:
except (AttributeError, ModuleNotFoundError):
# skipping because apns2 is not supported on python 3.10
# it uses hyper that imports from collections which were changed in 3.10
# and we would get "AttributeError: module 'collections' has no attribute 'MutableMapping'"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_apns_push_payload.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from apns2.client import NotificationPriority
from push_notifications.apns import _apns_send
from push_notifications.exceptions import APNSUnsupportedPriority
except AttributeError:
except (AttributeError, ModuleNotFoundError):
# skipping because apns2 is not supported on python 3.10
# it uses hyper that imports from collections which were changed in 3.10
# and we would get "AttributeError: module 'collections' has no attribute 'MutableMapping'"
Expand Down
7 changes: 3 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ skipsdist = False
usedevelop = true
envlist =
py{36,37,38,39}-dj{22,32}
py{38,39,310}-dj{40,405}
py311-dj42
py{38,39,310,311}-dj{40,405,42}
flake8

[gh-actions]
Expand Down Expand Up @@ -33,7 +32,6 @@ commands =
pytest
pytest --ds=tests.settings_unique tests/tst_unique.py
deps =
apns2
pytest
pytest-cov
pytest-django
Expand All @@ -45,7 +43,8 @@ deps =
dj40: Django>=4.0,<4.0.5
dj405: Django>=4.0.5,<4.1
dj42: Django>=4.2,<4.3
dj42: aioapns>=3.1,<3.2
py{36,37,38,39}: apns2
py{310,311}: aioapns>=3.1,<3.2

[testenv:flake8]
commands = flake8 --exit-zero
Expand Down

0 comments on commit 9733b22

Please sign in to comment.