This commit is contained in:
parent
9f25287a66
commit
a5f8140d66
|
@ -67,6 +67,7 @@ def send_webpush(private_key, subscription_info, **kwargs):
|
|||
message = json.dumps(kwargs)
|
||||
|
||||
headers = get_vapid_headers(private_key, subscription_info)
|
||||
headers['Urgency'] = 'low'
|
||||
webpusher = pywebpush.WebPusher(subscription_info)
|
||||
response = webpusher.send(
|
||||
data=message,
|
||||
|
|
|
@ -97,7 +97,7 @@ def test_webpush_notification(app, john_doe, caplog):
|
|||
mock.call({'sample': 'content', 'endpoint': 'https://push.example.com:1000/'}),
|
||||
mock.call().send(
|
||||
data='{"summary": "test", "body": "hello world", "url": ""}',
|
||||
headers={'Authorization': mock.ANY},
|
||||
headers={'Authorization': mock.ANY, 'Urgency': 'low'},
|
||||
ttl=2592000,
|
||||
),
|
||||
mock.call().send().raise_for_status(),
|
||||
|
@ -113,7 +113,7 @@ def test_webpush_notification(app, john_doe, caplog):
|
|||
mock.call({'sample': 'content', 'endpoint': 'https://push.example.com:1000/'}),
|
||||
mock.call().send(
|
||||
data='{"summary": "test", "body": "hello world", "url": ""}',
|
||||
headers={'Authorization': mock.ANY},
|
||||
headers={'Authorization': mock.ANY, 'Urgency': 'low'},
|
||||
ttl=2592000,
|
||||
),
|
||||
mock.call().send().raise_for_status(),
|
||||
|
|
Loading…
Reference in New Issue