mirror of
https://github.com/caronc/apprise-api.git
synced 2025-08-24 12:45:22 +02:00
attachment keyword in payload now supports Web Based URLs (#164)
This commit is contained in:
@@ -828,6 +828,25 @@ class NotifyTests(SimpleTestCase):
|
||||
assert response.status_code == 424
|
||||
assert mock_notify.call_count == 2
|
||||
|
||||
# One more test but we test our URL fetching
|
||||
mock_notify.side_effect = True
|
||||
|
||||
# Reset our mock object
|
||||
mock_notify.reset_mock()
|
||||
|
||||
# Preare our form data
|
||||
form_data = {
|
||||
'body': 'test notifiction',
|
||||
'attachment': 'https://localhost/invalid/path/to/image.png',
|
||||
}
|
||||
|
||||
# Send our notification
|
||||
response = self.client.post(
|
||||
'/notify/{}'.format(key), form_data)
|
||||
# We fail because we couldn't retrieve our attachment
|
||||
assert response.status_code == 400
|
||||
assert mock_notify.call_count == 0
|
||||
|
||||
@mock.patch('apprise.Apprise.notify')
|
||||
def test_notify_by_loaded_urls_with_json(self, mock_notify):
|
||||
"""
|
||||
|
Reference in New Issue
Block a user