def post(self): data = InstallSchema().deserialize(request.json) user_id = data['user_id'] try: install = backend.get_install_by_user(user_id) except BackendError, ex: install = None
def post(self): data = InstallSchema().deserialize(request.json) user_id = data['user_id'] try: install = backend.get_install_by_user(user_id) except BackendError,ex: install = None
def test_new_install(self): user1 = backend.add_user('username1','photo_url','weibo_id1') device_token = '1234567890' install = backend.new_install(user1['id'],device_token) assert install['device_token'] == device_token install = backend.get_install_by_user(user1['id']) assert install['device_token'] == device_token install = backend.set_install(user1['id'],{'badge':20}) print install assert install['badge'] == 20
def test_new_install(self): user1 = backend.add_user('username1', 'photo_url', 'weibo_id1') device_token = '1234567890' install = backend.new_install(user1['id'], device_token) assert install['device_token'] == device_token install = backend.get_install_by_user(user1['id']) assert install['device_token'] == device_token install = backend.set_install(user1['id'], {'badge': 20}) print install assert install['badge'] == 20