async def test_send_keylist_update_bad_mediation_state(self):
    self.request.json.return_value = {'updates': [{'recipient_key': 'test-key0', 'action': 'add'}]}
    with async_mock.patch.object(test_module.MediationRecord, 'retrieve_by_id', async_mock.CoroutineMock(return_value=async_mock.MagicMock(state=MediationRecord.STATE_DENIED, connection_id='test-conn-id'))) as mock_retrieve_by_id, self.assertRaises(test_module.web.HTTPBadRequest):
        (await test_module.send_keylist_update(self.request))
async def test_send_keylist_update_bad_mediation_state(self):
    self.request.json.return_value = {'updates': [{'recipient_key': 'test-key0', 'action': 'add'}]}
    with async_mock.patch.object(test_module.MediationRecord, 'retrieve_by_id', async_mock.CoroutineMock(return_value=async_mock.MagicMock(state=MediationRecord.STATE_DENIED, connection_id='test-conn-id'))) as mock_retrieve_by_id, self.assertRaises(test_module.web.HTTPBadRequest):
        (await test_module.send_keylist_update(self.request))