async def test_set_default_mediator_storage_error(self):
    self.request.match_info = {'mediation_id': 'bad_id'}
    self.request.query = {}
    self.context.session = async_mock.CoroutineMock()
    with async_mock.patch.object(test_module.MediationManager, 'get_default_mediator', async_mock.CoroutineMock(side_effect=test_module.StorageError())) as mock_mgr_get_default_record, async_mock.patch.object(test_module.MediationManager, 'set_default_mediator_by_id', async_mock.CoroutineMock(side_effect=test_module.StorageError())) as mock_mgr_set_default_record_by_id, async_mock.patch.object(test_module.web, 'json_response') as json_response:
        with self.assertRaises(test_module.web.HTTPBadRequest):
            (await test_module.set_default_mediator(self.request))
async def test_set_default_mediator_storage_error(self):
    self.request.match_info = {'mediation_id': 'bad_id'}
    self.request.query = {}
    self.context.session = async_mock.CoroutineMock()
    with async_mock.patch.object(test_module.MediationManager, 'get_default_mediator', async_mock.CoroutineMock(side_effect=test_module.StorageError())) as mock_mgr_get_default_record, async_mock.patch.object(test_module.MediationManager, 'set_default_mediator_by_id', async_mock.CoroutineMock(side_effect=test_module.StorageError())) as mock_mgr_set_default_record_by_id, async_mock.patch.object(test_module.web, 'json_response') as json_response:
        with self.assertRaises(test_module.web.HTTPBadRequest):
            (await test_module.set_default_mediator(self.request))