mirror of
https://github.com/caronc/apprise-api.git
synced 2024-12-04 22:10:42 +01:00
updated to work with Apprise v1.8.0
This commit is contained in:
parent
135dd4e98d
commit
6e57e33b8f
@ -33,7 +33,7 @@ import apprise
|
|||||||
from inspect import cleandoc
|
from inspect import cleandoc
|
||||||
|
|
||||||
# Grant access to our Notification Manager Singleton
|
# Grant access to our Notification Manager Singleton
|
||||||
N_MGR = apprise.NotificationManager.NotificationManager()
|
N_MGR = apprise.manager_plugins.NotificationManager()
|
||||||
|
|
||||||
|
|
||||||
class NotifyTests(SimpleTestCase):
|
class NotifyTests(SimpleTestCase):
|
||||||
@ -1176,7 +1176,7 @@ class NotifyTests(SimpleTestCase):
|
|||||||
assert mock_notify.call_count == 1
|
assert mock_notify.call_count == 1
|
||||||
assert response['content-type'].startswith('text/html')
|
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):
|
def test_notify_with_filters(self, mock_send):
|
||||||
"""
|
"""
|
||||||
Test workings of APPRISE_DENY_SERVICES and APPRISE_ALLOW_SERVICES
|
Test workings of APPRISE_DENY_SERVICES and APPRISE_ALLOW_SERVICES
|
||||||
|
@ -35,7 +35,7 @@ import requests
|
|||||||
import inspect
|
import inspect
|
||||||
|
|
||||||
# Grant access to our Notification Manager Singleton
|
# Grant access to our Notification Manager Singleton
|
||||||
N_MGR = apprise.NotificationManager.NotificationManager()
|
N_MGR = apprise.manager_plugins.NotificationManager()
|
||||||
|
|
||||||
|
|
||||||
class StatefulNotifyTests(SimpleTestCase):
|
class StatefulNotifyTests(SimpleTestCase):
|
||||||
|
@ -33,7 +33,7 @@ import json
|
|||||||
import apprise
|
import apprise
|
||||||
|
|
||||||
# Grant access to our Notification Manager Singleton
|
# Grant access to our Notification Manager Singleton
|
||||||
N_MGR = apprise.NotificationManager.NotificationManager()
|
N_MGR = apprise.manager_plugins.NotificationManager()
|
||||||
|
|
||||||
|
|
||||||
class StatelessNotifyTests(SimpleTestCase):
|
class StatelessNotifyTests(SimpleTestCase):
|
||||||
@ -350,7 +350,7 @@ class StatelessNotifyTests(SimpleTestCase):
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Monkey Patch
|
# Monkey Patch
|
||||||
apprise.plugins.NotifyEmail.NotifyEmail.enabled = True
|
apprise.plugins.email.NotifyEmail.enabled = True
|
||||||
|
|
||||||
# At a minimum 'body' is requred
|
# At a minimum 'body' is requred
|
||||||
form = NotifyByUrlForm(data=form_data)
|
form = NotifyByUrlForm(data=form_data)
|
||||||
@ -606,7 +606,7 @@ class StatelessNotifyTests(SimpleTestCase):
|
|||||||
assert response.status_code == 400
|
assert response.status_code == 400
|
||||||
assert mock_notify.call_count == 0
|
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):
|
def test_notify_with_filters(self, mock_send):
|
||||||
"""
|
"""
|
||||||
Test workings of APPRISE_DENY_SERVICES and APPRISE_ALLOW_SERVICES
|
Test workings of APPRISE_DENY_SERVICES and APPRISE_ALLOW_SERVICES
|
||||||
|
@ -78,10 +78,10 @@ STORE_MODES = (
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Access our Attachment Manager Singleton
|
# Access our Attachment Manager Singleton
|
||||||
A_MGR = apprise.AttachmentManager.AttachmentManager()
|
A_MGR = apprise.manager_attachment.AttachmentManager()
|
||||||
|
|
||||||
# Access our Notification Manager Singleton
|
# Access our Notification Manager Singleton
|
||||||
N_MGR = apprise.NotificationManager.NotificationManager()
|
N_MGR = apprise.manager_plugins.NotificationManager()
|
||||||
|
|
||||||
|
|
||||||
class Attachment(A_MGR['file']):
|
class Attachment(A_MGR['file']):
|
||||||
|
@ -100,7 +100,7 @@ class JSONEncoder(DjangoJSONEncoder):
|
|||||||
if isinstance(obj, set):
|
if isinstance(obj, set):
|
||||||
return list(obj)
|
return list(obj)
|
||||||
|
|
||||||
elif isinstance(obj, apprise.AppriseLocale.LazyTranslation):
|
elif isinstance(obj, apprise.locale.LazyTranslation):
|
||||||
return str(obj)
|
return str(obj)
|
||||||
|
|
||||||
return super().default(obj)
|
return super().default(obj)
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
# apprise @ git+https://github.com/caronc/apprise@custom-tag-or-version
|
# apprise @ git+https://github.com/caronc/apprise@custom-tag-or-version
|
||||||
|
|
||||||
## 3. The below grabs our stable version (generally the best choice):
|
## 3. The below grabs our stable version (generally the best choice):
|
||||||
apprise == 1.7.6
|
apprise == 1.8.0
|
||||||
|
|
||||||
## Apprise API Minimum Requirements
|
## Apprise API Minimum Requirements
|
||||||
django
|
django
|
||||||
|
Loading…
Reference in New Issue
Block a user