-
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stateless GET Parameter Support (#166)
- Loading branch information
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -372,6 +372,33 @@ def test_notify_default_urls(self, mock_notify): | |
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://[email protected]', | ||
'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): | ||
""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters