attachment keyword in payload now supports Web Based URLs (#164)

This commit is contained in:
Chris Caron
2024-01-14 13:27:14 -05:00
committed by GitHub
parent 68fd580b84
commit 2b21ab71ef
6 changed files with 580 additions and 37 deletions

View File

@@ -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):
"""