Skip to content

Commit

Permalink
updated to work with Apprise v1.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
caronc committed May 11, 2024
1 parent 135dd4e commit 6e57e33
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions apprise_api/api/tests/test_notify.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from inspect import cleandoc

# Grant access to our Notification Manager Singleton
N_MGR = apprise.NotificationManager.NotificationManager()
N_MGR = apprise.manager_plugins.NotificationManager()


class NotifyTests(SimpleTestCase):
Expand Down Expand Up @@ -1176,7 +1176,7 @@ def test_notify_by_loaded_urls_with_json(self, mock_notify):
assert mock_notify.call_count == 1
assert response['content-type'].startswith('text/html')

@mock.patch('apprise.plugins.NotifyEmail.NotifyEmail.send')
@mock.patch('apprise.plugins.email.NotifyEmail.send')
def test_notify_with_filters(self, mock_send):
"""
Test workings of APPRISE_DENY_SERVICES and APPRISE_ALLOW_SERVICES
Expand Down
2 changes: 1 addition & 1 deletion apprise_api/api/tests/test_stateful_notify.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import inspect

# Grant access to our Notification Manager Singleton
N_MGR = apprise.NotificationManager.NotificationManager()
N_MGR = apprise.manager_plugins.NotificationManager()


class StatefulNotifyTests(SimpleTestCase):
Expand Down
6 changes: 3 additions & 3 deletions apprise_api/api/tests/test_stateless_notify.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import apprise

# Grant access to our Notification Manager Singleton
N_MGR = apprise.NotificationManager.NotificationManager()
N_MGR = apprise.manager_plugins.NotificationManager()


class StatelessNotifyTests(SimpleTestCase):
Expand Down Expand Up @@ -350,7 +350,7 @@ def test_stateless_notify_recursion(self, mock_notify):
}

# Monkey Patch
apprise.plugins.NotifyEmail.NotifyEmail.enabled = True
apprise.plugins.email.NotifyEmail.enabled = True

# At a minimum 'body' is requred
form = NotifyByUrlForm(data=form_data)
Expand Down Expand Up @@ -606,7 +606,7 @@ def test_notify_by_loaded_urls_with_json(self, mock_notify):
assert response.status_code == 400
assert mock_notify.call_count == 0

@mock.patch('apprise.plugins.NotifyJSON.NotifyJSON.send')
@mock.patch('apprise.plugins.custom_json.NotifyJSON.send')
def test_notify_with_filters(self, mock_send):
"""
Test workings of APPRISE_DENY_SERVICES and APPRISE_ALLOW_SERVICES
Expand Down
4 changes: 2 additions & 2 deletions apprise_api/api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ class AttachmentPayload(object):
)

# Access our Attachment Manager Singleton
A_MGR = apprise.AttachmentManager.AttachmentManager()
A_MGR = apprise.manager_attachment.AttachmentManager()

# Access our Notification Manager Singleton
N_MGR = apprise.NotificationManager.NotificationManager()
N_MGR = apprise.manager_plugins.NotificationManager()


class Attachment(A_MGR['file']):
Expand Down
2 changes: 1 addition & 1 deletion apprise_api/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def default(self, obj):
if isinstance(obj, set):
return list(obj)

elif isinstance(obj, apprise.AppriseLocale.LazyTranslation):
elif isinstance(obj, apprise.locale.LazyTranslation):
return str(obj)

return super().default(obj)
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# apprise @ git+https://github.com/caronc/apprise@custom-tag-or-version

## 3. The below grabs our stable version (generally the best choice):
apprise == 1.7.6
apprise == 1.8.0

## Apprise API Minimum Requirements
django
Expand Down

0 comments on commit 6e57e33

Please sign in to comment.