forked from leancloud/python-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_push.py
More file actions
35 lines (27 loc) · 701 Bytes
/
Copy pathtest_push.py
File metadata and controls
35 lines (27 loc) · 701 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# coding: utf-8
import os
from nose.tools import with_setup
import leancloud
from leancloud import push
__author__ = 'asaka'
def setup_func():
leancloud.init(
os.environ['APP_ID'],
os.environ['APP_KEY']
)
@with_setup(setup_func)
def test_basic_push():
data = {
"alert": {
"title": "标题",
"title-loc-key": "",
"body": "消息内容",
"action-loc-key": "",
"loc-key": "",
"loc-args": [""],
"launch-image": "",
}
}
query = leancloud.Query('_Installation').equal_to('objectId', 'xxx')
notification = push.send(data, where=query)
notification.fetch()