async def test_webhook_requires_encryption(webhook_client, create_registrations):
    'Test that encrypted registrations only accept encrypted data.'
    resp = (await webhook_client.post('/api/webhook/{}'.format(create_registrations[0]['webhook_id']), json=RENDER_TEMPLATE))
    assert (resp.status == 400)
    webhook_json = (await resp.json())
    assert ('error' in webhook_json)
    assert (webhook_json['success'] is False)
    assert (webhook_json['error']['code'] == 'encryption_required')
Test that encrypted registrations only accept encrypted data.
async def test_webhook_requires_encryption(webhook_client, create_registrations):
    
    resp = (await webhook_client.post('/api/webhook/{}'.format(create_registrations[0]['webhook_id']), json=RENDER_TEMPLATE))
    assert (resp.status == 400)
    webhook_json = (await resp.json())
    assert ('error' in webhook_json)
    assert (webhook_json['success'] is False)
    assert (webhook_json['error']['code'] == 'encryption_required')