async def test_webhook_update_registration(webhook_client, authed_api_client):
    'Test that a we can update an existing registration via webhook.'
    register_resp = (await authed_api_client.post('/api/mobile_app/registrations', json=REGISTER_CLEARTEXT))
    assert (register_resp.status == 201)
    register_json = (await register_resp.json())
    webhook_id = register_json[CONF_WEBHOOK_ID]
    update_container = {'type': 'update_registration', 'data': UPDATE}
    update_resp = (await webhook_client.post(f'/api/webhook/{webhook_id}', json=update_container))
    assert (update_resp.status == 200)
    update_json = (await update_resp.json())
    assert (update_json['app_version'] == '2.0.0')
    assert (CONF_WEBHOOK_ID not in update_json)
    assert (CONF_SECRET not in update_json)
Test that a we can update an existing registration via webhook.
async def test_webhook_update_registration(webhook_client, authed_api_client):
    
    register_resp = (await authed_api_client.post('/api/mobile_app/registrations', json=REGISTER_CLEARTEXT))
    assert (register_resp.status == 201)
    register_json = (await register_resp.json())
    webhook_id = register_json[CONF_WEBHOOK_ID]
    update_container = {'type': 'update_registration', 'data': UPDATE}
    update_resp = (await webhook_client.post(f'/api/webhook/{webhook_id}', json=update_container))
    assert (update_resp.status == 200)
    update_json = (await update_resp.json())
    assert (update_json['app_version'] == '2.0.0')
    assert (CONF_WEBHOOK_ID not in update_json)
    assert (CONF_SECRET not in update_json)