Skip to content

Commit

Permalink
fix: [FC-0047] fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
NiedielnitsevIvan committed Jun 21, 2024
1 parent f6e8b7b commit 309b5a2
Show file tree
Hide file tree
Showing 10 changed files with 73 additions and 74 deletions.
6 changes: 3 additions & 3 deletions edx_ace/channel/push_notification.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def deliver(self, message: Message, rendered_message: RenderedPushNotification)
"""
device_tokens = self.get_user_device_tokens(message.recipient.lms_user_id)
if not device_tokens:
LOG.info(f'Recipient {message.recipient.email_address} has no push token. Skipping push notification.')
LOG.info('Recipient %s has no push token. Skipping push notification.', message.recipient.email_address)
return

for token in device_tokens:
Expand All @@ -69,8 +69,8 @@ def send_message(self, message: Message, token: str, rendered_message: RenderedP
try:
send_message(token, message, settings.FCM_APP_NAME)
except Exception as e:
LOG.exception(f'Failed to send push notification to {token}')
raise FatalChannelDeliveryError(f'Failed to send push notification to {token}')
LOG.exception(f'Failed to send push notification to %s', token)
raise FatalChannelDeliveryError(f'Failed to send push notification to {token}') from e

@staticmethod
def collect_apns_config(notification_data: dict) -> APNSConfig:
Expand Down
3 changes: 1 addition & 2 deletions requirements/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ six
stevedore>=1.10.0

firebase-admin==6.5.0

-e git+https://github.com/jazzband/django-push-notifications.git@0f7918136b5e6a9aec83d6513aad5b0f12143a9f#egg=django_push_notifications
django-push-notifications==3.1.0
6 changes: 3 additions & 3 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ colorama==0.4.6
# via tox
distlib==0.3.8
# via virtualenv
filelock==3.14.0
filelock==3.15.3
# via
# tox
# virtualenv
packaging==24.0
packaging==24.1
# via
# pyproject-api
# tox
Expand All @@ -28,7 +28,7 @@ pluggy==1.5.0
# via tox
pyproject-api==1.6.1
# via tox
tox==4.15.0
tox==4.15.1
# via -r requirements/ci.in
virtualenv==20.26.2
# via tox
42 changes: 21 additions & 21 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
#
# make upgrade
#
-e git+https://github.com/jazzband/django-push-notifications.git@0f7918136b5e6a9aec83d6513aad5b0f12143a9f#egg=django_push_notifications
# via -r requirements/base.in
asgiref==3.8.1
# via django
astroid==3.2.2
Expand All @@ -22,7 +20,7 @@ cachetools==5.3.3
# via
# google-auth
# tox
certifi==2024.2.2
certifi==2024.6.2
# via requests
cffi==1.16.0
# via cryptography
Expand All @@ -44,7 +42,7 @@ code-annotations==1.8.0
# via edx-lint
colorama==0.4.6
# via tox
cryptography==42.0.7
cryptography==42.0.8
# via pyjwt
diff-cover==9.0.0
# via -r requirements/dev.in
Expand All @@ -58,6 +56,8 @@ django==4.2.13
# -r requirements/base.in
# django-push-notifications
# edx-i18n-tools
django-push-notifications==3.1.0
# via -r requirements/base.in
docutils==0.21.2
# via readme-renderer
edx-i18n-tools==1.6.0
Expand All @@ -66,7 +66,7 @@ edx-lint==5.3.6
# via
# -r requirements/dev.in
# -r requirements/quality.in
filelock==3.14.0
filelock==3.15.3
# via
# tox
# virtualenv
Expand All @@ -79,9 +79,9 @@ google-api-core[grpc]==2.19.0
# google-cloud-core
# google-cloud-firestore
# google-cloud-storage
google-api-python-client==2.129.0
google-api-python-client==2.134.0
# via firebase-admin
google-auth==2.29.0
google-auth==2.30.0
# via
# google-api-core
# google-api-python-client
Expand All @@ -97,19 +97,19 @@ google-cloud-core==2.4.1
# google-cloud-storage
google-cloud-firestore==2.16.0
# via firebase-admin
google-cloud-storage==2.16.0
google-cloud-storage==2.17.0
# via firebase-admin
google-crc32c==1.5.0
# via
# google-cloud-storage
# google-resumable-media
google-resumable-media==2.7.0
google-resumable-media==2.7.1
# via google-cloud-storage
googleapis-common-protos==1.63.0
googleapis-common-protos==1.63.1
# via
# google-api-core
# grpcio-status
grpcio==1.63.0
grpcio==1.64.1
# via
# google-api-core
# grpcio-status
Expand Down Expand Up @@ -155,15 +155,15 @@ mccabe==0.7.0
# via pylint
mdurl==0.1.2
# via markdown-it-py
more-itertools==10.2.0
more-itertools==10.3.0
# via
# jaraco-classes
# jaraco-functools
msgpack==1.0.8
# via cachecontrol
nh3==0.2.17
# via readme-renderer
packaging==24.0
packaging==24.1
# via
# build
# pyproject-api
Expand All @@ -174,7 +174,7 @@ pbr==6.0.0
# via stevedore
pip-tools==7.4.1
# via -r requirements/dev.in
pkginfo==1.10.0
pkginfo==1.11.1
# via twine
platformdirs==4.2.2
# via
Expand All @@ -187,7 +187,7 @@ pluggy==1.5.0
# tox
polib==1.2.0
# via edx-i18n-tools
proto-plus==1.23.0
proto-plus==1.24.0
# via
# google-api-core
# google-cloud-firestore
Expand All @@ -204,7 +204,7 @@ pyasn1==0.6.0
# rsa
pyasn1-modules==0.4.0
# via google-auth
pycodestyle==2.11.1
pycodestyle==2.12.0
# via -r requirements/quality.in
pycparser==2.22
# via cffi
Expand All @@ -217,7 +217,7 @@ pygments==2.18.0
# rich
pyjwt[crypto]==2.8.0
# via firebase-admin
pylint==3.2.2
pylint==3.2.3
# via
# edx-lint
# pylint-celery
Expand Down Expand Up @@ -249,7 +249,7 @@ pyyaml==6.0.1
# edx-i18n-tools
readme-renderer==43.0
# via twine
requests==2.31.0
requests==2.32.3
# via
# cachecontrol
# google-api-core
Expand Down Expand Up @@ -286,13 +286,13 @@ text-unidecode==1.3
# via python-slugify
tomlkit==0.12.5
# via pylint
tox==4.15.0
tox==4.15.1
# via -r requirements/dev.in
twine==5.1.0
# via -r requirements/dev.in
uritemplate==4.1.1
# via google-api-python-client
urllib3==2.2.1
urllib3==2.2.2
# via
# requests
# twine
Expand All @@ -302,7 +302,7 @@ wheel==0.43.0
# via
# -r requirements/dev.in
# pip-tools
zipp==3.17.0
zipp==3.19.2
# via importlib-metadata

# The following packages are considered to be unsafe in a requirements file:
Expand Down
40 changes: 20 additions & 20 deletions requirements/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
#
# make upgrade
#
-e git+https://github.com/jazzband/django-push-notifications.git@0f7918136b5e6a9aec83d6513aad5b0f12143a9f#egg=django_push_notifications
# via -r requirements/base.in
accessible-pygments==0.0.5
# via pydata-sphinx-theme
alabaster==0.7.16
Expand All @@ -24,19 +22,21 @@ cachecontrol==0.14.0
# via firebase-admin
cachetools==5.3.3
# via google-auth
certifi==2024.2.2
certifi==2024.6.2
# via requests
cffi==1.16.0
# via cryptography
charset-normalizer==3.3.2
# via requests
cryptography==42.0.7
cryptography==42.0.8
# via pyjwt
django==4.2.13
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -r requirements/base.in
# django-push-notifications
django-push-notifications==3.1.0
# via -r requirements/base.in
doc8==1.1.1
# via -r requirements/doc.in
docutils==0.20.1
Expand All @@ -55,9 +55,9 @@ google-api-core[grpc]==2.19.0
# google-cloud-core
# google-cloud-firestore
# google-cloud-storage
google-api-python-client==2.129.0
google-api-python-client==2.134.0
# via firebase-admin
google-auth==2.29.0
google-auth==2.30.0
# via
# google-api-core
# google-api-python-client
Expand All @@ -73,19 +73,19 @@ google-cloud-core==2.4.1
# google-cloud-storage
google-cloud-firestore==2.16.0
# via firebase-admin
google-cloud-storage==2.16.0
google-cloud-storage==2.17.0
# via firebase-admin
google-crc32c==1.5.0
# via
# google-cloud-storage
# google-resumable-media
google-resumable-media==2.7.0
google-resumable-media==2.7.1
# via google-cloud-storage
googleapis-common-protos==1.63.0
googleapis-common-protos==1.63.1
# via
# google-api-core
# grpcio-status
grpcio==1.63.0
grpcio==1.64.1
# via
# google-api-core
# grpcio-status
Expand Down Expand Up @@ -119,23 +119,23 @@ markupsafe==2.1.5
# via jinja2
mdurl==0.1.2
# via markdown-it-py
more-itertools==10.2.0
more-itertools==10.3.0
# via
# jaraco-classes
# jaraco-functools
msgpack==1.0.8
# via cachecontrol
nh3==0.2.17
# via readme-renderer
packaging==24.0
packaging==24.1
# via
# pydata-sphinx-theme
# sphinx
pbr==6.0.0
# via stevedore
pkginfo==1.10.0
pkginfo==1.11.1
# via twine
proto-plus==1.23.0
proto-plus==1.24.0
# via
# google-api-core
# google-cloud-firestore
Expand All @@ -154,7 +154,7 @@ pyasn1-modules==0.4.0
# via google-auth
pycparser==2.22
# via cffi
pydata-sphinx-theme==0.15.2
pydata-sphinx-theme==0.15.3
# via sphinx-book-theme
pygments==2.18.0
# via
Expand All @@ -174,7 +174,7 @@ readme-renderer==43.0
# via
# -r requirements/doc.in
# twine
requests==2.31.0
requests==2.32.3
# via
# cachecontrol
# google-api-core
Expand Down Expand Up @@ -210,7 +210,7 @@ sphinx==7.3.7
# -r requirements/doc.in
# pydata-sphinx-theme
# sphinx-book-theme
sphinx-book-theme==1.1.2
sphinx-book-theme==1.1.3
# via -r requirements/doc.in
sphinxcontrib-applehelp==1.0.8
# via sphinx
Expand All @@ -232,13 +232,13 @@ stevedore==5.2.0
# doc8
twine==5.1.0
# via -r requirements/doc.in
typing-extensions==4.11.0
typing-extensions==4.12.2
# via pydata-sphinx-theme
uritemplate==4.1.1
# via google-api-python-client
urllib3==2.2.1
urllib3==2.2.2
# via
# requests
# twine
zipp==3.17.0
zipp==3.19.2
# via importlib-metadata
2 changes: 1 addition & 1 deletion requirements/pip-tools.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ build==1.2.1
# via pip-tools
click==8.1.7
# via pip-tools
packaging==24.0
packaging==24.1
# via build
pip-tools==7.4.1
# via -r requirements/pip-tools.in
Expand Down
4 changes: 2 additions & 2 deletions requirements/pip.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ wheel==0.43.0
# via -r requirements/pip.in

# The following packages are considered to be unsafe in a requirements file:
pip==24.0
pip==24.1
# via -r requirements/pip.in
setuptools==69.5.1
setuptools==70.1.0
# via -r requirements/pip.in
4 changes: 2 additions & 2 deletions requirements/quality.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ pbr==6.0.0
# via stevedore
platformdirs==4.2.2
# via pylint
pycodestyle==2.11.1
pycodestyle==2.12.0
# via -r requirements/quality.in
pydocstyle==6.3.0
# via -r requirements/quality.in
pylint==3.2.2
pylint==3.2.3
# via
# edx-lint
# pylint-celery
Expand Down
Loading

0 comments on commit 309b5a2

Please sign in to comment.