mirror of
https://github.com/caronc/apprise-api.git
synced 2025-08-17 10:00:56 +02:00
Stateless GET Parameter Support (#166)
This commit is contained in:
@ -372,6 +372,33 @@ class StatelessNotifyTests(SimpleTestCase):
|
||||
assert response.status_code == 200
|
||||
assert mock_notify.call_count == 1
|
||||
|
||||
@mock.patch('apprise.Apprise.notify')
|
||||
def test_notify_with_get_parameters(self, mock_notify):
|
||||
"""
|
||||
Test sending a simple notification using JSON with GET
|
||||
parameters
|
||||
"""
|
||||
|
||||
# Set our return value
|
||||
mock_notify.return_value = True
|
||||
|
||||
# Preare our JSON data
|
||||
json_data = {
|
||||
'urls': 'json://user@my.domain.ca',
|
||||
'body': 'test notifiction',
|
||||
}
|
||||
|
||||
# Send our notification as a JSON object
|
||||
response = self.client.post(
|
||||
'/notify/?title=my%20title&format=text&type=info',
|
||||
data=json.dumps(json_data),
|
||||
content_type='application/json',
|
||||
)
|
||||
|
||||
# Still supported
|
||||
assert response.status_code == 200
|
||||
assert mock_notify.call_count == 1
|
||||
|
||||
@mock.patch('apprise.Apprise.notify')
|
||||
def test_notify_by_loaded_urls_with_json(self, mock_notify):
|
||||
"""
|
||||
|
Reference in New Issue
Block a user