コード例 #1
0
    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
コード例 #2
0
ファイル: user.py プロジェクト: MonaDogg/motiky
 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
コード例 #3
0
ファイル: test_backend.py プロジェクト: MonaDogg/motiky
    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
コード例 #4
0
    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